From: Kenichi Handa Date: Thu, 22 May 2008 05:21:06 +0000 (+0000) Subject: (font_prop_validate_style): Adjusted for the format X-Git-Tag: emacs-pretest-23.0.90~5363 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=64b900e33e80ac10e247d2ef03b746c10e5d8ff4;p=emacs.git (font_prop_validate_style): Adjusted for the format change of font_style_table. --- diff --git a/src/ChangeLog b/src/ChangeLog index 77e7dc86bdb..f9ed2746df3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2008-05-22 Kenichi Handa + * font.c (font_prop_validate_style): Adjusted for the format + change of font_style_table. + * w32font.c (w32font_open_internal): Call Ffont_xlfd_name with two args. @@ -40,21 +43,21 @@ * font.c: Checking of FONT_DEBUG is moved to font.h. All calls of xassert are changed to font_assert. Delete many unused variables. - (Vfont_weight_table, Vfont_slant_table, Vfont_width_table): - New variables. + (Vfont_weight_table, Vfont_slant_table, Vfont_width_table): New + variables. (struct table_entry): Move from xfaces.c and modified. (weight_table, slant_table, width_table): Move from xfaces.c and contents adjusted for the change of struct table_entry. - (font_style_to_value, font_style_symbolic): Adjut for the format - change of font_style_table. + (font_style_to_value, font_style_symbolic): Adjusted for the + format change of font_style_table. (font_parse_family_registry): Don't overwrite existing foundry and family of font_spec. (font_score): Fix calculation of diff for sizes. (font_sort_entites): Call font_add_log. (font_delete_unmatched): Return a newly created list. (font_list_entities): Fix previous change. Call font_add_log. - (font_matching_entity, font_open_entity, font_close_entity): - Call font_add_log. + (font_matching_entity, font_open_entity, font_close_entity): Call + font_add_log. (Ffont_xlfd_name): New arg FOLD-WILDCARDS. (Finternal_set_font_style_table): Delete. (BUILD_STYLE_TABLE): New macro. diff --git a/src/font.c b/src/font.c index 44c5aef9b90..84f2a2ac867 100644 --- a/src/font.c +++ b/src/font.c @@ -500,13 +500,16 @@ font_prop_validate_style (style, val) if (INTEGERP (val)) { n = XINT (val); - if ((n & 0xFF) + if (((n >> 4) & 0xF) >= ASIZE (AREF (font_style_table, prop - FONT_WEIGHT_INDEX))) val = Qerror; else { - Lisp_Object elt = AREF (AREF (font_style_table, prop - FONT_WEIGHT_INDEX), n & 0xFF); - if (XINT (XCDR (elt)) != (n >> 8)) + Lisp_Object elt = AREF (AREF (font_style_table, prop - FONT_WEIGHT_INDEX), (n >> 4) & 0xF); + + if ((n & 0xF) + 1 >= ASIZE (elt)) + val = Qerror; + else if (XINT (AREF (elt, 0)) != (n >> 8)) val = Qerror; } }