From f4cc015342c6cb3cdd4c133a0df3623e05d7de87 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 13 Jun 2008 04:26:01 +0000 Subject: [PATCH] (font_score): Ignore the diffference of alias style symbols. --- src/ChangeLog | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/font.c | 5 ++--- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6e181f60cd2..a648ca5cbbf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,47 @@ +2008-06-13 Kenichi Handa + + * dispextern.h (enum lface_attribute_index): New member + LFACE_FOUNDRY_INDEX. + + * font.c (font_score): Delete arg alternate_families. Check only + weight, slant, width, and size. Ignore the diffference of alias + style symbols. + (font_sort_entites): Adjusted for the above change. Reflect the + order of font-driver to scores. + (font_list_entities): Don't check alternate_familes here. + (font_clear_prop): Handle foundry. + (font_update_lface): Don't parse "foundry-family" form here. + Handle FONT_FOUNDRY_INDEX. + (font_find_for_lface): Likewise. Handle alternate families here. + (font_open_for_lface): Pay attention to size in ENTITY. + (font_open_by_name): Simplified by calling font_load_for_lface. + (free_font_driver_list): Delete it. + (font_update_drivers): Preserve the order of backends. + (syms_of_font): Setting of sort_shift_bits adjusted for the change + of font_score and font_sort_entites. + (font_update_sort_order): Likewise. + + * xfaces.c (LFACE_FOUNDRY): New macro. + (check_lface_attrs): Check foundry. + (set_lface_from_font): Don't parse "FOUNDRY-FAMILY" from. + (merge_face_vectors): Check foundry. + (merge_face_ref): Likewise. + (Finternal_set_lisp_face_attribute): Likewise. + (x_update_menu_appearance): Likewise. + (Finternal_get_lisp_face_attribute): Likewise. + (lface_hash): Likewise. + (lface_same_font_attributes_p): Likewise. + (x_supports_face_attributes_p): Likewise. + (tty_supports_face_attributes_p): Likewise. + (Finternal_set_alternative_font_family_alist): Intern strings. + (Finternal_set_alternative_font_registry_alist): Downcase strings. + (realize_default_face): Set LFACE_FOUNDRY (lface). + + * xfns.c (Fx_create_frame, x_create_tip_frame): Register X + font-driver at first. + + * ftfont.c (ftfont_font_format) [! FC_FONTFORMAT]: Declare "int len;". + 2008-06-12 Emanuele Giaquinta (tiny change) * lread.c (Fload): Use xfree, not free on saved_doc_string. diff --git a/src/font.c b/src/font.c index 6c29a4487bd..71f5c1d03f8 100644 --- a/src/font.c +++ b/src/font.c @@ -2117,9 +2117,8 @@ font_score (entity, spec_prop) if (diff < 0) diff = - diff; - /* This is to prefer the exact symbol style. */ - diff++; - score |= min (diff, 127) << sort_shift_bits[i]; + if (diff > 0) + score |= min (diff, 127) << sort_shift_bits[i]; } /* Score the size. Maximum difference is 127. */ -- 2.39.2