Commit 876d043f authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

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.
parent 388b22de
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
......
......@@ -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) \
......
......@@ -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",
......
......@@ -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 */
......
......@@ -830,9 +830,6 @@ when setting family in ns_spec_to_descriptor(). */
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];
......
......@@ -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? */
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment