Lisp_Object header = AREF (gstring, 0);
ptrdiff_t len = LGSTRING_CHAR_LEN (gstring);
ptrdiff_t i;
+ struct font *font = NULL;
+ unsigned int code;
+
+ if (FONT_OBJECT_P (font_object))
+ font = XFONT_OBJECT (font_object);
for (i = 0; i < len; i++)
{
LGLYPH_SET_FROM (g, i);
LGLYPH_SET_TO (g, i);
LGLYPH_SET_CHAR (g, c);
- if (FONT_OBJECT_P (font_object))
- {
- font_fill_lglyph_metrics (g, font_object);
- }
+
+ if (font != NULL)
+ code = font->driver->encode_char (font, LGLYPH_CHAR (g));
+ else
+ code = FONT_INVALID_CODE;
+ if (code != FONT_INVALID_CODE)
+ {
+ font_fill_lglyph_metrics (g, font, code);
+ }
else
{
int width = XFIXNAT (CHAR_TABLE_REF (Vchar_width_table, c));
\f
void
-font_fill_lglyph_metrics (Lisp_Object glyph, Lisp_Object font_object)
+font_fill_lglyph_metrics (Lisp_Object glyph, struct font *font, unsigned int code)
{
- struct font *font = XFONT_OBJECT (font_object);
- unsigned code = font->driver->encode_char (font, LGLYPH_CHAR (glyph));
struct font_metrics metrics;
LGLYPH_SET_CODE (glyph, code);
extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *,
struct window *, struct face *,
Lisp_Object);
-extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);
+extern void font_fill_lglyph_metrics (Lisp_Object, struct font *, unsigned int);
extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop,
Lisp_Object val);