1 /* otf.h -- Header file for libotf (OpenType font library).
3 Copyright (C) 2003, 2004
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H15PRO167
7 This file is part of libotf.
9 Libotf is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 Libotf is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library, in a file named COPYING; if not,
21 write to the Free Software Foundation, Inc., 59 Temple Place, Suite
22 330, 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 /* Mapping table: Unicode->GlyphID */
223 unsigned short *unicode_table;
225 /* Mapping table: GlyphID->Unicode */
226 unsigned short *decode_table;
230 /*** (1-5) Structures common to GDEF, GSUB, GPOS */
236 unsigned StartCoverageIndex;
242 unsigned CoverageFormat;
245 OTF_GlyphID *GlyphArray;
246 OTF_RangeRecord *RangeRecord;
255 unsigned DeltaFormat;
264 } OTF_ClassRangeRecord;
269 unsigned ClassFormat;
272 OTF_GlyphID StartGlyph;
274 unsigned *ClassValueArray;
277 unsigned ClassRangeCount;
278 OTF_ClassRangeRecord *ClassRangeRecord;
284 /*** (1-6) "GDEF" table */
289 OTF_Offset GlyphClassDef;
290 OTF_Offset AttachList;
291 OTF_Offset LigCaretList;
292 OTF_Offset MarkAttachClassDef;
295 enum OTF_GlyphClassDef
298 OTF_GlyphClassBase = 1,
299 OTF_GlyphClassLigature = 2,
300 OTF_GlyphClassMark = 3,
301 OTF_GlyphClassComponent = 4
308 unsigned *PointIndex;
313 OTF_Coverage Coverage;
315 OTF_AttachPoint *AttachPoint;
321 unsigned CaretValueFormat; /* 1, 2, or 3 */
327 unsigned CaretValuePoint;
331 OTF_DeviceTable DeviceTable;
340 OTF_CaretValue *CaretValue;
345 OTF_Coverage Coverage;
346 unsigned LigGlyphCount;
347 OTF_LigGlyph *LigGlyph;
352 OTF_GDEFHeader header;
353 OTF_ClassDef glyph_class_def;
354 OTF_AttachList attach_list;
355 OTF_LigCaretList lig_caret_list;
356 OTF_ClassDef mark_attach_class_def;
360 /*** (1-7) Structures for ScriptList, FeatureList, and LookupList */
362 /*** The structure hierarchy
389 SubTable.gsub[] or SubTable.gpos[]
395 OTF_Offset LookupOrder;
396 unsigned ReqFeatureIndex;
397 unsigned FeatureCount;
398 unsigned *FeatureIndex;
411 OTF_Offset DefaultLangSysOffset;
412 OTF_LangSys DefaultLangSys;
413 unsigned LangSysCount;
414 OTF_LangSysRecord *LangSysRecord;
415 OTF_LangSys *LangSys;
421 unsigned ScriptCount;
429 OTF_Offset FeatureParams;
430 unsigned LookupCount;
431 unsigned *LookupListIndex;
437 unsigned FeatureCount;
438 OTF_Feature *Feature;
441 typedef struct OTF_LookupSubTableGSUB OTF_LookupSubTableGSUB;
442 typedef struct OTF_LookupSubTableGPOS OTF_LookupSubTableGPOS;
444 enum OTF_LookupFlagBit
446 OTF_RightToLeft = 0x0001,
447 OTF_IgnoreBaseGlyphs = 0x0002,
448 OTF_IgnoreLigatures = 0x0004,
449 OTF_IgnoreMarks = 0x8000,
450 OTF_Reserved = 0x00F0,
451 OTF_MarkAttachmentType = 0xFF00
459 unsigned SubTableCount;
460 OTF_Offset *SubTableOffset;
462 OTF_LookupSubTableGSUB *gsub;
463 OTF_LookupSubTableGPOS *gpos;
470 unsigned LookupCount;
475 /*** (1-8) Structures common to GSUB and GPOS */
477 /* For SubstLookupRecord (GSUB) and PosLookupRecord (GPOS). */
481 unsigned SequenceIndex;
482 unsigned LookupListIndex;
489 unsigned LookupCount;
490 OTF_GlyphID *Input; /* [<GlyphCount> - 1] */
491 OTF_LookupRecord *LookupRecord; /* [<LookupCount>] */
498 OTF_Rule *Rule; /* [<RuleCount>] */
505 unsigned LookupCount;
506 unsigned *Class; /* [<GlyphCount> - 1] */
507 OTF_LookupRecord *LookupRecord; /* [<LookupCount>] */
513 unsigned ClassRuleCnt;
514 OTF_ClassRule *ClassRule; /* [<ClassRuleCnt>] */
520 unsigned BacktrackGlyphCount;
521 OTF_GlyphID *Backtrack;
522 unsigned InputGlyphCount;
524 unsigned LookaheadGlyphCount;
525 OTF_GlyphID *LookAhead;
526 unsigned LookupCount;
527 OTF_LookupRecord *LookupRecord;
533 unsigned ChainRuleCount;
534 OTF_ChainRule *ChainRule;
540 unsigned BacktrackGlyphCount;
542 unsigned InputGlyphCount;
544 unsigned LookaheadGlyphCount;
546 unsigned LookupCount;
547 OTF_LookupRecord *LookupRecord;
548 } OTF_ChainClassRule;
553 unsigned ChainClassRuleCnt;
554 OTF_ChainClassRule *ChainClassRule;
558 /* Common to OTF_GSUB/GPOS_Context1/2/3. */
562 unsigned RuleSetCount;
563 OTF_RuleSet *RuleSet; /* [<RuleSetCount>] */
568 OTF_ClassDef ClassDef;
569 unsigned ClassSetCnt;
570 OTF_ClassSet *ClassSet; /* [<ClassSetCnt>] */
576 unsigned LookupCount;
577 OTF_Coverage *Coverage; /* [<GlyphCount>] */
578 OTF_LookupRecord *LookupRecord; /* [<LookupCount>] */
582 /* Common to OTF_GSUB/GPOS_ChainContext1/2/3. */
586 unsigned ChainRuleSetCount;
587 OTF_ChainRuleSet *ChainRuleSet;
592 OTF_ClassDef BacktrackClassDef;
593 OTF_ClassDef InputClassDef;
594 OTF_ClassDef LookaheadClassDef;
595 unsigned ChainClassSetCnt;
596 OTF_ChainClassSet *ChainClassSet;
601 unsigned BacktrackGlyphCount;
602 OTF_Coverage *Backtrack;
603 unsigned InputGlyphCount;
605 unsigned LookaheadGlyphCount;
606 OTF_Coverage *LookAhead;
607 unsigned LookupCount;
608 OTF_LookupRecord *LookupRecord;
611 /* Common to OTF_GSUB/GPOS. */
616 OTF_ScriptList ScriptList;
617 OTF_FeatureList FeatureList;
618 OTF_LookupList LookupList;
621 /*** (1-9) "GSUB" table */
631 OTF_GlyphID *Substitute;
634 typedef struct OTF_Sequence OTF_Sequence;
638 unsigned SequenceCount;
639 OTF_Sequence *Sequence;
640 } OTF_GSUB_Multiple1;
646 OTF_GlyphID *Substitute;
649 typedef struct OTF_AlternateSet OTF_AlternateSet;
653 unsigned AlternateSetCount;
654 OTF_AlternateSet *AlternateSet;
655 } OTF_GSUB_Alternate1;
657 struct OTF_AlternateSet
661 OTF_GlyphID *Alternate;
664 typedef struct OTF_LigatureSet OTF_LigatureSet;
665 typedef struct OTF_Ligature OTF_Ligature;
669 unsigned LigSetCount;
670 OTF_LigatureSet *LigatureSet;
671 } OTF_GSUB_Ligature1;
673 struct OTF_LigatureSet
676 unsigned LigatureCount;
677 OTF_Ligature *Ligature;
683 OTF_GlyphID LigGlyph;
685 OTF_GlyphID *Component;
688 typedef OTF_Context1 OTF_GSUB_Context1;
690 typedef OTF_Context2 OTF_GSUB_Context2;
692 typedef OTF_Context3 OTF_GSUB_Context3;
694 typedef OTF_ChainContext1 OTF_GSUB_ChainContext1;
696 typedef OTF_ChainContext2 OTF_GSUB_ChainContext2;
698 typedef OTF_ChainContext3 OTF_GSUB_ChainContext3;
702 unsigned ExtensionLookupType;
703 unsigned ExtensionOffset;
704 OTF_LookupSubTableGSUB *ExtensionSubtable;
705 } OTF_GSUB_Extension1;
709 unsigned BacktrackGlyphCount;
710 OTF_Coverage *Backtrack;
711 unsigned LookaheadGlyphCount;
712 OTF_Coverage *LookAhead;
714 OTF_GlyphID *Substitute;
715 } OTF_GSUB_ReverseChain1;
717 struct OTF_LookupSubTableGSUB
720 OTF_Coverage Coverage;
723 OTF_GSUB_Single1 single1;
724 OTF_GSUB_Single2 single2;
726 OTF_GSUB_Multiple1 multiple1;
728 OTF_GSUB_Alternate1 alternate1;
730 OTF_GSUB_Ligature1 ligature1;
732 OTF_GSUB_Context1 context1;
733 OTF_GSUB_Context2 context2;
734 OTF_GSUB_Context3 context3;
736 OTF_GSUB_ChainContext1 chain_context1;
737 OTF_GSUB_ChainContext2 chain_context2;
738 OTF_GSUB_ChainContext3 chain_context3;
740 OTF_GSUB_Extension1 extension1;
742 OTF_GSUB_ReverseChain1 reverse_chain1;
746 typedef OTF_GSUB_GPOS OTF_GSUB;
748 /*** (1-10) "GPOS" table */
752 OTF_XPlacement = 0x0001,
753 OTF_YPlacement = 0x0002,
754 OTF_XAdvance = 0x0004,
755 OTF_YAdvance = 0x0008,
756 OTF_XPlaDevice = 0x0010,
757 OTF_YPlaDevice = 0x0020,
758 OTF_XAdvDevice = 0x0040,
759 OTF_YAdvDevice = 0x0080
768 OTF_DeviceTable XPlaDevice;
769 OTF_DeviceTable YPlaDevice;
770 OTF_DeviceTable XAdvDevice;
771 OTF_DeviceTable YAdvDevice;
777 unsigned AnchorFormat;
782 unsigned AnchorPoint;
785 OTF_DeviceTable XDeviceTable;
786 OTF_DeviceTable YDeviceTable;
794 OTF_Anchor MarkAnchor;
801 OTF_MarkRecord *MarkRecord;
806 unsigned ValueFormat;
807 OTF_ValueRecord Value;
812 unsigned ValueFormat;
814 OTF_ValueRecord *Value; /* [<ValueCount>] */
819 OTF_GlyphID SecondGlyph;
820 OTF_ValueRecord Value1;
821 OTF_ValueRecord Value2;
822 } OTF_PairValueRecord;
827 unsigned PairValueCount;
828 OTF_PairValueRecord *PairValueRecord;
833 unsigned ValueFormat1;
834 unsigned ValueFormat2;
835 unsigned PairSetCount;
836 OTF_PairSet *PairSet;
841 OTF_ValueRecord Value1;
842 OTF_ValueRecord Value2;
847 OTF_Class2Record *Class2Record;
852 unsigned ValueFormat1;
853 unsigned ValueFormat2;
854 OTF_ClassDef ClassDef1;
855 OTF_ClassDef ClassDef2;
856 unsigned Class1Count;
857 unsigned Class2Count;
858 OTF_Class1Record *Class1Record; /* size: <Class1Count> */
863 OTF_Anchor EntryAnchor;
864 OTF_Anchor ExitAnchor;
865 } OTF_EntryExitRecord;
869 unsigned EntryExitCount;
870 OTF_EntryExitRecord *EntryExitRecord;
882 OTF_AnchorRecord *AnchorRecord;
887 OTF_Coverage BaseCoverage;
889 OTF_MarkArray MarkArray;
890 OTF_AnchorArray BaseArray;
891 } OTF_GPOS_MarkBase1;
895 OTF_Anchor *LigatureAnchor; /* [<ClassCount>] */
896 } OTF_ComponentRecord;
901 unsigned ComponentCount;
902 OTF_ComponentRecord *ComponentRecord; /* [<ComponentCount>] */
903 } OTF_LigatureAttach;
908 unsigned LigatureCount;
909 OTF_LigatureAttach *LigatureAttach; /* [<LiagureCount>] */
914 OTF_Coverage LigatureCoverage;
916 OTF_MarkArray MarkArray;
917 OTF_LigatureArray LigatureArray;
922 OTF_Coverage Mark2Coverage;
924 OTF_MarkArray Mark1Array;
925 OTF_AnchorArray Mark2Array;
926 } OTF_GPOS_MarkMark1;
928 typedef OTF_Context1 OTF_GPOS_Context1;
930 typedef OTF_Context2 OTF_GPOS_Context2;
932 typedef OTF_Context3 OTF_GPOS_Context3;
934 typedef OTF_ChainContext1 OTF_GPOS_ChainContext1;
936 typedef OTF_ChainContext2 OTF_GPOS_ChainContext2;
938 typedef OTF_ChainContext3 OTF_GPOS_ChainContext3;
942 unsigned ExtensionLookupType;
943 unsigned ExtensionOffset;
944 OTF_LookupSubTableGPOS *ExtensionSubtable;
945 } OTF_GPOS_Extension1;
948 struct OTF_LookupSubTableGPOS
951 OTF_Coverage Coverage;
954 OTF_GPOS_Single1 single1;
955 OTF_GPOS_Single2 single2;
957 OTF_GPOS_Pair1 pair1;
958 OTF_GPOS_Pair2 pair2;
960 OTF_GPOS_Cursive1 cursive1;
962 OTF_GPOS_MarkBase1 mark_base1;
964 OTF_GPOS_MarkLig1 mark_lig1;
966 OTF_GPOS_MarkMark1 mark_mark1;
968 OTF_GPOS_Context1 context1;
969 OTF_GPOS_Context2 context2;
970 OTF_GPOS_Context3 context3;
972 OTF_GPOS_ChainContext1 chain_context1;
973 OTF_GPOS_ChainContext2 chain_context2;
974 OTF_GPOS_ChainContext3 chain_context3;
976 OTF_GPOS_Extension1 extension1;
980 typedef OTF_GSUB_GPOS OTF_GPOS;
982 /*** (1-11) Structure for OTF */
986 OTF_Fixed sfnt_version;
988 unsigned searchRange;
989 unsigned enterSelector;
1000 } OTF_TableDirectory;
1002 typedef struct OTF_InternalData OTF_InternalData;
1007 OTF_OffsetTable offset_table;
1008 OTF_TableDirectory *table_dirs;
1015 /* The following tables are not yet supported. */
1018 OTF_InternalData *internal_data;
1022 /*** (2) API for reading OTF */
1024 /*** (2-1) otf_open () */
1029 The OTF_open() function reads the OpenType font file whose name is
1030 $NAME, and return a pointer to the structure of type OTF.
1032 It setups these member of the structure OTF:
1033 filename, offset_table, table_dirs
1035 If the file can't be read or the file contains invalid data, NULL
1036 is returned, and the variable OTF_error is set to one of the
1043 See also OTF_get_table() and OTF_close(). */
1045 extern OTF *OTF_open (char *name);
1048 /*** (2-2) OTF_close () */
1053 The OTF_close() function closes the OpenType font $OTF which must
1054 be what the OTF_open() function returned.
1056 See also OTF_open(). */
1058 extern void OTF_close (OTF *otf);
1061 /*** (2-3) OTF_get_table () */
1064 Get OpenType font table
1066 The OTF_get_table() function setups one of the OTF table specified
1067 by $NAME in the OpenType font $OTF.
1069 $NAME must be one of "head", "name", "cmap", "GDEF", "GSUB", and
1070 "GPOS", and a member of the same name is setup.
1072 If the table is successfully setup, return 0. Otherwise, return
1073 -1, and set the variable OTF_error to OTF_ERROR_TABLE.
1075 See also OTF_open(). */
1077 extern int OTF_get_table (OTF *otf, char *name);
1079 /*** (2-4) OTF_check_table () */
1082 Check the existence of OpenType font table
1084 The OTF_check_table() function checks if the the OTF table
1085 specified by $NAME exists in OpenType font $OTF.
1087 If the table exists, return 0, else return -1.
1089 See also OTF_open(). */
1091 extern int OTF_check_table (OTF *otf, char *name);
1094 /*** (3) API for driving OTF */
1096 /*** (3-1) Structure for glyph string */
1099 The structure OTF_Glyph contains information about each glyph in
1100 the structure OTF_GlyphString. */
1104 /** The first two members must be set by a clinet before calling the
1105 function OTF_drive_XXX(). **/
1107 /* Character code of the glyph. The value less than 32 is treated
1108 as a place-holder in a glyph string, and OTF_drive_XXX ()
1109 function just ignore the glyph as if it doesn't exist. */
1112 /* Glyph ID of the glyph. If the value is 0, the library gets a
1113 correct value from the above character code via cmap. */
1114 OTF_GlyphID glyph_id;
1116 /* GlyphClass of the glyph. The value is extracted from the GDEF
1118 enum OTF_GlyphClassDef GlyphClass;
1120 /* MarkAttachClassDef of the glyph. The value is extracted from the
1122 unsigned MarkAttachClass;
1124 /* Positioning format type of the glyph. The value specifies how
1125 the glyph positioning information is encoded in the member <f>.
1126 If the value is N, the union member fN, is used. If the value is
1127 zero, the glyph has no positioning information, i.e. it should be
1128 drawn at the normal position. */
1129 int positioning_type;
1132 enum OTF_ValueFormat format;
1133 OTF_ValueRecord *value;
1136 enum OTF_ValueFormat format;
1137 OTF_ValueRecord *value;
1140 OTF_Anchor *entry_anchor;
1141 OTF_Anchor *exit_anchor;
1144 OTF_Anchor *mark_anchor;
1145 OTF_Anchor *base_anchor;
1148 OTF_Anchor *mark_anchor;
1149 OTF_Anchor *ligature_anchor;
1152 OTF_Anchor *mark1_anchor;
1153 OTF_Anchor *mark2_anchor;
1159 The structure OTF_GlyphString contains an array of glyphs (type
1160 OTF_Glyph). It is used as arguments of otf_drive_XXX(). */
1164 /* How many glyphs are allocated at the memory pointed by the member
1167 /* How many glyphs contains valid information. */
1169 /* Array of glyphs. It must be allocated by malloc(). The
1170 functions otf_drive_XXX() may reallocate it and increase the
1171 members <size> and <used>. */
1176 /*** (3-2) OTF_drive_cmap() */
1179 Process glyph string by cmap table.
1181 The OTF_drive_cmap() function looks up the cmap table of OpenType
1182 font $OTF, and setup the member <glyhph_id> of all glhphs in the
1183 glyph string $GSTRING if the value of the member is not zero. */
1185 extern int OTF_drive_cmap (OTF *otf, OTF_GlyphString *gstring);
1187 /*** (3-3) OTF_drive_gdef() */
1190 Process glyph string by GDEF table.
1192 The OTF_drive_gdef() function looks up the GDEF table of OpenType
1193 font $OTF, and setup members <GlyphClass> and <MarkAttachClass> of
1194 all glhphs in the glyph string $GSTRING. */
1196 extern int OTF_drive_gdef (OTF *otf, OTF_GlyphString *gstring);
1199 /*** (3-4) OTF_drive_gsub() */
1202 Process glyph string by GSUB table.
1204 The OTF_drive_gsub() function looks up the GSUB table of OpenType
1205 font $OTF, and by using features the font has for script $SCRIPT
1206 and language system $LANGSYS, update member <glyphs> of the glyph
1207 string $GSTRING. It may substitute, delete, insert glyphs in that
1208 array. $FEATURES is a list of features to apply. */
1210 extern int OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring,
1211 char *script, char *language, char *features);
1213 /*** (3-5) OTF_drive_gpos() */
1216 Process glyph string by GPOS table.
1218 The OTF_drive_gdef() function looks up the GPOS table of $OTF of
1219 OpenType font $OTF, and by using features the font has for script
1220 $SCRIPT and language system $LANGSYS, setup members
1221 <positioning_type> and <f> of all glhphs in the glyph string
1222 $GSTRING. $FEATURES is a list of features to apply. */
1224 extern int OTF_drive_gpos (OTF *otf, OTF_GlyphString *gstring,
1225 char *script, char *language, char *features);
1227 /*** (3-6) OTF_drive_tables() */
1230 Process glyph string by cmap, GDEF, GSUB, and GPOS tables.
1232 The OTF_drive_tables() function calls OTF_drive_cmap(),
1233 OTF_drive_gdef(), OTF_drive_gsub(), and OTF_drive_gpos() in this
1234 order, and update the glyphs string GSTRING. */
1236 extern int OTF_drive_tables (OTF *otf, OTF_GlyphString *gstring,
1237 char *script, char *language,
1238 char *gsub_features, char *gpos_features);
1241 /*** (3-7) OTF_get_unicode() */
1244 Return Unicode code point corresponding to the glyph-id CODE.
1247 extern int OTF_get_unicode (OTF *otf, OTF_GlyphID code);
1249 /*** (4) API for error handling ***/
1251 /*** (4-1) Error codes ***/
1254 Global variable holding an error code.
1256 The variable OTF_error is set to one of OTF_ERROR_XXX macros when
1257 an error is detected in the OTF library. */
1258 extern int OTF_error;
1261 Memory allocation error
1263 This error indicates that the library couldn't allocate
1265 #define OTF_ERROR_MEMORY 1
1270 This error indicates that the library fails in opening, reading,
1271 or seeking an OTF file. */
1272 #define OTF_ERROR_FILE 2
1275 Invalid table contents
1277 This error indicates that an OTF file contains invalid data. */
1278 #define OTF_ERROR_TABLE 3
1283 See the function otf_drive_cmap() for more detail. */
1284 #define OTF_ERROR_CMAP_DRIVE 4
1289 See the function OTF_drive_gdef() for more detail. */
1290 #define OTF_ERROR_GDEF_DRIVE 5
1295 See the function OTF_drive_gsub() for more detail. */
1296 #define OTF_ERROR_GSUB_DRIVE 6
1301 See the function OTF_drive_gpos() for more detail. */
1302 #define OTF_ERROR_GPOS_DRIVE 7
1305 /*** (4-2) OTF_perror() */
1308 Print an OTF error message
1310 The OTF_perror() function produces a message on the standard error
1311 output, describing the last error encountered during a call to the
1312 OTF library function. If $PREFIX is not NULL, is is printed
1313 first, followed by a colon and a blank. Then the message and a
1316 extern void OTF_perror (char *prefix);
1319 /*** (5) API miscellaneous ***/
1322 Return OTF tag of a specified name string.
1324 The OTF_tag() function returns OTF tag of name $NAME. If $NAME is
1325 NULL, return 0. Otherwise, $NAME must be at least 4-byte length.
1326 Only the first 4 characters are took into an account. */
1328 extern OTF_Tag OTF_tag (char *name);
1331 Convert OTF tag to name string.
1333 The OTF_tag_name() function converts OTF tag $TAG to a 5-byte name
1334 string (including the terminating NULL), and store it in $NAME.
1335 At least 5-byte space must be at $NAME. */
1337 extern void OTF_tag_name (OTF_Tag tag, char *name);
1340 #endif /* not _OTF_H_ */