Function: query-font
query-font is a function defined in font.c.
Signature
(query-font FONT-OBJECT)
Documentation
Return information about FONT-OBJECT.
The value is a vector:
[ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH
CAPABILITY ]
NAME is the font name, a string (or nil if the font backend doesn't provide a name).
FILENAME is the font file name, a string (or nil if the font backend doesn't provide a file name).
PIXEL-SIZE is a pixel size by which the font is opened.
SIZE is a maximum advance width of the font in pixels.
ASCENT, DESCENT, SPACE-WIDTH, AVERAGE-WIDTH are metrics of the font in pixels.
CAPABILITY is a list whose first element is a symbol representing the font format (x, opentype, truetype, type1, pcf, or bdf) and the remaining elements describe the details of the font capability.
If the font is OpenType font, the form of the list is
(opentype GSUB GPOS)
where GSUB shows which "GSUB" features the font supports, and GPOS
shows which "GPOS" features the font supports. Both GSUB and GPOS are
lists of the format:
((SCRIPT (LANGSYS FEATURE ...) ...) ...)
If the font is not OpenType font, currently the length of the form is one.
SCRIPT is a symbol representing OpenType script tag.
LANGSYS is a symbol representing OpenType langsys tag, or nil representing the default langsys.
FEATURE is a symbol representing OpenType feature tag.
If the font is not OpenType font, CAPABILITY is nil.
Source Code
// Defined in /usr/src/emacs/src/font.c
{
struct font *font = CHECK_FONT_GET_OBJECT (font_object);
return CALLN (Fvector,
AREF (font_object, FONT_NAME_INDEX),
AREF (font_object, FONT_FILE_INDEX),
make_fixnum (font->pixel_size),
make_fixnum (font->max_width),
make_fixnum (font->ascent),
make_fixnum (font->descent),
make_fixnum (font->space_width),
make_fixnum (font->average_width),
(font->driver->otf_capability
? Fcons (Qopentype, font->driver->otf_capability (font))
: Qnil));
}