contrib/OWB: add correct SDL dependency, fix compilers used
[AROS-Contrib.git] / freetype1 / lib / ttcmap.h
blob8a1f834d9c6696d977dc59119e964c407e8138e3
1 /*******************************************************************
3 * ttcmap.h 1.0
5 * TrueType Character Mappings
7 * Copyright 1996-1999 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
10 * This file is part of the FreeType project, and may only be used
11 * modified and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
17 ******************************************************************/
19 #ifndef TTCMAP_H
20 #define TTCMAP_H
22 #include "ttconfig.h"
23 #include "tttypes.h"
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
30 /* format 0 */
32 struct TCMap0_
34 PByte glyphIdArray;
37 typedef struct TCMap0_ TCMap0;
38 typedef TCMap0* PCMap0;
41 /* format 2 */
43 struct TCMap2SubHeader_
45 UShort firstCode; /* first valid low byte */
46 UShort entryCount; /* number of valid low bytes */
47 Short idDelta; /* delta value to glyphIndex */
48 UShort idRangeOffset; /* offset from here to 1st code */
51 typedef struct TCMap2SubHeader_ TCMap2SubHeader;
52 typedef TCMap2SubHeader* PCMap2SubHeader;
54 struct TCMap2_
56 PUShort subHeaderKeys;
57 /* high byte mapping table */
58 /* value = subHeader index * 8 */
60 PCMap2SubHeader subHeaders;
61 PUShort glyphIdArray;
62 UShort numGlyphId; /* control value */
65 typedef struct TCMap2_ TCMap2;
66 typedef TCMap2* PCMap2;
69 /* format 4 */
71 struct TCMap4Segment_
73 UShort endCount;
74 UShort startCount;
75 Short idDelta; /* in the specs defined as UShort but the
76 example there gives negative values... */
77 UShort idRangeOffset;
80 typedef struct TCMap4Segment_ TCMap4Segment;
81 typedef TCMap4Segment* PCMap4Segment;
83 struct TCMap4_
85 UShort segCountX2; /* number of segments * 2 */
86 UShort searchRange; /* these parameters can be used */
87 UShort entrySelector; /* for a binary search */
88 UShort rangeShift;
90 PCMap4Segment segments;
91 PUShort glyphIdArray;
92 UShort numGlyphId; /* control value */
95 typedef struct TCMap4_ TCMap4;
96 typedef TCMap4* PCMap4;
99 /* format 6 */
101 struct TCMap6_
103 UShort firstCode; /* first character code of subrange */
104 UShort entryCount; /* number of character codes in subrange */
106 PUShort glyphIdArray;
109 typedef struct TCMap6_ TCMap6;
110 typedef TCMap6* PCMap6;
113 /* charmap table */
115 struct TCMapTable_
117 UShort platformID;
118 UShort platformEncodingID;
119 UShort format;
120 UShort length;
121 UShort version;
123 Bool loaded;
124 ULong offset;
126 union
128 TCMap0 cmap0;
129 TCMap2 cmap2;
130 TCMap4 cmap4;
131 TCMap6 cmap6;
132 } c;
135 typedef struct TCMapTable_ TCMapTable;
136 typedef TCMapTable* PCMapTable;
140 /* Load character mappings directory when face is loaded. */
141 /* The mappings themselves are only loaded on demand. */
143 LOCAL_DEF
144 TT_Error CharMap_Load( PCMapTable table,
145 TT_Stream input );
148 /* Destroy one character mapping table */
150 LOCAL_DEF
151 TT_Error CharMap_Free( PCMapTable table );
154 /* Use character mapping table to perform mapping */
156 LOCAL_DEF
157 UShort CharMap_Index( PCMapTable cmap,
158 UShort charCode );
160 /* NOTE: The PFace type isn't defined at this point */
162 #ifdef __cplusplus
164 #endif
166 #endif /* TTCMAP_H */
169 /* END */