changeset 109981:55e2c5cbf29c

fontset.c (reorder_font_vector): Prefer a font-spec specifying :otf.
author Kenichi Handa <handa@m17n.org>
date Wed, 25 Aug 2010 15:10:09 +0900
parents 27e6f236ba8d (current diff) afecdfb04036 (diff)
children 1c825c451dc0 d9cfc4f455fc
files
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Aug 25 01:23:47 2010 -0400
+++ b/src/ChangeLog	Wed Aug 25 15:10:09 2010 +0900
@@ -1,5 +1,8 @@
 2010-08-25  Kenichi Handa  <handa@m17n.org>
 
+	* 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
--- a/src/fontset.c	Wed Aug 25 01:23:47 2010 -0400
+++ b/src/fontset.c	Wed Aug 25 15:10:09 2010 +0900
@@ -283,6 +283,10 @@
 #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 @@
       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);