diff options
| author | Eli Zaretskii | 2011-05-29 22:04:01 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-05-29 22:04:01 +0300 |
| commit | 56dd2d861f0beab1be2b12900fda133e48bd60fa (patch) | |
| tree | dd29e78c65ed85e2d8e112e50ca8fc268ae787cb /src | |
| parent | 58539c631a46db82b7f254bfcd00d7f02d96d366 (diff) | |
| download | emacs-56dd2d861f0beab1be2b12900fda133e48bd60fa.tar.gz emacs-56dd2d861f0beab1be2b12900fda133e48bd60fa.zip | |
src/font.[ch]: Fix typos in comments and strings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.c | 61 | ||||
| -rw-r--r-- | src/font.h | 72 |
2 files changed, 66 insertions, 67 deletions
diff --git a/src/font.c b/src/font.c index edbdc958539..398198324a4 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -136,7 +136,7 @@ Lisp_Object Qja, Qko; | |||
| 136 | 136 | ||
| 137 | static Lisp_Object QCuser_spec; | 137 | static Lisp_Object QCuser_spec; |
| 138 | 138 | ||
| 139 | /* Alist of font registry symbol and the corresponding charsets | 139 | /* Alist of font registry symbols and the corresponding charset |
| 140 | information. The information is retrieved from | 140 | information. The information is retrieved from |
| 141 | Vfont_encoding_alist on demand. | 141 | Vfont_encoding_alist on demand. |
| 142 | 142 | ||
| @@ -226,9 +226,9 @@ static int num_font_drivers; | |||
| 226 | 226 | ||
| 227 | 227 | ||
| 228 | /* Return a Lispy value of a font property value at STR and LEN bytes. | 228 | /* Return a Lispy value of a font property value at STR and LEN bytes. |
| 229 | If STR is "*", it returns nil. | 229 | If STR is "*", return nil. |
| 230 | If FORCE_SYMBOL is zero and all characters in STR are digits, it | 230 | If FORCE_SYMBOL is zero and all characters in STR are digits, |
| 231 | returns an integer. Otherwise, it returns a symbol interned from | 231 | return an integer. Otherwise, return a symbol interned from |
| 232 | STR. */ | 232 | STR. */ |
| 233 | 233 | ||
| 234 | Lisp_Object | 234 | Lisp_Object |
| @@ -251,7 +251,7 @@ font_intern_prop (const char *str, int len, int force_symbol) | |||
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | /* The following code is copied from the function intern (in | 253 | /* The following code is copied from the function intern (in |
| 254 | lread.c), and modified to suite our purpose. */ | 254 | lread.c), and modified to suit our purpose. */ |
| 255 | obarray = Vobarray; | 255 | obarray = Vobarray; |
| 256 | if (!VECTORP (obarray) || ASIZE (obarray) == 0) | 256 | if (!VECTORP (obarray) || ASIZE (obarray) == 0) |
| 257 | obarray = check_obarray (obarray); | 257 | obarray = check_obarray (obarray); |
| @@ -305,7 +305,7 @@ font_pixel_size (FRAME_PTR f, Lisp_Object spec) | |||
| 305 | font vector. If VAL is not valid (i.e. not registered in | 305 | font vector. If VAL is not valid (i.e. not registered in |
| 306 | font_style_table), return -1 if NOERROR is zero, and return a | 306 | font_style_table), return -1 if NOERROR is zero, and return a |
| 307 | proper index if NOERROR is nonzero. In that case, register VAL in | 307 | proper index if NOERROR is nonzero. In that case, register VAL in |
| 308 | font_style_table if VAL is a symbol, and return a closest index if | 308 | font_style_table if VAL is a symbol, and return the closest index if |
| 309 | VAL is an integer. */ | 309 | VAL is an integer. */ |
| 310 | 310 | ||
| 311 | int | 311 | int |
| @@ -473,7 +473,7 @@ font_registry_charsets (Lisp_Object registry, struct charset **encoding, struct | |||
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | 475 | ||
| 476 | /* Font property value validaters. See the comment of | 476 | /* Font property value validators. See the comment of |
| 477 | font_property_table for the meaning of the arguments. */ | 477 | font_property_table for the meaning of the arguments. */ |
| 478 | 478 | ||
| 479 | static Lisp_Object font_prop_validate (int, Lisp_Object, Lisp_Object); | 479 | static Lisp_Object font_prop_validate (int, Lisp_Object, Lisp_Object); |
| @@ -591,7 +591,7 @@ font_prop_validate_otf (Lisp_Object prop, Lisp_Object val) | |||
| 591 | return val; | 591 | return val; |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | /* Structure of known font property keys and validater of the | 594 | /* Structure of known font property keys and validator of the |
| 595 | values. */ | 595 | values. */ |
| 596 | static const struct | 596 | static const struct |
| 597 | { | 597 | { |
| @@ -742,7 +742,7 @@ enum xlfd_field_mask | |||
| 742 | }; | 742 | }; |
| 743 | 743 | ||
| 744 | 744 | ||
| 745 | /* Parse P pointing the pixel/point size field of the form | 745 | /* Parse P pointing to the pixel/point size field of the form |
| 746 | `[A B C D]' which specifies a transformation matrix: | 746 | `[A B C D]' which specifies a transformation matrix: |
| 747 | 747 | ||
| 748 | A B 0 | 748 | A B 0 |
| @@ -775,7 +775,7 @@ parse_matrix (const char *p) | |||
| 775 | } | 775 | } |
| 776 | 776 | ||
| 777 | /* Expand a wildcard field in FIELD (the first N fields are filled) to | 777 | /* Expand a wildcard field in FIELD (the first N fields are filled) to |
| 778 | multiple fields to fill in all 14 XLFD fields while restring a | 778 | multiple fields to fill in all 14 XLFD fields while restricting a |
| 779 | field position by its contents. */ | 779 | field position by its contents. */ |
| 780 | 780 | ||
| 781 | static int | 781 | static int |
| @@ -2054,14 +2054,14 @@ font_rescale_ratio (Lisp_Object font_entity) | |||
| 2054 | font-spec. The score value is 32 bit (`unsigned'), and the smaller | 2054 | font-spec. The score value is 32 bit (`unsigned'), and the smaller |
| 2055 | the value is, the closer the font is to the font-spec. | 2055 | the value is, the closer the font is to the font-spec. |
| 2056 | 2056 | ||
| 2057 | The lowest 2 bits of the score is used for driver type. The font | 2057 | The lowest 2 bits of the score are used for driver type. The font |
| 2058 | available by the most preferred font driver is 0. | 2058 | available by the most preferred font driver is 0. |
| 2059 | 2059 | ||
| 2060 | Each 7-bit in the higher 28 bits are used for numeric properties | 2060 | The 4 7-bit fields in the higher 28 bits are used for numeric properties |
| 2061 | WEIGHT, SLANT, WIDTH, and SIZE. */ | 2061 | WEIGHT, SLANT, WIDTH, and SIZE. */ |
| 2062 | 2062 | ||
| 2063 | /* How many bits to shift to store the difference value of each font | 2063 | /* How many bits to shift to store the difference value of each font |
| 2064 | property in a score. Note that flots for FONT_TYPE_INDEX and | 2064 | property in a score. Note that floats for FONT_TYPE_INDEX and |
| 2065 | FONT_REGISTRY_INDEX are not used. */ | 2065 | FONT_REGISTRY_INDEX are not used. */ |
| 2066 | static int sort_shift_bits[FONT_SIZE_INDEX + 1]; | 2066 | static int sort_shift_bits[FONT_SIZE_INDEX + 1]; |
| 2067 | 2067 | ||
| @@ -2598,7 +2598,7 @@ font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) | |||
| 2598 | static Lisp_Object scratch_font_spec, scratch_font_prefer; | 2598 | static Lisp_Object scratch_font_spec, scratch_font_prefer; |
| 2599 | 2599 | ||
| 2600 | /* Check each font-entity in VEC, and return a list of font-entities | 2600 | /* Check each font-entity in VEC, and return a list of font-entities |
| 2601 | that satisfy this condition: | 2601 | that satisfy these conditions: |
| 2602 | (1) matches with SPEC and SIZE if SPEC is not nil, and | 2602 | (1) matches with SPEC and SIZE if SPEC is not nil, and |
| 2603 | (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil). | 2603 | (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil). |
| 2604 | */ | 2604 | */ |
| @@ -3018,8 +3018,8 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop) | |||
| 3018 | attrs[LFACE_FONT_INDEX] = font; | 3018 | attrs[LFACE_FONT_INDEX] = font; |
| 3019 | } | 3019 | } |
| 3020 | 3020 | ||
| 3021 | /* Selecte a font from ENTITIES (list of font-entity vectors) that | 3021 | /* Select a font from ENTITIES (list of font-entity vectors) that |
| 3022 | supports C and matches best with ATTRS and PIXEL_SIZE. */ | 3022 | supports C and is the best match for ATTRS and PIXEL_SIZE. */ |
| 3023 | 3023 | ||
| 3024 | static Lisp_Object | 3024 | static Lisp_Object |
| 3025 | font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, int pixel_size, int c) | 3025 | font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, int pixel_size, int c) |
| @@ -3062,8 +3062,8 @@ font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, | |||
| 3062 | return font_sort_entities (entities, prefer, frame, c); | 3062 | return font_sort_entities (entities, prefer, frame, c); |
| 3063 | } | 3063 | } |
| 3064 | 3064 | ||
| 3065 | /* Return a font-entity satisfying SPEC and best matching with face's | 3065 | /* Return a font-entity that satisfies SPEC and is the best match for |
| 3066 | font related attributes in ATTRS. C, if not negative, is a | 3066 | face's font related attributes in ATTRS. C, if not negative, is a |
| 3067 | character that the entity must support. */ | 3067 | character that the entity must support. */ |
| 3068 | 3068 | ||
| 3069 | Lisp_Object | 3069 | Lisp_Object |
| @@ -3254,8 +3254,8 @@ font_open_for_lface (FRAME_PTR f, Lisp_Object entity, Lisp_Object *attrs, Lisp_O | |||
| 3254 | } | 3254 | } |
| 3255 | 3255 | ||
| 3256 | 3256 | ||
| 3257 | /* Find a font satisfying SPEC and best matching with face's | 3257 | /* Find a font that satisfies SPEC and is the best match for |
| 3258 | attributes in ATTRS on FRAME, and return the opened | 3258 | face's attributes in ATTRS on FRAME, and return the opened |
| 3259 | font-object. */ | 3259 | font-object. */ |
| 3260 | 3260 | ||
| 3261 | Lisp_Object | 3261 | Lisp_Object |
| @@ -3267,8 +3267,7 @@ font_load_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec) | |||
| 3267 | if (NILP (entity)) | 3267 | if (NILP (entity)) |
| 3268 | { | 3268 | { |
| 3269 | /* No font is listed for SPEC, but each font-backend may have | 3269 | /* No font is listed for SPEC, but each font-backend may have |
| 3270 | the different criteria about "font matching". So, try | 3270 | different criteria about "font matching". So, try it. */ |
| 3271 | it. */ | ||
| 3272 | entity = font_matching_entity (f, attrs, spec); | 3271 | entity = font_matching_entity (f, attrs, spec); |
| 3273 | if (NILP (entity)) | 3272 | if (NILP (entity)) |
| 3274 | return Qnil; | 3273 | return Qnil; |
| @@ -3307,7 +3306,7 @@ font_done_for_face (FRAME_PTR f, struct face *face) | |||
| 3307 | } | 3306 | } |
| 3308 | 3307 | ||
| 3309 | 3308 | ||
| 3310 | /* Open a font matching with font-spec SPEC on frame F. If no proper | 3309 | /* Open a font that is a match for font-spec SPEC on frame F. If no proper |
| 3311 | font is found, return Qnil. */ | 3310 | font is found, return Qnil. */ |
| 3312 | 3311 | ||
| 3313 | Lisp_Object | 3312 | Lisp_Object |
| @@ -3331,7 +3330,7 @@ font_open_by_spec (FRAME_PTR f, Lisp_Object spec) | |||
| 3331 | } | 3330 | } |
| 3332 | 3331 | ||
| 3333 | 3332 | ||
| 3334 | /* Open a font matching with NAME on frame F. If no proper font is | 3333 | /* Open a font that matches NAME on frame F. If no proper font is |
| 3335 | found, return Qnil. */ | 3334 | found, return Qnil. */ |
| 3336 | 3335 | ||
| 3337 | Lisp_Object | 3336 | Lisp_Object |
| @@ -3355,7 +3354,7 @@ font_open_by_name (FRAME_PTR f, const char *name) | |||
| 3355 | /* Register font-driver DRIVER. This function is used in two ways. | 3354 | /* Register font-driver DRIVER. This function is used in two ways. |
| 3356 | 3355 | ||
| 3357 | The first is with frame F non-NULL. In this case, make DRIVER | 3356 | The first is with frame F non-NULL. In this case, make DRIVER |
| 3358 | available (but not yet activated) on F. All frame creaters | 3357 | available (but not yet activated) on F. All frame creators |
| 3359 | (e.g. Fx_create_frame) must call this function at least once with | 3358 | (e.g. Fx_create_frame) must call this function at least once with |
| 3360 | an available font-driver. | 3359 | an available font-driver. |
| 3361 | 3360 | ||
| @@ -3682,7 +3681,7 @@ font_at (int c, EMACS_INT pos, struct face *face, struct window *w, | |||
| 3682 | #ifdef HAVE_WINDOW_SYSTEM | 3681 | #ifdef HAVE_WINDOW_SYSTEM |
| 3683 | 3682 | ||
| 3684 | /* Check how many characters after POS (at most to *LIMIT) can be | 3683 | /* Check how many characters after POS (at most to *LIMIT) can be |
| 3685 | displayed by the same font on the window W. FACE, if non-NULL, is | 3684 | displayed by the same font in the window W. FACE, if non-NULL, is |
| 3686 | the face selected for the character at POS. If STRING is not nil, | 3685 | the face selected for the character at POS. If STRING is not nil, |
| 3687 | it is the string to check instead of the current buffer. In that | 3686 | it is the string to check instead of the current buffer. In that |
| 3688 | case, FACE must be not NULL. | 3687 | case, FACE must be not NULL. |
| @@ -3826,7 +3825,7 @@ GSUB and GPOS may contain `nil' element. In such a case, the font | |||
| 3826 | must not have any of the remaining elements. | 3825 | must not have any of the remaining elements. |
| 3827 | 3826 | ||
| 3828 | For instance, if the VALUE is `(thai nil nil (mark))', the font must | 3827 | For instance, if the VALUE is `(thai nil nil (mark))', the font must |
| 3829 | be an OpenType font, and whose GPOS table of `thai' script's default | 3828 | be an OpenType font whose GPOS table of `thai' script's default |
| 3830 | language system must contain `mark' feature. | 3829 | language system must contain `mark' feature. |
| 3831 | 3830 | ||
| 3832 | usage: (font-spec ARGS...) */) | 3831 | usage: (font-spec ARGS...) */) |
| @@ -4189,7 +4188,7 @@ DEFUN ("font-xlfd-name", Ffont_xlfd_name, Sfont_xlfd_name, 1, 2, 0, | |||
| 4189 | FONT is a font-spec, font-entity, or font-object. | 4188 | FONT is a font-spec, font-entity, or font-object. |
| 4190 | If the name is too long for XLFD (maximum 255 chars), return nil. | 4189 | If the name is too long for XLFD (maximum 255 chars), return nil. |
| 4191 | If the 2nd optional arg FOLD-WILDCARDS is non-nil, | 4190 | If the 2nd optional arg FOLD-WILDCARDS is non-nil, |
| 4192 | the consecutive wildcards are folded to one. */) | 4191 | the consecutive wildcards are folded into one. */) |
| 4193 | (Lisp_Object font, Lisp_Object fold_wildcards) | 4192 | (Lisp_Object font, Lisp_Object fold_wildcards) |
| 4194 | { | 4193 | { |
| 4195 | char name[256]; | 4194 | char name[256]; |
| @@ -4436,7 +4435,7 @@ the value is 0. | |||
| 4436 | If GSTRING-OUT is too short to hold produced glyphs, no glyphs are | 4435 | If GSTRING-OUT is too short to hold produced glyphs, no glyphs are |
| 4437 | produced in GSTRING-OUT, and the value is nil. | 4436 | produced in GSTRING-OUT, and the value is nil. |
| 4438 | 4437 | ||
| 4439 | See the documentation of `font-make-gstring' for the format of | 4438 | See the documentation of `composition-get-gstring' for the format of |
| 4440 | glyph-string. */) | 4439 | glyph-string. */) |
| 4441 | (Lisp_Object otf_features, Lisp_Object gstring_in, Lisp_Object from, Lisp_Object to, Lisp_Object gstring_out, Lisp_Object index) | 4440 | (Lisp_Object otf_features, Lisp_Object gstring_in, Lisp_Object from, Lisp_Object to, Lisp_Object gstring_out, Lisp_Object index) |
| 4442 | { | 4441 | { |
| @@ -4571,10 +4570,10 @@ The value is a vector: | |||
| 4571 | [ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH | 4570 | [ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH |
| 4572 | CAPABILITY ] | 4571 | CAPABILITY ] |
| 4573 | 4572 | ||
| 4574 | NAME is a string of the font name (or nil if the font backend doesn't | 4573 | NAME is the font name, a string (or nil if the font backend doesn't |
| 4575 | provide a name). | 4574 | provide a name). |
| 4576 | 4575 | ||
| 4577 | FILENAME is a string of the font file (or nil if the font backend | 4576 | FILENAME is the font file name, a string (or nil if the font backend |
| 4578 | doesn't provide a file name). | 4577 | doesn't provide a file name). |
| 4579 | 4578 | ||
| 4580 | PIXEL-SIZE is a pixel size by which the font is opened. | 4579 | PIXEL-SIZE is a pixel size by which the font is opened. |
diff --git a/src/font.h b/src/font.h index 4b3ceed1dd3..0ca9e8baec4 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -36,22 +36,22 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 36 | 36 | ||
| 37 | FONT-ENTITY | 37 | FONT-ENTITY |
| 38 | 38 | ||
| 39 | Pseudo vector (length FONT_ENTITY_MAX) of fully instanciated | 39 | Pseudo vector (length FONT_ENTITY_MAX) of fully instantiated |
| 40 | font properties that a font-driver returns upon a request of | 40 | font properties that a font-driver returns upon a request of |
| 41 | FONT-SPEC. | 41 | FONT-SPEC. |
| 42 | 42 | ||
| 43 | Note: Only the method `list' and `match' of a font-driver can | 43 | Note: Only the method `list' and `match' of a font-driver can |
| 44 | create this object, and should never be modified by Lisp. | 44 | create this object, and it should never be modified by Lisp. |
| 45 | 45 | ||
| 46 | FONT-OBJECT | 46 | FONT-OBJECT |
| 47 | 47 | ||
| 48 | Pseudo vector (length FONT_OBJECT_MAX) of a opend font. | 48 | Pseudo vector (length FONT_OBJECT_MAX) of an opened font. |
| 49 | 49 | ||
| 50 | Lisp object encapsulating "struct font". This corresponds to | 50 | Lisp object encapsulating "struct font". This corresponds to |
| 51 | an opened font. | 51 | an opened font. |
| 52 | 52 | ||
| 53 | Note: Only the method `open' of a font-driver can create this | 53 | Note: Only the method `open' of a font-driver can create this |
| 54 | object, and should never be modified by Lisp. */ | 54 | object, and it should never be modified by Lisp. */ |
| 55 | 55 | ||
| 56 | extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; | 56 | extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; |
| 57 | 57 | ||
| @@ -68,7 +68,7 @@ struct glyph_string; | |||
| 68 | enum font_property_index | 68 | enum font_property_index |
| 69 | { | 69 | { |
| 70 | /* FONT-TYPE is a symbol indicating a font backend; currently `x', | 70 | /* FONT-TYPE is a symbol indicating a font backend; currently `x', |
| 71 | `xft', `ftx' are available on X, `uniscribe' and `gdi' on | 71 | `xft', and `ftx' are available on X, `uniscribe' and `gdi' on |
| 72 | Windows, and `ns' under Cocoa / GNUstep. */ | 72 | Windows, and `ns' under Cocoa / GNUstep. */ |
| 73 | FONT_TYPE_INDEX, | 73 | FONT_TYPE_INDEX, |
| 74 | 74 | ||
| @@ -86,26 +86,26 @@ enum font_property_index | |||
| 86 | FONT_REGISTRY_INDEX, | 86 | FONT_REGISTRY_INDEX, |
| 87 | 87 | ||
| 88 | /* FONT-WEIGHT is a numeric value of weight (e.g. medium, bold) of | 88 | /* FONT-WEIGHT is a numeric value of weight (e.g. medium, bold) of |
| 89 | the font. The lowest 8-bit is an index determining the | 89 | the font. The lowest 8 bits is an index determining the |
| 90 | symbolic name, and the higher bits is the actual numeric value | 90 | symbolic name, and the higher bits is the actual numeric value |
| 91 | defined in `font-weight-table'. */ | 91 | defined in `font-weight-table'. */ |
| 92 | FONT_WEIGHT_INDEX, | 92 | FONT_WEIGHT_INDEX, |
| 93 | 93 | ||
| 94 | /* FONT-SLANT is a numeric value of slant (e.g. r, i, o) of the | 94 | /* FONT-SLANT is a numeric value of slant (e.g. r, i, o) of the |
| 95 | font. The lowest 8-bit is an index determining the symbolic | 95 | font. The lowest 8 bits is an index determining the symbolic |
| 96 | name, and the higher bits is the actual numeric value defined | 96 | name, and the higher bits is the actual numeric value defined |
| 97 | in `font-slant-table'. */ | 97 | in `font-slant-table'. */ |
| 98 | FONT_SLANT_INDEX, | 98 | FONT_SLANT_INDEX, |
| 99 | 99 | ||
| 100 | /* FONT-WIDTH is a numeric value of setwidth (e.g. normal) of the | 100 | /* FONT-WIDTH is a numeric value of setwidth (e.g. normal) of the |
| 101 | font. The lowest 8-bit is an index determining the symbolic | 101 | font. The lowest 8 bits is an index determining the symbolic |
| 102 | name, and the higher bits is the actual numeric value defined | 102 | name, and the higher bits is the actual numeric value defined |
| 103 | `font-width-table'. */ | 103 | `font-width-table'. */ |
| 104 | FONT_WIDTH_INDEX, | 104 | FONT_WIDTH_INDEX, |
| 105 | 105 | ||
| 106 | /* FONT-SIZE is a size of the font. If integer, it is a pixel | 106 | /* FONT-SIZE is a size of the font. If integer, it is a pixel |
| 107 | size. For a font-spec, the value can be float specifying a | 107 | size. For a font-spec, the value can be a float specifying |
| 108 | point size. The value zero means that the font is | 108 | the point size. The value zero means that the font is |
| 109 | scalable. */ | 109 | scalable. */ |
| 110 | FONT_SIZE_INDEX, | 110 | FONT_SIZE_INDEX, |
| 111 | 111 | ||
| @@ -129,18 +129,18 @@ enum font_property_index | |||
| 129 | 129 | ||
| 130 | /* FONT-STYLE is a 24-bit integer containing indices for | 130 | /* FONT-STYLE is a 24-bit integer containing indices for |
| 131 | style-related properties WEIGHT, SLANT, and WIDTH. The lowest | 131 | style-related properties WEIGHT, SLANT, and WIDTH. The lowest |
| 132 | 8-bit is an indice to the weight table AREF (font_style_table, | 132 | 8 bits is an index to the weight table AREF (font_style_table, |
| 133 | 0), the next 8-bit is an indice to the slant table AREF | 133 | 0), the next 8 bits is an index to the slant table AREF |
| 134 | (font_style_table, 1), the highest 8-bit is an indice to the | 134 | (font_style_table, 1), the highest 8 bits is an index to the |
| 135 | slant table AREF (font_style_table, 2). The indice 0 indicates | 135 | slant table AREF (font_style_table, 2). The index 0 indicates |
| 136 | that the corresponding style is not specified. This way, we | 136 | that the corresponding style is not specified. This way, we |
| 137 | can represent at most 255 different names for each style, which | 137 | can represent at most 255 different names for each style, which |
| 138 | is surely sufficient. */ | 138 | is surely sufficient. */ |
| 139 | FONT_STYLE_INDEX, | 139 | FONT_STYLE_INDEX, |
| 140 | 140 | ||
| 141 | /* FONT-METRICS is a 27-bit integer containing metrics-related | 141 | /* FONT-METRICS is a 27-bit integer containing metrics-related |
| 142 | properties DPI, AVGWIDTH, SPACING. The lowest 12-bit is for | 142 | properties DPI, AVGWIDTH, SPACING. The lowest 12 bits is for |
| 143 | DPI, the next 12-bit is for AVGWIDTH, the highest 3-bit is for | 143 | DPI, the next 12 bits is for AVGWIDTH, the highest 3 bits is for |
| 144 | SPACING. In each bit field, the highest bit indicates that the | 144 | SPACING. In each bit field, the highest bit indicates that the |
| 145 | corresponding value is set or not. This way, we can represent | 145 | corresponding value is set or not. This way, we can represent |
| 146 | DPI by 11-bit (0 to 2047), AVGWIDTH by 11-bit (0 to 2047), | 146 | DPI by 11-bit (0 to 2047), AVGWIDTH by 11-bit (0 to 2047), |
| @@ -176,7 +176,7 @@ enum font_property_index | |||
| 176 | FONT_NAME_INDEX = FONT_ENTITY_MAX, | 176 | FONT_NAME_INDEX = FONT_ENTITY_MAX, |
| 177 | 177 | ||
| 178 | /* Full name of the font (string). It is the name extracted from | 178 | /* Full name of the font (string). It is the name extracted from |
| 179 | the opend font, and may be different from the above. It may be | 179 | the opened font, and may be different from the above. It may be |
| 180 | nil if the opened font doesn't give a name. */ | 180 | nil if the opened font doesn't give a name. */ |
| 181 | FONT_FULLNAME_INDEX, | 181 | FONT_FULLNAME_INDEX, |
| 182 | 182 | ||
| @@ -300,7 +300,7 @@ struct font | |||
| 300 | int space_width; | 300 | int space_width; |
| 301 | 301 | ||
| 302 | /* Average width of glyphs in the font. If the font itself doesn't | 302 | /* Average width of glyphs in the font. If the font itself doesn't |
| 303 | have that information but has glyphs of ASCII character, the | 303 | have that information but has glyphs of ASCII characters, the |
| 304 | value is the average with of those glyphs. Otherwise, the value | 304 | value is the average with of those glyphs. Otherwise, the value |
| 305 | is 0. */ | 305 | is 0. */ |
| 306 | int average_width; | 306 | int average_width; |
| @@ -321,7 +321,7 @@ struct font | |||
| 321 | int underline_position; | 321 | int underline_position; |
| 322 | 322 | ||
| 323 | /* 1 if `vertical-centering-font-regexp' matches this font name. | 323 | /* 1 if `vertical-centering-font-regexp' matches this font name. |
| 324 | In this case, we render characters at vartical center positions | 324 | In this case, we render characters at vertical center positions |
| 325 | of lines. */ | 325 | of lines. */ |
| 326 | int vertical_centering; | 326 | int vertical_centering; |
| 327 | 327 | ||
| @@ -335,27 +335,27 @@ struct font | |||
| 335 | unsigned char encoding_type; | 335 | unsigned char encoding_type; |
| 336 | 336 | ||
| 337 | /* The baseline position of a font is normally `ascent' value of the | 337 | /* The baseline position of a font is normally `ascent' value of the |
| 338 | font. However, there exists many fonts which don't set `ascent' | 338 | font. However, there exist many fonts which don't set `ascent' to |
| 339 | an appropriate value to be used as baseline position. This is | 339 | an appropriate value to be used as baseline position. This is |
| 340 | typical in such ASCII fonts which are designed to be used with | 340 | typical in such ASCII fonts which are designed to be used with |
| 341 | Chinese, Japanese, Korean characters. When we use mixture of | 341 | Chinese, Japanese, Korean characters. When we use mixture of |
| 342 | such fonts and normal fonts (having correct `ascent' value), a | 342 | such fonts and normal fonts (having correct `ascent' value), a |
| 343 | display line gets very ugly. Since we have no way to fix it | 343 | display line gets very ugly. Since we have no way to fix it |
| 344 | automatically, it is users responsibility to supply well designed | 344 | automatically, it is user's responsibility to supply well designed |
| 345 | fonts or correct `ascent' value of fonts. But, the latter | 345 | fonts or correct `ascent' value of fonts. But, the latter |
| 346 | requires heavy work (modifying all bitmap data in BDF files). | 346 | requires heavy work (modifying all bitmap data in BDF files). |
| 347 | So, Emacs accepts a private font property | 347 | So, Emacs accepts a private font property |
| 348 | `_MULE_BASELINE_OFFSET'. If a font has this property, we | 348 | `_MULE_BASELINE_OFFSET'. If a font has this property, we |
| 349 | calculate the baseline position by subtracting the value from | 349 | calculate the baseline position by subtracting the value from |
| 350 | `ascent'. In other words, the value indicates how many bits | 350 | `ascent'. In other words, the value indicates how many pixels |
| 351 | higher we should draw a character of the font than normal ASCII | 351 | higher than normal ASCII text we should draw a character of the |
| 352 | text for a better looking. | 352 | font for better appearance. |
| 353 | 353 | ||
| 354 | We also have to consider the fact that the concept of `baseline' | 354 | We also have to consider the fact that the concept of `baseline' |
| 355 | differs among scripts to which each character belongs. For | 355 | differs among scripts to which each character belongs. For |
| 356 | instance, baseline should be at the bottom most position of all | 356 | instance, baseline should be at the bottom-most position of all |
| 357 | glyphs for Chinese, Japanese, and Korean. But, many of existing | 357 | glyphs for Chinese, Japanese, and Korean. But, many of existing |
| 358 | fonts for those characters doesn't have correct `ascent' values | 358 | fonts for those characters don't have correct `ascent' values |
| 359 | because they are designed to be used with ASCII fonts. To | 359 | because they are designed to be used with ASCII fonts. To |
| 360 | display characters of different language on the same line, the | 360 | display characters of different language on the same line, the |
| 361 | best way will be to arrange them in the middle of the line. So, | 361 | best way will be to arrange them in the middle of the line. So, |
| @@ -365,20 +365,20 @@ struct font | |||
| 365 | of a line. */ | 365 | of a line. */ |
| 366 | int baseline_offset; | 366 | int baseline_offset; |
| 367 | 367 | ||
| 368 | /* Non zero means a character should be composed at a position | 368 | /* Non-zero means a character should be composed at a position |
| 369 | relative to the height (or depth) of previous glyphs in the | 369 | relative to the height (or depth) of previous glyphs in the |
| 370 | following cases: | 370 | following cases: |
| 371 | (1) The bottom of the character is higher than this value. In | 371 | (1) The bottom of the character is higher than this value. In |
| 372 | this case, the character is drawn above the previous glyphs. | 372 | this case, the character is drawn above the previous glyphs. |
| 373 | (2) The top of the character is lower than 0 (i.e. baseline | 373 | (2) The top of the character is lower than 0 (i.e. baseline |
| 374 | height). In this case, the character is drawn beneath the | 374 | height). In this case, the character is drawn below the |
| 375 | previous glyphs. | 375 | previous glyphs. |
| 376 | 376 | ||
| 377 | This value is taken from a private font property | 377 | This value is taken from a private font property |
| 378 | `_MULE_RELATIVE_COMPOSE' which is introduced by Emacs. */ | 378 | `_MULE_RELATIVE_COMPOSE' which is introduced by Emacs. */ |
| 379 | int relative_compose; | 379 | int relative_compose; |
| 380 | 380 | ||
| 381 | /* Non zero means an ascent value to be used for a character | 381 | /* Non-zero means an ascent value to be used for a character |
| 382 | registered in char-table `use-default-ascent'. */ | 382 | registered in char-table `use-default-ascent'. */ |
| 383 | int default_ascent; | 383 | int default_ascent; |
| 384 | 384 | ||
| @@ -398,8 +398,8 @@ struct font | |||
| 398 | determine it. */ | 398 | determine it. */ |
| 399 | int repertory_charset; | 399 | int repertory_charset; |
| 400 | 400 | ||
| 401 | /* There will be more to this structure, but they are private to a | 401 | /* There are more members in this structure, but they are private |
| 402 | font-driver. */ | 402 | to the font-driver. */ |
| 403 | }; | 403 | }; |
| 404 | 404 | ||
| 405 | enum font_spacing | 405 | enum font_spacing |
| @@ -484,8 +484,8 @@ struct font_bitmap | |||
| 484 | #define POINT_TO_PIXEL(POINT, DPI) ((POINT) * (DPI) / PT_PER_INCH + 0.5) | 484 | #define POINT_TO_PIXEL(POINT, DPI) ((POINT) * (DPI) / PT_PER_INCH + 0.5) |
| 485 | 485 | ||
| 486 | /* Return a point size corresponding to POINT size (integer) | 486 | /* Return a point size corresponding to POINT size (integer) |
| 487 | on resolution DPI. Note that though point size is a double, we expect | 487 | on resolution DPI. Note that though point size is a double, we expect |
| 488 | it to be rounded to an int, so we add 0.5 here. If the desired value | 488 | it to be rounded to an int, so we add 0.5 here. If the desired value |
| 489 | is tenths of points (as in xfld specs), then the pixel size should | 489 | is tenths of points (as in xfld specs), then the pixel size should |
| 490 | be multiplied BEFORE the conversion to avoid magnifying the error. */ | 490 | be multiplied BEFORE the conversion to avoid magnifying the error. */ |
| 491 | #define PIXEL_TO_POINT(PIXEL, DPI) ((PIXEL) * PT_PER_INCH / (DPI) + 0.5) | 491 | #define PIXEL_TO_POINT(PIXEL, DPI) ((PIXEL) * PT_PER_INCH / (DPI) + 0.5) |
| @@ -582,7 +582,7 @@ struct font_driver | |||
| 582 | If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ | 582 | If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ |
| 583 | unsigned (*encode_char) (struct font *font, int c); | 583 | unsigned (*encode_char) (struct font *font, int c); |
| 584 | 584 | ||
| 585 | /* Computate the total metrics of the NGLYPHS glyphs specified by | 585 | /* Compute the total metrics of the NGLYPHS glyphs specified by |
| 586 | the font FONT and the sequence of glyph codes CODE, and store the | 586 | the font FONT and the sequence of glyph codes CODE, and store the |
| 587 | result in METRICS. */ | 587 | result in METRICS. */ |
| 588 | int (*text_extents) (struct font *font, | 588 | int (*text_extents) (struct font *font, |
| @@ -635,7 +635,7 @@ struct font_driver | |||
| 635 | 635 | ||
| 636 | FEATURES specifies which OTF features to apply in this format: | 636 | FEATURES specifies which OTF features to apply in this format: |
| 637 | (SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE) | 637 | (SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE) |
| 638 | See the documentation of `font-drive-otf' for the detail. | 638 | See the documentation of `font-drive-otf' for the details. |
| 639 | 639 | ||
| 640 | This method applies the specified features to the codes in the | 640 | This method applies the specified features to the codes in the |
| 641 | elements of GSTRING-IN (between FROMth and TOth). The output | 641 | elements of GSTRING-IN (between FROMth and TOth). The output |
| @@ -710,7 +710,7 @@ struct font_driver | |||
| 710 | 710 | ||
| 711 | struct font_driver_list | 711 | struct font_driver_list |
| 712 | { | 712 | { |
| 713 | /* 1 iff this driver is currently used. It is igonred in the global | 713 | /* 1 iff this driver is currently used. It is ignored in the global |
| 714 | font driver list.*/ | 714 | font driver list.*/ |
| 715 | int on; | 715 | int on; |
| 716 | /* Pointer to the font driver. */ | 716 | /* Pointer to the font driver. */ |