extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
-
-struct font_driver;
-struct font;
-struct glyph_string;
-
/* An enumerator for each font property. This is used as an index to
the vector of FONT-SPEC and FONT-ENTITY.
#define FONT_SET_STYLE(font, prop, val) \
ASET ((font), prop, make_number (font_style_to_value (prop, val, 1)))
+#define FONT_WIDTH(f) ((f)->max_width)
+#define FONT_HEIGHT(f) ((f)->height)
+#define FONT_BASE(f) ((f)->ascent)
+#define FONT_DESCENT(f) ((f)->descent)
+
extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript;
extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity;
extern Lisp_Object Qp;
/* Ascent and descent of the font (in pixels). */
int ascent, descent;
+ /* The following members makes sense on graphic displays only. */
+
+#if defined (HAVE_WINDOW_SYSTEM)
+
/* Vertical pixel width of the underline. If is zero if that
information is not in the font. */
int underline_thickness;
registered in char-table `use-default-ascent'. */
int default_ascent;
- /* CCL program to calculate code points of the font. */
- struct ccl_program *font_encoder;
-
- /* Font-driver for the font. */
- struct font_driver *driver;
-
/* Charset to encode a character code into a glyph code of the font.
-1 means that the font doesn't require this information to encode
a character. */
determine it. */
int repertory_charset;
+#endif /* HAVE_WINDOW_SYSTEM */
+
+ /* Font-driver for the font. */
+ struct font_driver *driver;
+
/* There are more members in this structure, but they are private
to the font-driver. */
};
int left;
int top;
int advance;
- void *extra;
};
/* Predicates to check various font-related objects. */
this value. */
#define FONT_PIXEL_SIZE_QUANTUM 1
-struct face;
-
#define FONT_INVALID_CODE 0xFFFFFFFF
/* Font driver. Members specified as "optional" can be NULL. */
Lisp_Object (*open) (struct frame *f, Lisp_Object font_entity,
int pixel_size);
- /* Close FONT on frame F. */
- void (*close) (struct frame *f, struct font *font);
+ /* Close FONT. NOTE: this can be called by GC. */
+ void (*close) (struct font *font);
/* Optional (if FACE->extra is not used).
Prepare FACE for displaying characters by FONT on frame F by
unsigned *code, int nglyphs,
struct font_metrics *metrics);
+#ifdef HAVE_WINDOW_SYSTEM
+
/* Optional.
Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
position of frame F with S->FACE and S->GC. If WITH_BACKGROUND,
Free bitmap data in BITMAP. */
void (*free_bitmap) (struct font *font, struct font_bitmap *bitmap);
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Optional.
Return an outline data for glyph-code CODE of FONT. The format
of the outline data depends on the font-driver. */
Lisp_Object spec);
extern void font_prepare_for_face (struct frame *f, struct face *face);
extern void font_done_for_face (struct frame *f, struct face *face);
+extern void clear_font_cache (struct frame *);
extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec);
extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name);
extern Lisp_Object Qfontsize;
extern struct font_driver nsfont_driver;
extern void syms_of_nsfont (void);
+extern void syms_of_macfont (void);
#endif /* HAVE_NS */
#ifndef FONT_DEBUG