diff options
| author | Juanma Barranquero | 2008-02-26 16:25:25 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-02-26 16:25:25 +0000 |
| commit | 51c011004407a52a130814d5f09fafb385a27f30 (patch) | |
| tree | a3d55334890627fb3e37af29c1d001f0816a5aba /src | |
| parent | df1a5d7dde0e3c702f7aba463c2685ab68ed0840 (diff) | |
| download | emacs-51c011004407a52a130814d5f09fafb385a27f30.tar.gz emacs-51c011004407a52a130814d5f09fafb385a27f30.zip | |
(Ffont_spec, Ffont_at): Fix typos in docstrings.
(Ffont_put, Flist_families, Ffont_fill_gstring, Ffont_drive_otf,
Ffont_otf_alternates, Fquery_font): Doc fixes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/font.c | 62 |
2 files changed, 37 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9506205227b..11e98b31579 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-02-26 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * font.c (Ffont_spec, Ffont_at): Fix typos in docstrings. | ||
| 4 | (Ffont_put, Flist_families, Ffont_fill_gstring, Ffont_drive_otf) | ||
| 5 | (Ffont_otf_alternates, Fquery_font): Doc fixes. | ||
| 6 | |||
| 1 | 2008-02-25 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2008-02-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * buffer.c (Fbuffer_swap_text): New function. | 9 | * buffer.c (Fbuffer_swap_text): New function. |
diff --git a/src/font.c b/src/font.c index 57609a8dab4..754b47ecbe0 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -168,7 +168,7 @@ font_pixel_size (f, spec) | |||
| 168 | double point_size; | 168 | double point_size; |
| 169 | int pixel_size, dpi; | 169 | int pixel_size, dpi; |
| 170 | Lisp_Object extra, val; | 170 | Lisp_Object extra, val; |
| 171 | 171 | ||
| 172 | if (INTEGERP (size)) | 172 | if (INTEGERP (size)) |
| 173 | return XINT (size); | 173 | return XINT (size); |
| 174 | if (NILP (size)) | 174 | if (NILP (size)) |
| @@ -327,7 +327,7 @@ font_registry_charsets (registry, encoding, repertory) | |||
| 327 | goto invalid_entry; | 327 | goto invalid_entry; |
| 328 | repertory_id = XINT (CHARSET_SYMBOL_ID (XCDR (val))); | 328 | repertory_id = XINT (CHARSET_SYMBOL_ID (XCDR (val))); |
| 329 | } | 329 | } |
| 330 | } | 330 | } |
| 331 | else | 331 | else |
| 332 | goto invalid_entry; | 332 | goto invalid_entry; |
| 333 | val = Fcons (make_number (encoding_id), make_number (repertory_id)); | 333 | val = Fcons (make_number (encoding_id), make_number (repertory_id)); |
| @@ -550,7 +550,7 @@ font_prop_validate (spec) | |||
| 550 | } | 550 | } |
| 551 | return spec; | 551 | return spec; |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | /* Store VAL as a value of extra font property PROP in FONT. */ | 554 | /* Store VAL as a value of extra font property PROP in FONT. */ |
| 555 | 555 | ||
| 556 | Lisp_Object | 556 | Lisp_Object |
| @@ -752,7 +752,7 @@ font_expand_wildcards (field, n) | |||
| 752 | else if (numeric <= 48) | 752 | else if (numeric <= 48) |
| 753 | from = to = XLFD_PIXEL_INDEX, | 753 | from = to = XLFD_PIXEL_INDEX, |
| 754 | mask = XLFD_PIXEL_MASK; | 754 | mask = XLFD_PIXEL_MASK; |
| 755 | else | 755 | else |
| 756 | from = XLFD_POINT_INDEX, to = XLFD_AVGWIDTH_INDEX, | 756 | from = XLFD_POINT_INDEX, to = XLFD_AVGWIDTH_INDEX, |
| 757 | mask = XLFD_LARGENUM_MASK; | 757 | mask = XLFD_LARGENUM_MASK; |
| 758 | } | 758 | } |
| @@ -982,7 +982,7 @@ font_parse_xlfd (name, font) | |||
| 982 | 982 | ||
| 983 | p = f[XLFD_PIXEL_INDEX]; | 983 | p = f[XLFD_PIXEL_INDEX]; |
| 984 | if (*p == '[' && (pixel_size = parse_matrix (p)) >= 0) | 984 | if (*p == '[' && (pixel_size = parse_matrix (p)) >= 0) |
| 985 | ASET (font, FONT_SIZE_INDEX, make_number (pixel_size)); | 985 | ASET (font, FONT_SIZE_INDEX, make_number (pixel_size)); |
| 986 | else | 986 | else |
| 987 | { | 987 | { |
| 988 | i = XLFD_PIXEL_INDEX; | 988 | i = XLFD_PIXEL_INDEX; |
| @@ -1332,7 +1332,7 @@ font_parse_fcname (name, font) | |||
| 1332 | if (! copy) | 1332 | if (! copy) |
| 1333 | return -1; | 1333 | return -1; |
| 1334 | name = copy; | 1334 | name = copy; |
| 1335 | 1335 | ||
| 1336 | /* Now parse ":KEY=VAL" patterns. Store known keys and values in | 1336 | /* Now parse ":KEY=VAL" patterns. Store known keys and values in |
| 1337 | extra, copy unknown ones to COPY. */ | 1337 | extra, copy unknown ones to COPY. */ |
| 1338 | while (*p0) | 1338 | while (*p0) |
| @@ -1731,7 +1731,7 @@ otf_open (entity, file) | |||
| 1731 | 1731 | ||
| 1732 | /* Return a list describing which scripts/languages FONT supports by | 1732 | /* Return a list describing which scripts/languages FONT supports by |
| 1733 | which GSUB/GPOS features of OpenType tables. See the comment of | 1733 | which GSUB/GPOS features of OpenType tables. See the comment of |
| 1734 | (sturct font_driver).otf_capability. */ | 1734 | (struct font_driver).otf_capability. */ |
| 1735 | 1735 | ||
| 1736 | Lisp_Object | 1736 | Lisp_Object |
| 1737 | font_otf_capability (font) | 1737 | font_otf_capability (font) |
| @@ -2295,7 +2295,7 @@ font_clear_cache (f, cache, driver) | |||
| 2295 | struct font_driver *driver; | 2295 | struct font_driver *driver; |
| 2296 | { | 2296 | { |
| 2297 | Lisp_Object tail, elt; | 2297 | Lisp_Object tail, elt; |
| 2298 | 2298 | ||
| 2299 | /* CACHE = (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...) */ | 2299 | /* CACHE = (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...) */ |
| 2300 | for (tail = XCDR (XCDR (cache)); CONSP (tail); tail = XCDR (tail)) | 2300 | for (tail = XCDR (XCDR (cache)); CONSP (tail); tail = XCDR (tail)) |
| 2301 | { | 2301 | { |
| @@ -2371,7 +2371,7 @@ font_list_entities (frame, spec) | |||
| 2371 | 2371 | ||
| 2372 | xassert (ASIZE (spec) == FONT_SPEC_MAX); | 2372 | xassert (ASIZE (spec) == FONT_SPEC_MAX); |
| 2373 | ftype = AREF (spec, FONT_TYPE_INDEX); | 2373 | ftype = AREF (spec, FONT_TYPE_INDEX); |
| 2374 | 2374 | ||
| 2375 | for (i = 0; driver_list; driver_list = driver_list->next) | 2375 | for (i = 0; driver_list; driver_list = driver_list->next) |
| 2376 | if (driver_list->on | 2376 | if (driver_list->on |
| 2377 | && (NILP (ftype) || EQ (driver_list->driver->type, ftype))) | 2377 | && (NILP (ftype) || EQ (driver_list->driver->type, ftype))) |
| @@ -3179,7 +3179,7 @@ valid font property name listed below: | |||
| 3179 | `:family', `:weight', `:slant', `:width' | 3179 | `:family', `:weight', `:slant', `:width' |
| 3180 | 3180 | ||
| 3181 | They are the same as face attributes of the same name. See | 3181 | They are the same as face attributes of the same name. See |
| 3182 | `set-face-attribute. | 3182 | `set-face-attribute'. |
| 3183 | 3183 | ||
| 3184 | `:foundry' | 3184 | `:foundry' |
| 3185 | 3185 | ||
| @@ -3264,7 +3264,7 @@ FONT is a font-spec, a font-entity, or a font-object. */) | |||
| 3264 | 3264 | ||
| 3265 | 3265 | ||
| 3266 | DEFUN ("font-put", Ffont_put, Sfont_put, 3, 3, 0, | 3266 | DEFUN ("font-put", Ffont_put, Sfont_put, 3, 3, 0, |
| 3267 | doc: /* Set one property of FONT-SPEC: give property KEY value VALUE. */) | 3267 | doc: /* Set one property of FONT-SPEC: give property PROP value VAL. */) |
| 3268 | (font_spec, prop, val) | 3268 | (font_spec, prop, val) |
| 3269 | Lisp_Object font_spec, prop, val; | 3269 | Lisp_Object font_spec, prop, val; |
| 3270 | { | 3270 | { |
| @@ -3336,7 +3336,7 @@ how they are close to PREFER. */) | |||
| 3336 | 3336 | ||
| 3337 | DEFUN ("list-families", Flist_families, Slist_families, 0, 1, 0, | 3337 | DEFUN ("list-families", Flist_families, Slist_families, 0, 1, 0, |
| 3338 | doc: /* List available font families on the current frame. | 3338 | doc: /* List available font families on the current frame. |
| 3339 | Optional 2nd argument FRAME specifies the target frame. */) | 3339 | Optional argument FRAME specifies the target frame. */) |
| 3340 | (frame) | 3340 | (frame) |
| 3341 | Lisp_Object frame; | 3341 | Lisp_Object frame; |
| 3342 | { | 3342 | { |
| @@ -3426,7 +3426,7 @@ DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0, | |||
| 3426 | { | 3426 | { |
| 3427 | Lisp_Object cache = driver_list->driver->get_cache (f); | 3427 | Lisp_Object cache = driver_list->driver->get_cache (f); |
| 3428 | Lisp_Object val; | 3428 | Lisp_Object val; |
| 3429 | 3429 | ||
| 3430 | val = XCDR (cache); | 3430 | val = XCDR (cache); |
| 3431 | while (! NILP (val) | 3431 | while (! NILP (val) |
| 3432 | && ! EQ (XCAR (XCAR (val)), driver_list->driver->type)) | 3432 | && ! EQ (XCAR (XCAR (val)), driver_list->driver->type)) |
| @@ -3456,7 +3456,7 @@ sorted by numeric values. */) | |||
| 3456 | int table_index; | 3456 | int table_index; |
| 3457 | int numeric; | 3457 | int numeric; |
| 3458 | Lisp_Object tail, val; | 3458 | Lisp_Object tail, val; |
| 3459 | 3459 | ||
| 3460 | CHECK_SYMBOL (prop); | 3460 | CHECK_SYMBOL (prop); |
| 3461 | table_index = (EQ (prop, QCweight) ? 0 | 3461 | table_index = (EQ (prop, QCweight) ? 0 |
| 3462 | : EQ (prop, QCslant) ? 1 | 3462 | : EQ (prop, QCslant) ? 1 |
| @@ -3482,7 +3482,7 @@ sorted by numeric values. */) | |||
| 3482 | ASET (font_style_table, table_index, table); | 3482 | ASET (font_style_table, table_index, table); |
| 3483 | return Qnil; | 3483 | return Qnil; |
| 3484 | } | 3484 | } |
| 3485 | 3485 | ||
| 3486 | /* The following three functions are still expremental. */ | 3486 | /* The following three functions are still expremental. */ |
| 3487 | 3487 | ||
| 3488 | DEFUN ("font-make-gstring", Ffont_make_gstring, Sfont_make_gstring, 2, 2, 0, | 3488 | DEFUN ("font-make-gstring", Ffont_make_gstring, Sfont_make_gstring, 2, 2, 0, |
| @@ -3529,9 +3529,9 @@ where | |||
| 3529 | } | 3529 | } |
| 3530 | 3530 | ||
| 3531 | DEFUN ("font-fill-gstring", Ffont_fill_gstring, Sfont_fill_gstring, 4, 5, 0, | 3531 | DEFUN ("font-fill-gstring", Ffont_fill_gstring, Sfont_fill_gstring, 4, 5, 0, |
| 3532 | doc: /* Fillin glyph-string GSTRING by characters for FONT-OBJECT. | 3532 | doc: /* Fill in glyph-string GSTRING by characters for FONT-OBJECT. |
| 3533 | START and END specifies the region to extract characters. | 3533 | START and END specify the region to extract characters. |
| 3534 | If optional 3rd argument OBJECT is non-nil, it is a buffer or a string from | 3534 | If optional 5rd argument OBJECT is non-nil, it is a buffer or a string from |
| 3535 | where to extract characters. | 3535 | where to extract characters. |
| 3536 | FONT-OBJECT may be nil if GSTRING already already contains one. */) | 3536 | FONT-OBJECT may be nil if GSTRING already already contains one. */) |
| 3537 | (gstring, font_object, start, end, object) | 3537 | (gstring, font_object, start, end, object) |
| @@ -3606,7 +3606,7 @@ FONT-OBJECT may be nil if GSTRING already already contains one. */) | |||
| 3606 | } | 3606 | } |
| 3607 | } | 3607 | } |
| 3608 | for (; i < LGSTRING_LENGTH (gstring); i++) | 3608 | for (; i < LGSTRING_LENGTH (gstring); i++) |
| 3609 | LGSTRING_SET_GLYPH (gstring, i, Qnil); | 3609 | LGSTRING_SET_GLYPH (gstring, i, Qnil); |
| 3610 | return Qnil; | 3610 | return Qnil; |
| 3611 | } | 3611 | } |
| 3612 | 3612 | ||
| @@ -3650,7 +3650,7 @@ FONT-OBJECT. */) | |||
| 3650 | len = end - start; | 3650 | len = end - start; |
| 3651 | gstring = Ffont_make_gstring (font_object, make_number (len)); | 3651 | gstring = Ffont_make_gstring (font_object, make_number (len)); |
| 3652 | Ffont_fill_gstring (gstring, font_object, from, to, string); | 3652 | Ffont_fill_gstring (gstring, font_object, from, to, string); |
| 3653 | 3653 | ||
| 3654 | /* Try at most three times with larger gstring each time. */ | 3654 | /* Try at most three times with larger gstring each time. */ |
| 3655 | for (i = 0; i < 3; i++) | 3655 | for (i = 0; i < 3; i++) |
| 3656 | { | 3656 | { |
| @@ -3753,7 +3753,7 @@ FONT-OBJECT. */) | |||
| 3753 | 3753 | ||
| 3754 | DEFUN ("font-drive-otf", Ffont_drive_otf, Sfont_drive_otf, 6, 6, 0, | 3754 | DEFUN ("font-drive-otf", Ffont_drive_otf, Sfont_drive_otf, 6, 6, 0, |
| 3755 | doc: /* Apply OpenType features on glyph-string GSTRING-IN. | 3755 | doc: /* Apply OpenType features on glyph-string GSTRING-IN. |
| 3756 | OTF-SPEC specifies which featuress to apply in this format: | 3756 | OTF-FEATURES specifies which features to apply in this format: |
| 3757 | (SCRIPT LANGSYS GSUB GPOS) | 3757 | (SCRIPT LANGSYS GSUB GPOS) |
| 3758 | where | 3758 | where |
| 3759 | SCRIPT is a symbol specifying a script tag of OpenType, | 3759 | SCRIPT is a symbol specifying a script tag of OpenType, |
| @@ -3762,8 +3762,8 @@ where | |||
| 3762 | 3762 | ||
| 3763 | If LANGYS is nil, the default langsys is selected. | 3763 | If LANGYS is nil, the default langsys is selected. |
| 3764 | 3764 | ||
| 3765 | The features are applied in the order appeared in the list. The | 3765 | The features are applied in the order they appear in the list. The |
| 3766 | symbol `*' means to apply all available features not appeared in this | 3766 | symbol `*' means to apply all available features not present in this |
| 3767 | list, and the remaining features are ignored. For instance, (vatu | 3767 | list, and the remaining features are ignored. For instance, (vatu |
| 3768 | pstf * haln) is to apply vatu and pstf in this order, then to apply | 3768 | pstf * haln) is to apply vatu and pstf in this order, then to apply |
| 3769 | all available features other than vatu, pstf, and haln. | 3769 | all available features other than vatu, pstf, and haln. |
| @@ -3771,14 +3771,14 @@ all available features other than vatu, pstf, and haln. | |||
| 3771 | The features are applied to the glyphs in the range FROM and TO of | 3771 | The features are applied to the glyphs in the range FROM and TO of |
| 3772 | the glyph-string GSTRING-IN. | 3772 | the glyph-string GSTRING-IN. |
| 3773 | 3773 | ||
| 3774 | If some of a feature is actually applicable, the resulting glyphs are | 3774 | If some feature is actually applicable, the resulting glyphs are |
| 3775 | produced in the glyph-string GSTRING-OUT from the index INDEX. In | 3775 | produced in the glyph-string GSTRING-OUT from the index INDEX. In |
| 3776 | this case, the value is the number of produced glyphs. | 3776 | this case, the value is the number of produced glyphs. |
| 3777 | 3777 | ||
| 3778 | If no feature is applicable, no glyph is produced in GSTRING-OUT, and | 3778 | If no feature is applicable, no glyph is produced in GSTRING-OUT, and |
| 3779 | the value is 0. | 3779 | the value is 0. |
| 3780 | 3780 | ||
| 3781 | If GSTRING-OUT is too short to hold produced glyphs, no glyphs is | 3781 | If GSTRING-OUT is too short to hold produced glyphs, no glyphs are |
| 3782 | produced in GSTRING-OUT, and the value is nil. | 3782 | produced in GSTRING-OUT, and the value is nil. |
| 3783 | 3783 | ||
| 3784 | See the documentation of `font-make-gstring' for the format of | 3784 | See the documentation of `font-make-gstring' for the format of |
| @@ -3824,7 +3824,7 @@ glyph-string. */) | |||
| 3824 | DEFUN ("font-otf-alternates", Ffont_otf_alternates, Sfont_otf_alternates, | 3824 | DEFUN ("font-otf-alternates", Ffont_otf_alternates, Sfont_otf_alternates, |
| 3825 | 3, 3, 0, | 3825 | 3, 3, 0, |
| 3826 | doc: /* Return a list of alternate glyphs of CHARACTER in FONT-OBJECT. | 3826 | doc: /* Return a list of alternate glyphs of CHARACTER in FONT-OBJECT. |
| 3827 | FEATURE-SPEC specifies which features of the font FONT-OBJECT to apply | 3827 | OTF-FEATURES specifies which features of the font FONT-OBJECT to apply |
| 3828 | in this format: | 3828 | in this format: |
| 3829 | (SCRIPT LANGSYS FEATURE ...) | 3829 | (SCRIPT LANGSYS FEATURE ...) |
| 3830 | See the documentation of `font-otf-gsub' for more detail. | 3830 | See the documentation of `font-otf-gsub' for more detail. |
| @@ -3889,7 +3889,7 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0, | |||
| 3889 | if (NILP (frame)) | 3889 | if (NILP (frame)) |
| 3890 | frame = selected_frame; | 3890 | frame = selected_frame; |
| 3891 | CHECK_LIVE_FRAME (frame); | 3891 | CHECK_LIVE_FRAME (frame); |
| 3892 | 3892 | ||
| 3893 | isize = XINT (size); | 3893 | isize = XINT (size); |
| 3894 | if (isize == 0) | 3894 | if (isize == 0) |
| 3895 | isize = 120; | 3895 | isize = 120; |
| @@ -3950,9 +3950,9 @@ SCRIPT is a symbol representing OpenType script tag. | |||
| 3950 | LANGSYS is a symbol representing OpenType langsys tag, or nil | 3950 | LANGSYS is a symbol representing OpenType langsys tag, or nil |
| 3951 | representing the default langsys. | 3951 | representing the default langsys. |
| 3952 | 3952 | ||
| 3953 | FEATURE is a symbol representing OpenType feature tag. | 3953 | FEATURE is a symbol representing OpenType feature tag. |
| 3954 | 3954 | ||
| 3955 | If the font is not OpenType font, OTF-CAPABILITY is nil. */) | 3955 | If the font is not OpenType font, CAPABILITY is nil. */) |
| 3956 | (font_object) | 3956 | (font_object) |
| 3957 | Lisp_Object font_object; | 3957 | Lisp_Object font_object; |
| 3958 | { | 3958 | { |
| @@ -4013,7 +4013,7 @@ Each element is a vector [GLYPH-CODE LBEARING RBEARING WIDTH ASCENT DESCENT]. * | |||
| 4013 | else | 4013 | else |
| 4014 | ASET (val, 0, Fcons (make_number (code >> 16), | 4014 | ASET (val, 0, Fcons (make_number (code >> 16), |
| 4015 | make_number (code & 0xFFFF))); | 4015 | make_number (code & 0xFFFF))); |
| 4016 | font->driver->text_extents (font, &code, 1, &metrics); | 4016 | font->driver->text_extents (font, &code, 1, &metrics); |
| 4017 | ASET (val, 1, make_number (metrics.lbearing)); | 4017 | ASET (val, 1, make_number (metrics.lbearing)); |
| 4018 | ASET (val, 2, make_number (metrics.rbearing)); | 4018 | ASET (val, 2, make_number (metrics.rbearing)); |
| 4019 | ASET (val, 3, make_number (metrics.width)); | 4019 | ASET (val, 3, make_number (metrics.width)); |
| @@ -4040,7 +4040,7 @@ FONT is a font-spec, font-entity, or font-object. */) | |||
| 4040 | } | 4040 | } |
| 4041 | 4041 | ||
| 4042 | DEFUN ("font-at", Ffont_at, Sfont_at, 1, 3, 0, | 4042 | DEFUN ("font-at", Ffont_at, Sfont_at, 1, 3, 0, |
| 4043 | doc: /* Return a font-object for displaying a character at POSISTION. | 4043 | doc: /* Return a font-object for displaying a character at POSITION. |
| 4044 | Optional second arg WINDOW, if non-nil, is a window displaying | 4044 | Optional second arg WINDOW, if non-nil, is a window displaying |
| 4045 | the current buffer. It defaults to the currently selected window. */) | 4045 | the current buffer. It defaults to the currently selected window. */) |
| 4046 | (position, window, string) | 4046 | (position, window, string) |