]> git.eshelyaron.com Git - emacs.git/commitdiff
Next minor cleanup of font subsystem.
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 9 Jul 2014 06:25:35 +0000 (10:25 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 9 Jul 2014 06:25:35 +0000 (10:25 +0400)
* font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
users) and FONT_FORMAT_INDEX (set by a few font drivers but never
really used).
(FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
unused.
* ftfont.h (ftfont_font_format): Remove prototype.
* ftfont.c (ftfont_font_format): Remove; now unused.
(ftfont_open):
* nsfont.m (nsfont_open):
* w32font.c (w32font_open_internal):
* w32uniscribe.c (uniscribe_open):
* xfont.c (xfont_open):
* xftfont.c (xftfont_open): All users changed.

src/ChangeLog
src/font.h
src/ftfont.c
src/ftfont.h
src/nsfont.m
src/w32font.c
src/w32uniscribe.c
src/xfont.c
src/xftfont.c

index ba56edda715482749c53a869e4dc9d13b4afebc9..10984d5ce25189f69b5e39260eb9db242108bee8 100644 (file)
@@ -1,3 +1,20 @@
+2014-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Next minor cleanup of font subsystem.
+       * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
+       users) and FONT_FORMAT_INDEX (set by a few font drivers but never
+       really used).
+       (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
+       unused.
+       * ftfont.h (ftfont_font_format): Remove prototype.
+       * ftfont.c (ftfont_font_format): Remove; now unused.
+       (ftfont_open):
+       * nsfont.m (nsfont_open):
+       * w32font.c (w32font_open_internal):
+       * w32uniscribe.c (uniscribe_open):
+       * xfont.c (xfont_open):
+       * xftfont.c (xftfont_open): All users changed.
+
 2014-07-09  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_to): Adjust calculation of line_start_x to what
index 96c030c3af17a01cc14ca4fb7c6e3fb53115c85f..5bf0efb738ac22aba34fbb93c0e965042d87712f 100644 (file)
@@ -162,9 +162,6 @@ enum font_property_index
     /* List of font-objects opened from the font-entity.  */
     FONT_OBJLIST_INDEX = FONT_SPEC_MAX,
 
-    /* Font-entity from which the font-object is opened.  */
-    FONT_ENTITY_INDEX = FONT_SPEC_MAX,
-
     /* This value is the length of font-entity vector.  */
     FONT_ENTITY_MAX,
 
@@ -182,9 +179,6 @@ enum font_property_index
        is not available.  */
     FONT_FILE_INDEX,
 
-    /* Format of the font (symbol) or nil if unknown.  */
-    FONT_FORMAT_INDEX,
-
     /* This value is the length of font-object vector.  */
     FONT_OBJECT_MAX
   };
@@ -442,15 +436,6 @@ struct font_bitmap
 #define FONT_OBJECT_P(x)       \
   (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)
 
-/* True iff ENTITY can't be loaded.  */
-#define FONT_ENTITY_NOT_LOADABLE(entity)       \
-  EQ (AREF (entity, FONT_OBJLIST_INDEX), Qt)
-
-/* Flag ENTITY not loadable.  */
-#define FONT_ENTITY_SET_NOT_LOADABLE(entity)   \
-  ASET (entity, FONT_OBJLIST_INDEX, Qt)
-
-
 /* Check macros for various font-related objects.  */
 
 #define CHECK_FONT(x)  \
index 2d75dc2267984480c167d7e060f0ff682b8b8575..419274a30aa4a5066615ab3f9284cdc200a40838 100644 (file)
@@ -1223,7 +1223,6 @@ ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
   font_object = font_build_object (VECSIZE (struct ftfont_info),
                                   Qfreetype, entity, size);
   ASET (font_object, FONT_FILE_INDEX, filename);
-  ASET (font_object, FONT_FORMAT_INDEX, ftfont_font_format (NULL, filename));
   font = XFONT_OBJECT (font_object);
   ftfont_info = (struct ftfont_info *) font;
   ftfont_info->ft_size = ft_face->size;
@@ -2587,46 +2586,6 @@ ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256])
 #endif /* HAVE_OTF_GET_VARIATION_GLYPHS */
 #endif /* HAVE_LIBOTF */
 
