From e0708580753061d1e4f0e773b9d6ac909d9f5343 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 24 Nov 2006 01:48:20 +0000 Subject: [PATCH] (Qopentype): New variable. (syms_of_font): Defsym it. (Fquery_font): Change the format of the last element of the return value. --- src/font.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/font.c b/src/font.c index b1bdd10d51a..a4c120981ba 100644 --- a/src/font.c +++ b/src/font.c @@ -52,6 +52,8 @@ int enable_font_backend; Lisp_Object Qfontp; +Lisp_Object Qopentype; + /* Important character set symbols. */ Lisp_Object Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip; @@ -3534,7 +3536,7 @@ DEFUN ("query-font", Fquery_font, Squery_font, 1, 1, 0, doc: /* Return information about FONT-OBJECT. The value is a vector: [ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH - OTF-CAPABILITY ] + CAPABILITY ] NAME is a string of the font name (or nil if the font backend doesn't provide a name). @@ -3549,10 +3551,19 @@ SIZE is a maximum advance width of the font in pixel. ASCENT, DESCENT, SPACE-WIDTH, AVERAGE-WIDTH are metrics of the font in pixel. -OTF-CAPABILITY is a cons (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 ...) ...) ...) +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 describes a detail 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. @@ -3584,7 +3595,9 @@ If the font is not OpenType font, OTF-CAPABILITY is nil. */) ASET (val, 6, make_number (font->font.space_width)); ASET (val, 7, make_number (font->font.average_width)); if (font->driver->otf_capability) - ASET (val, 8, font->driver->otf_capability (font)); + ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font))); + else + ASET (val, 8, Fcons (font->format, Qnil)); return val; } @@ -3743,6 +3756,7 @@ syms_of_font () font_family_alist = Qnil; DEFSYM (Qfontp, "fontp"); + DEFSYM (Qopentype, "opentype"); DEFSYM (Qiso8859_1, "iso8859-1"); DEFSYM (Qiso10646_1, "iso10646-1"); -- 2.39.5