From: Kenichi Handa Date: Wed, 25 Aug 2010 05:58:15 +0000 (+0900) Subject: fontset.c (reorder_font_vector): Prefer a font-spec specifying :otf. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~239^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9dfdbc0ad57f07e3d1fa810b62217a79d34fd54d;p=emacs.git fontset.c (reorder_font_vector): Prefer a font-spec specifying :otf. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5ce4c049c77..39f168dc8a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2010-08-25 Kenichi Handa + * fontset.c (reorder_font_vector): Prefer a font-spec specifying + :otf. + * composite.c (composition_compute_stop_pos): Don't break composition at PT. (composition_reseat_it): Likewise. Fix calculation of character diff --git a/src/fontset.c b/src/fontset.c index b273ace75af..86b9ceb45db 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -283,6 +283,10 @@ fontset_id_valid_p (id) #define RFONT_DEF_OBJECT(rfont_def) AREF (rfont_def, 2) #define RFONT_DEF_SET_OBJECT(rfont_def, object) \ ASET ((rfont_def), 2, (object)) +/* Score of RFONT_DEF is an integer value; the lowest 8 bits represent + the order of listing by font backends, the higher bits represents + the order given by charset priority list. The smaller value is + preferable. */ #define RFONT_DEF_SCORE(rfont_def) XINT (AREF (rfont_def, 3)) #define RFONT_DEF_SET_SCORE(rfont_def, score) \ ASET ((rfont_def), 3, make_number (score)) @@ -412,8 +416,13 @@ reorder_font_vector (Lisp_Object font_group, struct font *font) Lisp_Object font_def = RFONT_DEF_FONT_DEF (rfont_def); Lisp_Object font_spec = FONT_DEF_SPEC (font_def); int score = RFONT_DEF_SCORE (rfont_def) & 0xFF; + Lisp_Object otf_spec = Ffont_get (font_spec, QCotf); - if (! font_match_p (font_spec, font_object)) + if (! NILP (otf_spec)) + /* A font-spec with :otf is preferable regardless of encoding + and language.. */ + ; + else if (! font_match_p (font_spec, font_object)) { Lisp_Object encoding = FONT_DEF_ENCODING (font_def);