Mercurial > emacs
comparison src/font.c @ 110997:b8fde5ef9e14
Merge changes from emacs-23 branch.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 14 Oct 2010 16:32:27 +0200 |
parents | 55c8c3ca3d48 36726f009542 |
children | de02b794c330 |
comparison
equal
deleted
inserted
replaced
110996:e65b79c36e50 | 110997:b8fde5ef9e14 |
---|---|
3721 return NULL; | 3721 return NULL; |
3722 return list->data; | 3722 return list->data; |
3723 } | 3723 } |
3724 | 3724 |
3725 | 3725 |
3726 /* Sets attributes on a font. Any properties that appear in ALIST and | |
3727 BOOLEAN_PROPERTIES or NON_BOOLEAN_PROPERTIES are set on the font. | |
3728 BOOLEAN_PROPERTIES and NON_BOOLEAN_PROPERTIES are NULL-terminated | |
3729 arrays of strings. This function is intended for use by the font | |
3730 drivers to implement their specific font_filter_properties. */ | |
3731 void | |
3732 font_filter_properties (Lisp_Object font, | |
3733 Lisp_Object alist, | |
3734 const char *boolean_properties[], | |
3735 const char *non_boolean_properties[]) | |
3736 { | |
3737 Lisp_Object it; | |
3738 int i; | |
3739 | |
3740 /* Set boolean values to Qt or Qnil */ | |
3741 for (i = 0; boolean_properties[i] != NULL; ++i) | |
3742 for (it = alist; ! NILP (it); it = XCDR (it)) | |
3743 { | |
3744 Lisp_Object key = XCAR (XCAR (it)); | |
3745 Lisp_Object val = XCDR (XCAR (it)); | |
3746 char *keystr = SDATA (SYMBOL_NAME (key)); | |
3747 | |
3748 if (strcmp (boolean_properties[i], keystr) == 0) | |
3749 { | |
3750 const char *str = INTEGERP (val) ? (XINT (val) ? "true" : "false") | |
3751 : SYMBOLP (val) ? (const char *) SDATA (SYMBOL_NAME (val)) | |
3752 : "true"; | |
3753 | |
3754 if (strcmp ("false", str) == 0 || strcmp ("False", str) == 0 | |
3755 || strcmp ("FALSE", str) == 0 || strcmp ("FcFalse", str) == 0 | |
3756 || strcmp ("off", str) == 0 || strcmp ("OFF", str) == 0 | |
3757 || strcmp ("Off", str) == 0) | |
3758 val = Qnil; | |
3759 else | |
3760 val = Qt; | |
3761 | |
3762 Ffont_put (font, key, val); | |
3763 } | |
3764 } | |
3765 | |
3766 for (i = 0; non_boolean_properties[i] != NULL; ++i) | |
3767 for (it = alist; ! NILP (it); it = XCDR (it)) | |
3768 { | |
3769 Lisp_Object key = XCAR (XCAR (it)); | |
3770 Lisp_Object val = XCDR (XCAR (it)); | |
3771 char *keystr = SDATA (SYMBOL_NAME (key)); | |
3772 if (strcmp (non_boolean_properties[i], keystr) == 0) | |
3773 Ffont_put (font, key, val); | |
3774 } | |
3775 } | |
3776 | |
3777 | |
3726 /* Return the font used to draw character C by FACE at buffer position | 3778 /* Return the font used to draw character C by FACE at buffer position |
3727 POS in window W. If STRING is non-nil, it is a string containing C | 3779 POS in window W. If STRING is non-nil, it is a string containing C |
3728 at index POS. If C is negative, get C from the current buffer or | 3780 at index POS. If C is negative, get C from the current buffer or |
3729 STRING. */ | 3781 STRING. */ |
3730 | 3782 |
4484 DEFUN ("font-variation-glyphs", Ffont_variation_glyphs, Sfont_variation_glyphs, | 4536 DEFUN ("font-variation-glyphs", Ffont_variation_glyphs, Sfont_variation_glyphs, |
4485 2, 2, 0, | 4537 2, 2, 0, |
4486 doc: /* Return a list of variation glyphs for CHAR in FONT-OBJECT. | 4538 doc: /* Return a list of variation glyphs for CHAR in FONT-OBJECT. |
4487 Each element of the value is a cons (VARIATION-SELECTOR . GLYPH-ID), | 4539 Each element of the value is a cons (VARIATION-SELECTOR . GLYPH-ID), |
4488 where | 4540 where |
4489 VARIATION-SELECTOR is a chracter code of variation selection | 4541 VARIATION-SELECTOR is a character code of variation selection |
4490 (#xFE00..#xFE0F or #xE0100..#xE01EF) | 4542 (#xFE00..#xFE0F or #xE0100..#xE01EF) |
4491 GLYPH-ID is a glyph code of the corresponding variation glyph. */) | 4543 GLYPH-ID is a glyph code of the corresponding variation glyph. */) |
4492 (Lisp_Object font_object, Lisp_Object character) | 4544 (Lisp_Object font_object, Lisp_Object character) |
4493 { | 4545 { |
4494 unsigned variations[256]; | 4546 unsigned variations[256]; |