-Lisp_Object
-ftfont_font_format (FcPattern *pattern, Lisp_Object filename)
-{
-  FcChar8 *str;
-
-#ifdef FC_FONTFORMAT
-  if (pattern)
-    {
-      if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch)
-       return Qnil;
-      if (strcmp ((char *) str, "TrueType") == 0)
-       return intern ("truetype");
-      if (strcmp ((char *) str, "Type 1") == 0)
-       return intern ("type1");
-      if (strcmp ((char *) str, "PCF") == 0)
-       return intern ("pcf");
-      if (strcmp ((char *) str, "BDF") == 0)
-       return intern ("bdf");
-    }
-#endif  /* FC_FONTFORMAT */
-  if (STRINGP (filename))
-    {
-      int len = SBYTES (filename);
-
-      if (len >= 4)
-       {
-         str = (FcChar8 *) (SDATA (filename) + len - 4);
-         if (xstrcasecmp ((char *) str, ".ttf") == 0)
-           return intern ("truetype");
-         if (xstrcasecmp ((char *) str, ".pfb") == 0)
-           return intern ("type1");
-         if (xstrcasecmp ((char *) str, ".pcf") == 0)
-           return intern ("pcf");
-         if (xstrcasecmp ((char *) str, ".bdf") == 0)
-           return intern ("bdf");
-       }
-    }
-  return intern ("unknown");
-}
-
 static const char *const ftfont_booleans [] = {
   ":antialias",
   ":hinting",
index 8c8674f3440a6b3eb524a2c20c92ca0caa4130c0..210b634c0942befd5872cbcffca2cc9785c0594c 100644 (file)
@@ -36,7 +36,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif /* HAVE_M17N_FLT */
 #endif /* HAVE_LIBOTF */
 
-extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object);
 extern FcCharSet *ftfont_get_fc_charset (Lisp_Object);
 
 #endif /* EMACS_FTFONT_H */
index 4ed45991b935b5b67ad1a2180de4d5af0f82aa5d..98c25fcdedd07191457778a05f357db3df1f04ce 100644 (file)
@@ -830,9 +830,6 @@ nsfont_open (struct frame *f, Lisp_Object font_entity, int pixel_size)
   font->baseline_offset = 0;
   font->relative_compose = 0;
 
-  font->props[FONT_FORMAT_INDEX] = Qns;
-  font->props[FONT_FILE_INDEX] = Qnil;
-
   {
     const char *fontName = [[nsfont fontName] UTF8String];
 
index 43b592ee450e806d547d9b90090b698694f13d6a..81e25eb0856ae24accb7f2b1009438d7cf731159 100644 (file)
@@ -886,7 +886,7 @@ w32font_open_internal (struct frame *f, Lisp_Object font_entity,
   LOGFONT logfont;
   HDC dc;
   HFONT hfont, old_font;
-  Lisp_Object val, extra;
+  Lisp_Object val;
   struct w32font_info *w32_font;
   struct font * font;
   OUTLINETEXTMETRICW* metrics = NULL;
@@ -979,21 +979,6 @@ w32font_open_internal (struct frame *f, Lisp_Object font_entity,
   font->default_ascent = w32_font->metrics.tmAscent;
   font->pixel_size = size;
   font->driver = &w32font_driver;
-  /* Use format cached during list, as the information we have access to
-     here is incomplete.  */
-  extra = AREF (font_entity, FONT_EXTRA_INDEX);
-  if (CONSP (extra))
-    {
-      val = assq_no_quit (QCformat, extra);
-      if (CONSP (val))
-        font->props[FONT_FORMAT_INDEX] = XCDR (val);
-      else
-        font->props[FONT_FORMAT_INDEX] = Qunknown;
-    }
-  else
-    font->props[FONT_FORMAT_INDEX] = Qunknown;
-
-  font->props[FONT_FILE_INDEX] = Qnil;
   font->encoding_charset = -1;
   font->repertory_charset = -1;
   /* TODO: do we really want the minimum width here, which could be negative? */
index 24fc753e708c3dba2292443077a0d6718c5e5849..d06586f973ab5a9b653fa7a3b0b3c4804b5cf86b 100644 (file)
@@ -127,8 +127,6 @@ uniscribe_open (struct frame *f, Lisp_Object font_entity, int pixel_size)
   /* Uniscribe backend uses glyph indices.  */
   uniscribe_font->w32_font.glyph_idx = ETO_GLYPH_INDEX;
 
-  /* Mark the format as opentype  */
-  uniscribe_font->w32_font.font.props[FONT_FORMAT_INDEX] = Qopentype;
   uniscribe_font->w32_font.font.driver = &uniscribe_font_driver;
 
   return font_object;
index baed9abbc7ef32ca796c6d7a425784c594d45a3a..8996783541b9e3353cdfedeac771dd52123aba94 100644 (file)
@@ -804,8 +804,6 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
       ASET (font_object, FONT_NAME_INDEX, make_string (buf, len));
     }
   ASET (font_object, FONT_FULLNAME_INDEX, fullname);
-  ASET (font_object, FONT_FILE_INDEX, Qnil);
-  ASET (font_object, FONT_FORMAT_INDEX, Qx);
   font = XFONT_OBJECT (font_object);
   ((struct xfont_info *) font)->xfont = xfont;
   ((struct xfont_info *) font)->display = FRAME_X_DISPLAY (f);
index 1ca3f92b23913c6409f9832907a38bd84edf5070..9726a3b991199317bfba7c148756ecfb4b3471ea 100644 (file)
@@ -343,8 +343,6 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
   font_object = font_build_object (VECSIZE (struct xftfont_info),
                                   Qxft, entity, size);
   ASET (font_object, FONT_FILE_INDEX, filename);
-  ASET (font_object, FONT_FORMAT_INDEX,
-       ftfont_font_format (xftfont->pattern, filename));
   font = XFONT_OBJECT (font_object);
   font->pixel_size = size;
   font->driver = &xftfont_driver;