emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/ftfont.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/ftfont.c,v
Date: Mon, 09 Jun 2008 07:16:15 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/06/09 07:16:15

Index: ftfont.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ftfont.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- ftfont.c    1 Jun 2008 21:26:53 -0000       1.18
+++ ftfont.c    9 Jun 2008 07:16:15 -0000       1.19
@@ -490,6 +490,7 @@
 
   registry = AREF (spec, FONT_REGISTRY_INDEX);
   if (NILP (registry)
+      || EQ (registry, Qascii_0)
       || EQ (registry, Qiso10646_1)
       || EQ (registry, Qunicode_bmp)
       || EQ (registry, Qunicode_sip))
@@ -669,6 +670,33 @@
   fontset = FcFontList (NULL, pattern, objset);
   if (! fontset)
     goto err;
+#if 0
+  /* Need fix because this finds any fonts.  */
+  if (fontset->nfont == 0 && ! NILP (family))
+    {
+      /* Try maching with configuration.  For instance, the
+        configuration may specify "Nimbus Mono L" as an alias of
+        "Courier".  */
+      FcPattern *pat = FcPatternBuild (0, FC_FAMILY, FcTypeString,
+                                      SYMBOL_FcChar8 (family), NULL);
+      FcChar8 *fam;
+
+      if (FcConfigSubstitute (NULL, pat, FcMatchPattern) == FcTrue)
+       {
+         for (i = 0;
+              FcPatternGetString (pat, FC_FAMILY, i, &fam) == FcResultMatch;
+              i++)
+           {
+             FcPatternDel (pattern, FC_FAMILY);
+             FcPatternAddString (pattern, FC_FAMILY, fam);
+             FcFontSetDestroy (fontset);
+             fontset = FcFontList (NULL, pattern, objset);
+             if (fontset->nfont > 0)
+               break;
+           }
+       }
+    }
+#endif
   for (i = 0; i < fontset->nfont; i++)
     {
       Lisp_Object entity;
@@ -1707,7 +1735,6 @@
 ftfont_font_format (FcPattern *pattern)
 {
   FcChar8 *str;
-  int len;
 
 #ifdef FC_FONTFORMAT
   if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]