1 /* otf.h -- Header file for the OTF (OpenType font) library.
4 by AIST (National Institute of Advanced Industrial Science and Technology)
5 Registration Number H14PRO???
7 This file is part of the OTF library.
9 The OTF library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2, or (at
12 your option) any later version.
14 The OTF library is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with the OTF library; see the file COPYING. If not, write to
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
30 (1) Structures for OTF Layout tables and OTF itself
35 (1-5) Structures common to GDEF, GSUB, and GPOS
37 (1-7) Structures for ScriptList, FeatureList, and LookupList
38 (1-8) Structures common to GSUB and GPOS
41 (1-11) Structure for OTF
43 (2) API for reading OTF
47 (2-4) OTF_check_table()
49 (3) API for driving OTF
50 (3-1) Structure for glyph string
51 (3-2) OTF_drive_cmap()
52 (3-3) OTF_drive_gdef()
53 (3-4) OTF_drive_gsub()
54 (3-5) OTF_drive_gpos()
55 (3-6) OTF_drive_tables()
57 (4) API for error handling
66 /*** (1) Structures for OTF Layout tables and OTF itself */
68 /*** (1-1) Basic types */
70 typedef unsigned OTF_Tag;
71 typedef unsigned OTF_GlyphID;
72 typedef unsigned OTF_Offset;
81 /*** (1-2) "head" table */
85 OTF_Fixed TableVersionNumber;
86 OTF_Fixed fontRevision;
87 unsigned checkSumAdjustment;
94 /*** (1-3) "name" table */
106 #define OTF_max_nameID 23
113 OTF_NameRecord *nameRecord;
114 char *name[OTF_max_nameID + 1];
118 /*** (1-4) "cmap" table */
122 unsigned char glyphIdArray[256];
123 } OTF_EncodingSubtable0;
130 unsigned idRangeOffset;
135 unsigned subHeaderKeys[256];
136 OTF_cmapSubHeader *subHeaders;
137 unsigned *glyphIndexArray;
138 } OTF_EncodingSubtable2;
145 unsigned idRangeOffset;
151 unsigned searchRange;
152 unsigned entrySelector;
154 OTF_cmapSegument *segments;
156 unsigned *glyphIdArray;
157 } OTF_EncodingSubtable4;
163 unsigned *glyphIdArray;
164 } OTF_EncodingSubtable6;
168 unsigned startCharCode;
169 unsigned endCharCode;
170 unsigned startGlyphID;
175 unsigned char is32[8192];
177 OTF_cmapGroup *Groups;
178 } OTF_EncodingSubtable8;
182 unsigned startCharCode;
185 } OTF_EncodingSubtable10;
190 OTF_cmapGroup *Groups;
191 } OTF_EncodingSubtable12;
199 OTF_EncodingSubtable0 *f0;
200 OTF_EncodingSubtable2 *f2;
201 OTF_EncodingSubtable4 *f4;
202 OTF_EncodingSubtable6 *f6;
203 OTF_EncodingSubtable8 *f8;
204 OTF_EncodingSubtable10 *f10;
205 OTF_EncodingSubtable12 *f12;
207 } OTF_EncodingSubtable;
214 OTF_EncodingSubtable subtable;
215 } OTF_EncodingRecord;
221 OTF_EncodingRecord *EncodingRecord;
222 unsigned short *unicode_table;
224 unsigned short *decode_table;
228 /*** (1-5) Structures common to GDEF, GSUB, GPOS */
234 unsigned StartCoverageIndex;
240 unsigned CoverageFormat;
243 OTF_GlyphID *GlyphArray;
244 OTF_RangeRecord *RangeRecord;
253 unsigned DeltaFormat;
262 } OTF_ClassRangeRecord;
267 unsigned ClassFormat;
270 OTF_GlyphID StartGlyph;
272 unsigned *ClassValueArray;
275 unsigned ClassRangeCount;
276 OTF_ClassRangeRecord *ClassRangeRecord;
282 /*** (1-6) "GDEF" table */
287 OTF_Offset GlyphClassDef;
288 OTF_Offset AttachList;
289 OTF_Offset LigCaretList;
290 OTF_Offset MarkAttachClassDef;
293 enum OTF_GlyphClassDef
296 OTF_GlyphClassBase = 1,
297 OTF_GlyphClassLigature = 2,
298 OTF_GlyphClassMark = 3,
299 OTF_GlyphClassComponent = 4
306 unsigned *PointIndex;
311 OTF_Coverage Coverage;
313 OTF_AttachPoint *AttachPoint;
319 unsigned CaretValueFormat; /* 1, 2, or 3 */
325 unsigned CaretValuePoint;
329 OTF_DeviceTable DeviceTable;
338 OTF_CaretValue *CaretValue;
343 OTF_Coverage Coverage;
344 unsigned LigGlyphCount;
345 OTF_LigGlyph *LigGlyph;
350 OTF_GDEFHeader header;
351 OTF_ClassDef glyph_class_def;
352 OTF_AttachList attach_list;
353 OTF_LigCaretList lig_caret_list;
354 OTF_ClassDef mark_attach_class_def;
358 /*** (1-7) Structures for ScriptList, FeatureList, and LookupList */
360 /*** The structure hierarchy
387 SubTable.gsub[] or SubTable.gpos[]
393 OTF_Offset LookupOrder;
394 unsigned ReqFeatureIndex;
395 unsigned FeatureCount;
396 unsigned *FeatureIndex;
409 OTF_Offset DefaultLangSysOffset;
410 OTF_LangSys DefaultLangSys;
411 unsigned LangSysCount;
412 OTF_LangSysRecord *LangSysRecord;
413 OTF_LangSys *LangSys;
419 unsigned ScriptCount;
427 OTF_Offset FeatureParams;
428 unsigned LookupCount;
429 unsigned *LookupListIndex;
435 unsigned FeatureCount;
436 OTF_Feature *Feature;
439 typedef struct OTF_LookupSubTableGSUB OTF_LookupSubTableGSUB;
440 typedef struct OTF_LookupSubTableGPOS OTF_LookupSubTableGPOS;
442 enum OTF_LookupFlagBit
444 OTF_RightToLeft = 0x0001,
445 OTF_IgnoreBaseGlyphs = 0x0002,
446 OTF_IgnoreLigatures = 0x0004,
447 OTF_IgnoreMarks = 0x8000,
448 OTF_Reserved = 0x00F0,
449 OTF_MarkAttachmentType = 0xFF00
457 unsigned SubTableCount;
458 OTF_Offset *SubTableOffset;
460 OTF_LookupSubTableGSUB *gsub;
461 OTF_LookupSubTableGPOS *gpos;
468 unsigned LookupCount;
473 /*** (1-8) Structures common to GSUB and GPOS */
475 /* For SubstLookupRecord (GSUB) and PosLookupRecord (GPOS). */
479 unsigned SequenceIndex;
480 unsigned LookupListIndex;
487 unsigned LookupCount;
488 OTF_GlyphID *Input; /* [<GlyphCount> - 1] */
489 OTF_LookupRecord *LookupRecord; /* [<LookupCount>] */
496 OTF_Rule *Rule; /* [<RuleCount>] */
503 unsigned LookupCount;
504 unsigned *Class; /* [<GlyphCount> - 1] */
505 OTF_LookupRecord *LookupRecord; /* [<LookupCount>] */
511 unsigned ClassRuleCnt;
512 OTF_ClassRule *ClassRule; /* [<ClassRuleCnt>] */
518 unsigned BacktrackGlyphCount;
519 OTF_GlyphID *Backtrack;
520 unsigned InputGlyphCount;
522 unsigned LookaheadGlyphCount;
523 OTF_GlyphID *LookAhead;
524 unsigned LookupCount;
525 OTF_LookupRecord *LookupRecord;
531 unsigned ChainRuleCount;
532 OTF_ChainRule *ChainRule;
538 unsigned BacktrackGlyphCount;
540 unsigned InputGlyphCount;
542 unsigned LookaheadGlyphCount;
544 unsigned LookupCount;
545 OTF_LookupRecord *LookupRecord;
546 } OTF_ChainClassRule;
551 unsigned ChainClassRuleCnt;
552 OTF_ChainClassRule *ChainClassRule;
556 /* Common to OTF_GSUB/GPOS_Context1/2/3. */
560 unsigned RuleSetCount;
561 OTF_RuleSet *RuleSet; /* [<RuleSetCount>] */
566 OTF_ClassDef ClassDef;
567 unsigned ClassSetCnt;
568 OTF_ClassSet *ClassSet; /* [<ClassSetCnt>] */
574 unsigned LookupCount;
575 OTF_Coverage *Coverage; /* [<GlyphCount>] */
576 OTF_LookupRecord *LookupRecord; /* [<LookupCount>] */
580 /* Common to OTF_GSUB/GPOS_ChainContext1/2/3. */
584 unsigned ChainRuleSetCount;
585 OTF_ChainRuleSet *ChainRuleSet;
590 OTF_ClassDef BacktrackClassDef;
591 OTF_ClassDef InputClassDef;
592 OTF_ClassDef LookaheadClassDef;
593 unsigned ChainClassSetCnt;
594 OTF_ChainClassSet *ChainClassSet;
599 unsigned BacktrackGlyphCount;
600 OTF_Coverage *Backtrack;
601 unsigned InputGlyphCount;
603 unsigned LookaheadGlyphCount;
604 OTF_Coverage *LookAhead;
605 unsigned LookupCount;
606 OTF_LookupRecord *LookupRecord;
609 /* Common to OTF_GSUB/GPOS. */
614 OTF_ScriptList ScriptList;
615 OTF_FeatureList FeatureList;
616 OTF_LookupList LookupList;
619 /*** (1-9) "GSUB" table */
629 OTF_GlyphID *Substitute;
632 typedef struct OTF_Sequence OTF_Sequence;
636 unsigned SequenceCount;
637 OTF_Sequence *Sequence;
638 } OTF_GSUB_Multiple1;
644 OTF_GlyphID *Substitute;
647 typedef struct OTF_AlternateSet OTF_AlternateSet;
651 unsigned AlternateSetCount;
652 OTF_AlternateSet *AlternateSet;
653 } OTF_GSUB_Alternate1;
655 struct OTF_AlternateSet
659 OTF_GlyphID *Alternate;
662 typedef struct OTF_LigatureSet OTF_LigatureSet;
663 typedef struct OTF_Ligature OTF_Ligature;
667 unsigned LigSetCount;
668 OTF_LigatureSet *LigatureSet;
669 } OTF_GSUB_Ligature1;
671 struct OTF_LigatureSet
674 unsigned LigatureCount;
675 OTF_Ligature *Ligature;
681 OTF_GlyphID LigGlyph;
683 OTF_GlyphID *Component;
686 typedef OTF_Context1 OTF_GSUB_Context1;
688 typedef OTF_Context2 OTF_GSUB_Context2;
690 typedef OTF_Context3 OTF_GSUB_Context3;
692 typedef OTF_ChainContext1 OTF_GSUB_ChainContext1;
694 typedef OTF_ChainContext2 OTF_GSUB_ChainContext2;
696 typedef OTF_ChainContext3 OTF_GSUB_ChainContext3;
700 unsigned ExtensionLookupType;
701 unsigned ExtensionOffset;
702 OTF_LookupSubTableGSUB *ExtensionSubtable;
703 } OTF_GSUB_Extension1;
707 unsigned BacktrackGlyphCount;
708 OTF_Coverage *Backtrack;
709 unsigned LookaheadGlyphCount;
710 OTF_Coverage *LookAhead;
712 OTF_GlyphID *Substitute;
713 } OTF_GSUB_ReverseChain1;
715 struct OTF_LookupSubTableGSUB
718 OTF_Coverage Coverage;
721 OTF_GSUB_Single1 single1;
722 OTF_GSUB_Single2 single2;
724 OTF_GSUB_Multiple1 multiple1;
726 OTF_GSUB_Alternate1 alternate1;
728 OTF_GSUB_Ligature1 ligature1;
730 OTF_GSUB_Context1 context1;
731 OTF_GSUB_Context2 context2;
732 OTF_GSUB_Context3 context3;
734 OTF_GSUB_ChainContext1 chain_context1;
735 OTF_GSUB_ChainContext2 chain_context2;
736 OTF_GSUB_ChainContext3 chain_context3;
738 OTF_GSUB_Extension1 extension1;
740 OTF_GSUB_ReverseChain1 reverse_chain1;
744 typedef OTF_GSUB_GPOS OTF_GSUB;
746 /*** (1-10) "GPOS" table */
750 OTF_XPlacement = 0x0001,
751 OTF_YPlacement = 0x0002,
752 OTF_XAdvance = 0x0004,
753 OTF_YAdvance = 0x0008,
754 OTF_XPlaDevice = 0x0010,
755 OTF_YPlaDevice = 0x0020,
756 OTF_XAdvDevice = 0x0040,
757 OTF_YAdvDevice = 0x0080
766 OTF_DeviceTable XPlaDevice;
767 OTF_DeviceTable YPlaDevice;
768 OTF_DeviceTable XAdvDevice;
769 OTF_DeviceTable YAdvDevice;
775 unsigned AnchorFormat;
780 unsigned AnchorPoint;
783 OTF_DeviceTable XDeviceTable;
784 OTF_DeviceTable YDeviceTable;
792 OTF_Anchor MarkAnchor;
799 OTF_MarkRecord *MarkRecord;
804 unsigned ValueFormat;
805 OTF_ValueRecord Value;
810 unsigned ValueFormat;
812 OTF_ValueRecord *Value; /* [<ValueCount>] */
817 OTF_GlyphID SecondGlyph;
818 OTF_ValueRecord Value1;
819 OTF_ValueRecord Value2;
820 } OTF_PairValueRecord;
825 unsigned PairValueCount;
826 OTF_PairValueRecord *PairValueRecord;
831 unsigned ValueFormat1;
832 unsigned ValueFormat2;
833 unsigned PairSetCount;
834 OTF_PairSet *PairSet;
839 OTF_ValueRecord Value1;
840 OTF_ValueRecord Value2;
845 OTF_Class2Record *Class2Record;
850 unsigned ValueFormat1;
851 unsigned ValueFormat2;
852 OTF_ClassDef ClassDef1;
853 OTF_ClassDef ClassDef2;
854 unsigned Class1Count;
855 unsigned Class2Count;
856 OTF_Class1Record *Class1Record; /* size: <Class1Count> */
861 OTF_Anchor EntryAnchor;
862 OTF_Anchor ExitAnchor;
863 } OTF_EntryExitRecord;
867 unsigned EntryExitCount;
868 OTF_EntryExitRecord *EntryExitRecord;
880 OTF_AnchorRecord *AnchorRecord;
885 OTF_Coverage BaseCoverage;
887 OTF_MarkArray MarkArray;
888 OTF_AnchorArray BaseArray;
889 } OTF_GPOS_MarkBase1;
893 OTF_Anchor *LigatureAnchor; /* [<ClassCount>] */
894 } OTF_ComponentRecord;
899 unsigned ComponentCount;
900 OTF_ComponentRecord *ComponentRecord; /* [<ComponentCount>] */
901 } OTF_LigatureAttach;
906 unsigned LigatureCount;
907 OTF_LigatureAttach *LigatureAttach; /* [<LiagureCount>] */
912 OTF_Coverage LigatureCoverage;
914 OTF_MarkArray MarkArray;
915 OTF_LigatureArray LigatureArray;
920 OTF_Coverage Mark2Coverage;
922 OTF_MarkArray Mark1Array;
923 OTF_AnchorArray Mark2Array;
924 } OTF_GPOS_MarkMark1;
926 typedef OTF_Context1 OTF_GPOS_Context1;
928 typedef OTF_Context2 OTF_GPOS_Context2;
930 typedef OTF_Context3 OTF_GPOS_Context3;
932 typedef OTF_ChainContext1 OTF_GPOS_ChainContext1;
934 typedef OTF_ChainContext2 OTF_GPOS_ChainContext2;
936 typedef OTF_ChainContext3 OTF_GPOS_ChainContext3;
940 unsigned ExtensionLookupType;
941 unsigned ExtensionOffset;
942 OTF_LookupSubTableGPOS *ExtensionSubtable;
943 } OTF_GPOS_Extension1;
946 struct OTF_LookupSubTableGPOS
949 OTF_Coverage Coverage;
952 OTF_GPOS_Single1 single1;
953 OTF_GPOS_Single2 single2;
955 OTF_GPOS_Pair1 pair1;
956 OTF_GPOS_Pair2 pair2;
958 OTF_GPOS_Cursive1 cursive1;
960 OTF_GPOS_MarkBase1 mark_base1;
962 OTF_GPOS_MarkLig1 mark_lig1;
964 OTF_GPOS_MarkMark1 mark_mark1;
966 OTF_GPOS_Context1 context1;
967 OTF_GPOS_Context2 context2;
968 OTF_GPOS_Context3 context3;
970 OTF_GPOS_ChainContext1 chain_context1;
971 OTF_GPOS_ChainContext2 chain_context2;
972 OTF_GPOS_ChainContext3 chain_context3;
974 OTF_GPOS_Extension1 extension1;
978 typedef OTF_GSUB_GPOS OTF_GPOS;
980 /*** (1-11) Structure for OTF */
984 OTF_Fixed sfnt_version;
986 unsigned searchRange;
987 unsigned enterSelector;
998 } OTF_TableDirectory;
1000 typedef struct OTF_InternalData OTF_InternalData;
1005 OTF_OffsetTable offset_table;
1006 OTF_TableDirectory *table_dirs;
1013 /* The following tables are not yet supported. */
1016 OTF_InternalData *internal_data;
1020 /*** (2) API for reading OTF */
1022 /*** (2-1) otf_open () */
1027 The OTF_open() function reads the OpenType font file whose name is
1028 $NAME, and return a pointer to the structure of type OTF.
1030 It setups these member of the structure OTF:
1031 filename, offset_table, table_dirs
1033 If the file can't be read or the file contains invalid data, NULL
1034 is returned, and the variable OTF_error is set to one of the
1041 See also OTF_get_table() and OTF_close(). */
1043 extern OTF *OTF_open (char *name);
1046 /*** (2-2) OTF_close () */
1051 The OTF_close() function closes the OpenType font $OTF which must
1052 be what the OTF_open() function returned.
1054 See also OTF_open(). */
1056 extern void OTF_close (OTF *otf);
1059 /*** (2-3) OTF_get_table () */
1062 Get OpenType font table
1064 The OTF_get_table() function setups one of the OTF table specified
1065 by $NAME in the OpenType font $OTF.
1067 $NAME must be one of "head", "name", "cmap", "GDEF", "GSUB", and
1068 "GPOS", and a member of the same name is setup.
1070 If the table is successfully setup, return 0. Otherwise, return
1071 -1, and set the variable OTF_error to OTF_ERROR_TABLE.
1073 See also OTF_open(). */
1075 extern int OTF_get_table (OTF *otf, char *name);
1077 /*** (2-4) OTF_check_table () */
1080 Check the existence of OpenType font table
1082 The OTF_check_table() function checks if the the OTF table
1083 specified by $NAME exists in OpenType font $OTF.
1085 If the table exists, return 0, else return -1.
1087 See also OTF_open(). */
1089 extern int OTF_check_table (OTF *otf, char *name);
1092 /*** (3) API for driving OTF */
1094 /*** (3-1) Structure for glyph string */
1097 The structure OTF_Glyph contains information about each glyph in
1098 the structure OTF_GlyphString. */
1102 /* Character code of the glyph. This is the only member that a
1103 client has to set before calling the function OTF_drive_XXX().
1104 The value less than 32 is treated as a place-holder character,
1105 and OTF_drive_XXX () function just ignore the glyph. */
1108 /* Glyph ID of the glyph. */
1109 OTF_GlyphID glyph_id;
1111 /* GlyphClass of the glyph. The value is extracted from the GDEF
1113 enum OTF_GlyphClassDef GlyphClass;
1115 /* MarkAttachClassDef of the glyph. The value is extracted from the
1117 unsigned MarkAttachClass;
1119 /* Positioning format type of the glyph. The value specifies how
1120 the glyph positioning information is encoded in the member <f>.
1121 If the value is N, the union member fN, is used. If the value is
1122 zero, the glyph has no positioning information, i.e. it should be
1123 drawn at the normal position. */
1124 int positioning_type;
1127 enum OTF_ValueFormat format;
1128 OTF_ValueRecord *value;
1131 enum OTF_ValueFormat format;
1132 OTF_ValueRecord *value;
1135 OTF_Anchor *entry_anchor;
1136 OTF_Anchor *exit_anchor;
1139 OTF_Anchor *mark_anchor;
1140 OTF_Anchor *base_anchor;
1143 OTF_Anchor *mark_anchor;
1144 OTF_Anchor *ligature_anchor;
1147 OTF_Anchor *mark1_anchor;
1148 OTF_Anchor *mark2_anchor;
1154 The structure OTF_GlyphString contains an array of glyphs (type
1155 OTF_Glyph). It is used as arguments of otf_drive_XXX(). */
1159 /* How many glyphs are allocated at the memory pointed by the member
1162 /* How many glyphs contains valid information. */
1164 /* Array of glyphs. It must be allocated by malloc(). The
1165 functions otf_drive_XXX() may reallocate it and increase the
1166 members <size> and <used>. */
1171 /*** (3-2) OTF_drive_cmap() */
1174 Process glyph string by cmap table.
1176 The OTF_drive_cmap() function looks up the cmap table of OpenType
1177 font $OTF, and setup the member <glyhph_id> of all glhphs in the
1178 glyph string $GSTRING. */
1180 extern int OTF_drive_cmap (OTF *otf, OTF_GlyphString *gstring);
1182 /*** (3-3) OTF_drive_gdef() */
1185 Process glyph string by GDEF table.
1187 The OTF_drive_gdef() function looks up the GDEF table of OpenType
1188 font $OTF, and setup members <GlyphClass> and <MarkAttachClass> of
1189 all glhphs in the glyph string $GSTRING. */
1191 extern int OTF_drive_gdef (OTF *otf, OTF_GlyphString *gstring);
1194 /*** (3-4) OTF_drive_gsub() */
1197 Process glyph string by GSUB table.
1199 The OTF_drive_gsub() function looks up the GSUB table of OpenType
1200 font $OTF, and by using features the font has for script $SCRIPT
1201 and language system $LANGSYS, update member <glyphs> of the glyph
1202 string $GSTRING. It may substitute, delete, insert glyphs in that
1203 array. $FEATURES is a list of features to apply. */
1205 extern int OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring,
1206 char *script, char *language, char *features);
1208 /*** (3-5) OTF_drive_gpos() */
1211 Process glyph string by GPOS table.
1213 The OTF_drive_gdef() function looks up the GPOS table of $OTF of
1214 OpenType font $OTF, and by using features the font has for script
1215 $SCRIPT and language system $LANGSYS, setup members
1216 <positioning_type> and <f> of all glhphs in the glyph string
1217 $GSTRING. $FEATURES is a list of features to apply. */
1219 extern int OTF_drive_gpos (OTF *otf, OTF_GlyphString *gstring,
1220 char *script, char *language, char *features);
1222 /*** (3-6) OTF_drive_tables() */
1225 Process glyph string by cmap, GDEF, GSUB, and GPOS tables.
1227 The OTF_drive_tables() function calls OTF_drive_cmap(),
1228 OTF_drive_gdef(), OTF_drive_gsub(), and OTF_drive_gpos() in this
1229 order, and update the glyphs string GSTRING. */
1231 extern int OTF_drive_tables (OTF *otf, OTF_GlyphString *gstring,
1232 char *script, char *language,
1233 char *gsub_features, char *gpos_features);
1236 /*** (3-7) OTF_get_unicode() */
1239 Return Unicode code point corresponding to the glyph-id CODE.
1242 extern int OTF_get_unicode (OTF *otf, OTF_GlyphID code);
1244 /*** (4) API for error handling ***/
1246 /*** (4-1) Error codes ***/
1249 Global variable holding an error code.
1251 The variable OTF_error is set to one of OTF_ERROR_XXX macros when
1252 an error is detected in the OTF library. */
1253 extern int OTF_error;
1256 Memory allocation error
1258 This error indicates that the library couldn't allocate
1260 #define OTF_ERROR_MEMORY 1
1265 This error indicates that the library fails in opening, reading,
1266 or seeking an OTF file. */
1267 #define OTF_ERROR_FILE 2
1270 Invalid table contents
1272 This error indicates that an OTF file contains invalid data. */
1273 #define OTF_ERROR_TABLE 3
1278 See the function otf_drive_cmap() for more detail. */
1279 #define OTF_ERROR_CMAP_DRIVE 4
1284 See the function OTF_drive_gdef() for more detail. */
1285 #define OTF_ERROR_GDEF_DRIVE 5
1290 See the function OTF_drive_gsub() for more detail. */
1291 #define OTF_ERROR_GSUB_DRIVE 6
1296 See the function OTF_drive_gpos() for more detail. */
1297 #define OTF_ERROR_GPOS_DRIVE 7
1300 /*** (4-2) OTF_perror() */
1303 Print an OTF error message
1305 The OTF_perror() function produces a message on the standard error
1306 output, describing the last error encountered during a call to the
1307 OTF library function. If $PREFIX is not NULL, is is printed
1308 first, followed by a colon and a blank. Then the message and a
1311 extern void OTF_perror (char *prefix);
1314 /*** (5) API miscellaneous ***/
1317 Return OTF tag of a specified name string.
1319 The OTF_tag() function returns OTF tag of name $NAME. If $NAME is
1320 NULL, return 0. Otherwise, $NAME must be at least 4-byte length.
1321 Only the first 4 characters are took into an account. */
1323 extern OTF_Tag OTF_tag (char *name);
1326 Convert OTF tag to name string.
1328 The OTF_tag_name() function converts OTF tag $TAG to a 5-byte name
1329 string (including the terminating NULL), and store it in $NAME.
1330 At least 5-byte space must be at $NAME. */
1332 extern void OTF_tag_name (OTF_Tag tag, char *name);
1335 #endif /* not _OTF_H_ */