diff options
Diffstat (limited to 'lib/font.c')
-rw-r--r-- | lib/font.c | 45 |
1 files changed, 23 insertions, 22 deletions
@@ -1,20 +1,21 @@ -/* font.c: define (more or less) format-independent font operations. +# font.c: define (more or less) format-independent font operations. +# +# Copyright (C) 1992, 2011 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# -Copyright (C) 1992, 2011 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" @@ -58,7 +59,7 @@ typedef struct static void delete_internal_font (string filename); static internal_font_type *find_internal_font (string font_name); static void save_internal_font (string font_name, internal_font_type); - + /* Starting with FONT_NAME as the base filename, e.g., `cmr10', we try various extensions to find a PK or GF file at resolution DPI. This bitmap font defines the shapes of the characters. */ @@ -216,7 +217,7 @@ get_font (string font_name, unsigned dpi) return font; } - + /* Close the files we have opened, for tidiness. */ void @@ -250,7 +251,7 @@ close_font (string font_name) delete_internal_font (font_name); } - + /* Look for the character numbered CODE in the font FONT_NAME. If it doesn't exist, return NULL. Otherwise, fill in a `char_info_type' structure and return a pointer to it. @@ -305,7 +306,7 @@ get_char (string font_name, one_byte code) return c; } - + /* Look for the character numbered CODE in the font FONT_NAME. If it doesn't exist, return NULL. Otherwise, fill in a `raw_char_type' structure and return a pointer to it. @@ -351,7 +352,7 @@ free_raw_char (raw_char_type *raw_char) free (RAW_CHAR_BYTES (*raw_char)); free (raw_char); } - + /* Print the character C to the file F, using ordinary characters. */ void @@ -381,7 +382,7 @@ print_char (FILE *f, char_info_type c) fprintf (f, "%3d\t%u\n", CHAR_MAX_ROW (c) - this_row, this_row); } } - + /* We want to implement a typical key/value setup: here we are given the key (FONT_NAME) and the value (F). We assign an index number to FONT_NAME, and store it and F in parallel lists. If we are passed a |