changeset 90677:424dec0c7b5d

(Qopentype): New variable. (syms_of_font): Defsym it. (Fquery_font): Change the format of the last element of the return value.
author Kenichi Handa <handa@m17n.org>
date Fri, 24 Nov 2006 01:48:20 +0000
parents c43c3837f597
children 94842604dfce
files src/font.c
diffstat 1 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/font.c	Fri Nov 24 01:47:43 2006 +0000
+++ b/src/font.c	Fri Nov 24 01:48:20 2006 +0000
@@ -52,6 +52,8 @@
 
 Lisp_Object Qfontp;
 
+Lisp_Object Qopentype;
+
 /* Important character set symbols.  */
 Lisp_Object Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip;
 
@@ -3534,7 +3536,7 @@
        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 @@
 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 @@
   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 @@
   font_family_alist = Qnil;
 
   DEFSYM (Qfontp, "fontp");
+  DEFSYM (Qopentype, "opentype");
 
   DEFSYM (Qiso8859_1, "iso8859-1");
   DEFSYM (Qiso10646_1, "iso10646-1");