+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
/* 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,
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
};
#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) \
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;
#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",
#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 */
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];
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;
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? */
/* 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;
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);
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;