Mercurial > emacs
diff src/w32font.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 | e0ac9a58795e 734b2470f93c |
children | 1e95f3ea022d |
line wrap: on
line diff
--- a/src/w32font.c Thu Oct 14 13:55:30 2010 +0000 +++ b/src/w32font.c Thu Oct 14 16:32:27 2010 +0200 @@ -333,7 +333,7 @@ } /* w32 implementation of encode_char for font backend. - Return a glyph code of FONT for characer C (Unicode code point). + Return a glyph code of FONT for character C (Unicode code point). If FONT doesn't have such a glyph, return FONT_INVALID_CODE. For speed, the gdi backend uses unicode (Emacs calls encode_char @@ -1798,7 +1798,7 @@ if (fnweight >= FW_NORMAL) return 100; if (fnweight >= FW_LIGHT) return 50; if (fnweight >= FW_EXTRALIGHT) return 40; - if (fnweight > FW_THIN) return 20; + if (fnweight > FW_THIN) return 20; return 0; } @@ -1812,7 +1812,7 @@ if (n >= 100) return FW_NORMAL; if (n >= 50) return FW_LIGHT; if (n >= 40) return FW_EXTRALIGHT; - if (n >= 20) return FW_THIN; + if (n >= 20) return FW_THIN; return 0; } @@ -1822,9 +1822,9 @@ w32_to_fc_weight (int n) { if (n >= FW_EXTRABOLD) return intern ("black"); - if (n >= FW_BOLD) return intern ("bold"); - if (n >= FW_SEMIBOLD) return intern ("demibold"); - if (n >= FW_NORMAL) return intern ("medium"); + if (n >= FW_BOLD) return intern ("bold"); + if (n >= FW_SEMIBOLD) return intern ("demibold"); + if (n >= FW_NORMAL) return intern ("medium"); return intern ("light"); } @@ -1912,7 +1912,6 @@ logfont->lfPitchAndFamily = family | DEFAULT_PITCH; } - /* Set pitch based on the spacing property. */ tmp = AREF (font_spec, FONT_SPACING_INDEX); if (INTEGERP (tmp)) @@ -2378,6 +2377,23 @@ return DECODE_SYSTEM (build_string (buf)); } +static const char *w32font_booleans [] = { + NULL, +}; + +static const char *w32font_non_booleans [] = { + ":script", + ":antialias", + ":style", + NULL, +}; + +static void +w32font_filter_properties (Lisp_Object font, Lisp_Object alist) +{ + font_filter_properties (font, alist, w32font_booleans, w32font_non_booleans); +} + struct font_driver w32font_driver = { 0, /* Qgdi */ @@ -2407,7 +2423,7 @@ NULL, /* shape */ NULL, /* check */ NULL, /* get_variation_glyphs */ - NULL, /* filter_properties */ + w32font_filter_properties, };