From c0943d3db2b2737d5092e887fd22d7088c3ca43d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 13 Oct 2010 01:25:19 +0200 Subject: Fix typos in docstrings, comments and ChangeLogs. * etc/tutorials/TUTORIAL.es: Fix typos. * lisp/cedet/semantic/symref/list.el (semantic-symref-list-rename-open-hits): Fix typo in message. (semantic-symref-list-map-open-hits): Fix typo in docstring. * lisp/erc/erc-xdcc.el (erc-xdcc-help-text): Fix typo in docstring. * lisp/gnus/nnmail.el (nnmail-fancy-expiry-targets): Fix typo in docstring. * lisp/international/mule.el (define-coding-system): * lisp/international/titdic-cnv.el (quail-cxterm-package-ext-info): * composite.el (compose-region): Fix typo in docstring. * lisp/org/org-agenda.el (org-prefix-category-length) (org-prefix-category-max-length): Fix typos in docstrings. * src/font.c (Ffont_variation_glyphs): * ccl.c (Fccl_execute_on_string): Fix typo in docstring. --- src/font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/font.c') diff --git a/src/font.c b/src/font.c index 765712198fe..c72f189d87f 100644 --- a/src/font.c +++ b/src/font.c @@ -4634,7 +4634,7 @@ DEFUN ("font-variation-glyphs", Ffont_variation_glyphs, Sfont_variation_glyphs, doc: /* Return a list of variation glyphs for CHAR in FONT-OBJECT. Each element of the value is a cons (VARIATION-SELECTOR . GLYPH-ID), where - VARIATION-SELECTOR is a chracter code of variation selection + VARIATION-SELECTOR is a character code of variation selection (#xFE00..#xFE0F or #xE0100..#xE01EF) GLYPH-ID is a glyph code of the corresponding variation glyph. */) (font_object, character) -- cgit v1.2.1 From 9fa828240d621736a61f5938f78cc98805fdcf56 Mon Sep 17 00:00:00 2001 From: Damyan Pepper Date: Wed, 13 Oct 2010 16:07:28 +0200 Subject: Fix handling of font properties on Windows (bug#6303). * src/font.c (font_filter_properties): New function, refactored from ftfont_filter_properties. * src/font.h (font_filter_properties): Declare. * src/ftfont.c (ftfont_filter_properties): Use font_filter_properties. * src/w32font.c (w32font_booleans, w32font_non_booleans): New variables. (w32font_filter_properties): New function. (w32font_driver): Add w32font_filter_properties. --- src/font.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/font.c') diff --git a/src/font.c b/src/font.c index c72f189d87f..77f43c81d71 100644 --- a/src/font.c +++ b/src/font.c @@ -3862,6 +3862,59 @@ font_get_frame_data (f, driver) } +/* Sets attributes on a font. Any properties that appear in ALIST and + BOOLEAN_PROPERTIES or NON_BOOLEAN_PROPERTIES are set on the font. + BOOLEAN_PROPERTIES and NON_BOOLEAN_PROPERTIES are NULL-terminated + arrays of strings. This function is intended for use by the font + drivers to implement their specific font_filter_properties. */ +void +font_filter_properties (font, alist, boolean_properties, non_boolean_properties) + Lisp_Object font; + Lisp_Object alist; + const char *boolean_properties[]; + const char *non_boolean_properties[]; +{ + Lisp_Object it; + int i; + + /* Set boolean values to Qt or Qnil */ + for (i = 0; boolean_properties[i] != NULL; ++i) + for (it = alist; ! NILP (it); it = XCDR (it)) + { + Lisp_Object key = XCAR (XCAR (it)); + Lisp_Object val = XCDR (XCAR (it)); + char *keystr = SDATA (SYMBOL_NAME (key)); + + if (strcmp (boolean_properties[i], keystr) == 0) + { + const char *str = INTEGERP (val) ? (XINT (val) ? "true" : "false") + : SYMBOLP (val) ? (const char *) SDATA (SYMBOL_NAME (val)) + : "true"; + + if (strcmp ("false", str) == 0 || strcmp ("False", str) == 0 + || strcmp ("FALSE", str) == 0 || strcmp ("FcFalse", str) == 0 + || strcmp ("off", str) == 0 || strcmp ("OFF", str) == 0 + || strcmp ("Off", str) == 0) + val = Qnil; + else + val = Qt; + + Ffont_put (font, key, val); + } + } + + for (i = 0; non_boolean_properties[i] != NULL; ++i) + for (it = alist; ! NILP (it); it = XCDR (it)) + { + Lisp_Object key = XCAR (XCAR (it)); + Lisp_Object val = XCDR (XCAR (it)); + char *keystr = SDATA (SYMBOL_NAME (key)); + if (strcmp (non_boolean_properties[i], keystr) == 0) + Ffont_put (font, key, val); + } +} + + /* Return the font used to draw character C by FACE at buffer position POS in window W. If STRING is non-nil, it is a string containing C at index POS. If C is negative, get C from the current buffer or -- cgit v1.2.1