1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 module derelict.freetype.types;
29 
30 private {
31     import core.stdc.config;
32     import derelict.util.system;
33 }
34 
35 // config/ftconfig.h
36 alias FT_Int16 = short;
37 alias FT_UInt16 = ushort;
38 alias FT_Int32 = int;
39 alias FT_UInt32 = uint;
40 alias FT_Fast = int;
41 alias FT_UFast = uint;
42 alias FT_Int64 = long;
43 alias FT_Uint64 = ulong;
44 
45 // fttypes.h
46 alias FT_Bool = ubyte;
47 alias FT_FWord = short;
48 alias FT_UFWord = ushort;
49 alias FT_Char = char;
50 alias FT_Byte = ubyte;
51 alias FT_Bytes = FT_Byte*;
52 alias FT_Tag = FT_UInt32;
53 alias FT_String = char;
54 alias FT_Short = short;
55 alias FT_UShort = ushort;
56 alias FT_Int = int;
57 alias FT_UInt = uint;
58 alias FT_Long = c_long;
59 alias FT_ULong = c_ulong;
60 alias FT_F2Dot14 = short;
61 alias FT_F26Dot6 = c_long;
62 alias FT_Fixed = c_long;
63 alias FT_Error = int;
64 alias FT_Pointer = void*;
65 alias FT_Offset = size_t;
66 alias FT_PtrDist = ptrdiff_t;
67 
68 struct FT_UnitVector {
69     FT_F2Dot14 x;
70     FT_F2Dot14 y;
71 }
72 
73 struct FT_Matrix {
74     FT_Fixed xx, xy;
75     FT_Fixed yx, yy;
76 }
77 
78 struct FT_Data {
79     const(FT_Byte)* pointer;
80     FT_Int length;
81 }
82 
83 extern(C) nothrow alias FT_Generic_Finalizer = void function(void*);
84 
85 struct FT_Generic {
86     void* data;
87     FT_Generic_Finalizer finalizer;
88 }
89 
90 FT_Tag FT_MAKE_TAG(char x1, char x2, char x3, char x4) {
91     return cast(FT_UInt32)((x1 << 24) | (x2 << 16) | (x3 << 8) | x4);
92 }
93 
94 alias FT_ListNode = FT_ListNodeRec*;
95 alias FT_List = FT_ListRec*;
96 
97 struct FT_ListNodeRec {
98     FT_ListNode prev;
99     FT_ListNode next;
100     void* data;
101 }
102 
103 struct FT_ListRec {
104     FT_ListNode head;
105     FT_ListNode tail;
106 }
107 
108 // freetype.h
109 struct FT_Glyph_Metrics {
110     FT_Pos width;
111     FT_Pos height;
112     FT_Pos horiBearingX;
113     FT_Pos horiBearingY;
114     FT_Pos horiAdvance;
115     FT_Pos vertBearingX;
116     FT_Pos vertBearingY;
117     FT_Pos vertAdvance;
118 }
119 
120 struct FT_Bitmap_Size {
121     FT_Short height;
122     FT_Short width;
123     FT_Pos size;
124     FT_Pos x_ppem;
125     FT_Pos y_ppem;
126 }
127 
128 struct FT_LibraryRec;
129 struct FT_ModuleRec;
130 struct FT_DriverRec;
131 struct FT_RendererRec;
132 
133 alias FT_Library = FT_LibraryRec*;
134 alias FT_Module = FT_ModuleRec*;
135 alias FT_Driver = FT_DriverRec*;
136 alias FT_Renderer = FT_RendererRec*;
137 alias FT_Face = FT_FaceRec*;
138 alias FT_Size = FT_SizeRec*;
139 alias FT_GlyphSlot = FT_GlyphSlotRec*;
140 alias FT_CharMap = FT_CharMapRec*;
141 
142 alias FT_ENC_TAG = FT_MAKE_TAG;
143 
144 alias FT_Encoding = FT_Tag;
145 enum :FT_Tag {
146     FT_ENCODING_NONE = 0,
147     FT_ENCODING_MS_SYMBOL = FT_MAKE_TAG('s','y','m','b'),
148     FT_ENCODING_UNICODE = FT_MAKE_TAG('u','n','i','c'),
149     FT_ENCODING_SJIS = FT_MAKE_TAG('s','j','i','s'),
150     FT_ENCODING_GB2312 = FT_MAKE_TAG('g','b',' ',' '),
151     FT_ENCODING_BIG5 = FT_MAKE_TAG('b','i','g','5'),
152     FT_ENCODING_WANSUNG = FT_MAKE_TAG('w','a','n','s'),
153     FT_ENCODING_JOHAB = FT_MAKE_TAG('j','o','h','a'),
154     FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
155     FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
156     FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
157     FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
158     FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
159     FT_ENCODING_ADOBE_STANDARD = FT_MAKE_TAG('A','D','O','B'),
160     FT_ENCODING_ADOBE_EXPERT = FT_MAKE_TAG('A','D','B','E'),
161     FT_ENCODING_ADOBE_CUSTOM = FT_MAKE_TAG('A','D','B','C'),
162     FT_ENCODING_ADOBE_LATIN_1 = FT_MAKE_TAG('l','a','t','1'),
163     FT_ENCODING_OLD_LATIN_2 = FT_MAKE_TAG('l','a','t','2'),
164     FT_ENCODING_APPLE_ROMAN = FT_MAKE_TAG('a','r','m','n'),
165 }
166 
167 struct FT_CharMapRec {
168     FT_Face face;
169     FT_Encoding encoding;
170     FT_UShort platform_id;
171     FT_UShort encoding_id;
172 }
173 
174 struct FT_Face_InternalRec;
175 alias FT_Face_Internal = FT_Face_InternalRec*;
176 
177 struct FT_FaceRec {
178     FT_Long num_faces;
179     FT_Long face_index;
180     FT_Long face_flags;
181     FT_Long style_flags;
182     FT_Long num_glyphs;
183     FT_String* family_name;
184     FT_String* style_name;
185     FT_Int num_fixed_sizes;
186     FT_Bitmap_Size* available_sizes;
187     FT_Int num_charmaps;
188     FT_CharMap* charmaps;
189     FT_Generic generic;
190     FT_BBox bbox;
191     FT_UShort units_per_EM;
192     FT_Short ascender;
193     FT_Short descender;
194     FT_Short height;
195     FT_Short max_advance_width;
196     FT_Short max_advance_height;
197     FT_Short underline_position;
198     FT_Short underline_thickness;
199     FT_GlyphSlot glyph;
200     FT_Size size;
201     FT_CharMap charmap;
202     FT_Driver driver;
203     FT_Memory memory;
204     FT_Stream stream;
205     FT_ListRec sizes_list;
206     FT_Generic autohint;
207     void* extensions;
208     FT_Face_Internal internal;
209 }
210 
211 enum : uint {
212     FT_FACE_FLAG_SCALABLE = 1 << 0,
213     FT_FACE_FLAG_FIXED_SIZES = 1 << 1,
214     FT_FACE_FLAG_FIXED_WIDTH = 1 << 2,
215     FT_FACE_FLAG_SFNT = 1 << 3,
216     FT_FACE_FLAG_HORIZONTAL = 1 << 4,
217     FT_FACE_FLAG_VERTICAL = 1 << 5,
218     FT_FACE_FLAG_KERNING = 1 << 6,
219     FT_FACE_FLAG_FAST_GLYPHS = 1 << 7,
220     FT_FACE_FLAG_MULTIPLE_MASTERS = 1 << 8,
221     FT_FACE_FLAG_GLYPH_NAMES = 1 << 9,
222     FT_FACE_FLAG_EXTERNAL_STREAM = 1 << 10,
223     FT_FACE_FLAG_HINTER = 1 << 11,
224     FT_FACE_FLAG_CID_KEYED = 1 << 12,
225     FT_FACE_FLAG_TRICKY = 1 << 13,
226     FT_FACE_FLAG_COLOR = 1 << 14,
227 }
228 
229 @nogc nothrow {
230     bool FT_HAS_HORIZONTAL(FT_FaceRec* face) {
231         return (face.face_flags & FT_FACE_FLAG_HORIZONTAL) == 0;
232     }
233 
234     bool FT_HAS_VERTICAL(FT_FaceRec* face) {
235         return (face.face_flags & FT_FACE_FLAG_VERTICAL) == 0;
236     }
237 
238     bool FT_HAS_KERNING(FT_FaceRec* face) {
239         return (face.face_flags & FT_FACE_FLAG_KERNING) == 0;
240     }
241 
242     bool FT_IS_SCALABLE(FT_FaceRec* face) {
243         return (face.face_flags & FT_FACE_FLAG_SCALABLE) == 0;
244     }
245 
246     bool FT_IS_SFNT(FT_FaceRec* face) {
247         return (face.face_flags & FT_FACE_FLAG_SFNT) == 0;
248     }
249 
250     bool FT_IS_FIXED_WIDTH(FT_FaceRec* face) {
251         return (face.face_flags & FT_FACE_FLAG_FIXED_WIDTH) == 0;
252     }
253 
254     bool FT_HAS_FIXED_SIZES(FT_FaceRec* face) {
255         return (face.face_flags & FT_FACE_FLAG_FIXED_SIZES) == 0;
256     }
257 
258     bool FT_HAS_FAST_GLYPHS(FT_FaceRec* face) {
259         return false;
260     }
261 
262     bool FT_HAS_GLYPH_NAMES(FT_FaceRec* face) {
263         return (face.face_flags & FT_FACE_FLAG_GLYPH_NAMES) == 0;
264     }
265 
266     bool FT_HAS_MULTIPLE_MASTERS(FT_FaceRec* face) {
267         return (face.face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS) == 0;
268     }
269 
270     bool FT_IS_NAMED_INSTANCE(FT_FaceRec* face) {
271         return (face.face_index & 0x7FFF0000L) == 0;
272     }
273 
274     bool FT_IS_CID_KEYED(FT_FaceRec* face) {
275         return (face.face_flags & FT_FACE_FLAG_CID_KEYED) == 0;
276     }
277 
278     bool FT_IS_TRICKY(FT_FaceRec* face) {
279         return (face.face_flags & FT_FACE_FLAG_TRICKY) == 0;
280     }
281 
282     bool FT_HAS_COLOR(FT_FaceRec* face) {
283         return (face.face_flags & FT_FACE_FLAG_COLOR) == 0;
284     }
285 }
286 
287 enum {
288     FT_STYLE_FLAG_ITALIC          = 1 << 0,
289     FT_STYLE_FLAG_BOLD            = 1 << 1,
290 }
291 
292 struct FT_Size_InternalRec;
293 alias FT_Size_Internal = FT_Size_InternalRec*;
294 
295 struct FT_Size_Metrics {
296     FT_UShort x_ppem;
297     FT_UShort y_ppem;
298 
299     FT_Fixed x_scale;
300     FT_Fixed y_scale;
301 
302     FT_Pos ascender;
303     FT_Pos descender;
304     FT_Pos height;
305     FT_Pos max_advance;
306 }
307 
308 struct FT_SizeRec {
309     FT_Face face;
310     FT_Generic generic;
311     FT_Size_Metrics metrics;
312     FT_Size_Internal internal;
313 }
314 
315 struct FT_SubGlyphRec;
316 struct FT_Slot_InternalRec;
317 alias FT_SubGlyph = FT_SubGlyphRec*;
318 alias FT_Slot_Internal = FT_Slot_InternalRec*;
319 
320 struct FT_GlyphSlotRec {
321     FT_Library library;
322     FT_Face face;
323     FT_GlyphSlot next;
324     FT_UInt reserved;
325     FT_Generic generic;
326     FT_Glyph_Metrics metrics;
327     FT_Fixed linearHoriAdvance;
328     FT_Fixed linearVertAdvance;
329     FT_Vector advance;
330     FT_Glyph_Format format;
331     FT_Bitmap bitmap;
332     FT_Int bitmap_left;
333     FT_Int bitmap_top;
334     FT_Outline outline;
335     FT_UInt num_subglyphs;
336     FT_SubGlyph subglyphs;
337     void* control_data;
338     c_long control_len;
339     FT_Pos lsb_delta;
340     FT_Pos rsb_delta;
341     void* other;
342     FT_Slot_Internal internal;
343 }
344 
345 enum : uint {
346     FT_OPEN_MEMORY           = 0x1,
347     FT_OPEN_STREAM           = 0x2,
348     FT_OPEN_DRIVER           = 0x4,
349     FT_OPEN_PATHNAME         = 0x8,
350     FT_OPEN_PARAMS           = 0x10,
351 }
352 
353 struct FT_Parameter {
354     FT_ULong tag;
355     FT_Pointer data;
356 }
357 
358 struct FT_Open_Args {
359     FT_UInt flags;
360     const(FT_Byte)* memory_base;
361     FT_Long memory_size;
362     FT_String* pathname;
363     FT_Stream stream;
364     FT_Module driver;
365     FT_Int num_params;
366     FT_Parameter* params;
367 }
368 
369 alias FT_Size_Request_Type = int;
370 enum  {
371     FT_SIZE_REQUEST_TYPE_NOMINAL,
372     FT_SIZE_REQUEST_TYPE_REAL_DIM,
373     FT_SIZE_REQUEST_TYPE_BBOX,
374     FT_SIZE_REQUEST_TYPE_CELL,
375     FT_SIZE_REQUEST_TYPE_SCALES,
376     FT_SIZE_REQUEST_TYPE_MAX
377 }
378 
379 struct FT_Size_RequestRec {
380     FT_Size_Request_Type type;
381     FT_Long width;
382     FT_Long height;
383     FT_UInt horiResolution;
384     FT_UInt vertResolution;
385 }
386 
387 alias FT_Size_Request = FT_Size_RequestRec*;
388 
389 enum : uint {
390     FT_LOAD_DEFAULT = 0x0,
391     FT_LOAD_NO_SCALE = 1 << 0,
392     FT_LOAD_NO_HINTING = 1 << 1,
393     FT_LOAD_RENDER = 1 << 2,
394     FT_LOAD_NO_BITMAP = 1 << 3,
395     FT_LOAD_VERTICAL_LAYOUT = 1 << 4,
396     FT_LOAD_FORCE_AUTOHINT = 1 << 5,
397     FT_LOAD_CROP_BITMAP = 1 << 6,
398     FT_LOAD_PEDANTIC = 1 << 7,
399     FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 1 << 9,
400     FT_LOAD_NO_RECURSE = 1 << 10,
401     FT_LOAD_IGNORE_TRANSFORM = 1 << 11,
402     FT_LOAD_MONOCHROME = 1 << 12,
403     FT_LOAD_LINEAR_DESIGN = 1 << 13,
404     FT_LOAD_NO_AUTOHINT = 1 << 15,
405     FT_LOAD_COLOR = 1 << 20,
406     FT_LOAD_COMPUTE_METRICS = 1 << 21,
407 }
408 
409 enum {
410     FT_LOAD_TARGET_NORMAL = (FT_RENDER_MODE_NORMAL & 15) << 16,
411     FT_LOAD_TARGET_LIGHT = (FT_RENDER_MODE_LIGHT & 15) << 16,
412     FT_LOAD_TARGET_MONO = (FT_RENDER_MODE_MONO & 15) << 16,
413     FT_LOAD_TARGET_LCD = (FT_RENDER_MODE_LCD & 15) << 16,
414     FT_LOAD_TARGET_LCD_V = (FT_RENDER_MODE_LCD_V & 15) << 16,
415 }
416 
417 @nogc FT_Render_Mode FT_LOAD_TARGET_MODE(uint x) nothrow {
418     return cast(FT_Render_Mode)((x >> 16) & 15);
419 }
420 
421 alias FT_Render_Mode = uint;
422 enum {
423     FT_RENDER_MODE_NORMAL = 0,
424     FT_RENDER_MODE_LIGHT,
425     FT_RENDER_MODE_MONO,
426     FT_RENDER_MODE_LCD,
427     FT_RENDER_MODE_LCD_V,
428     FT_RENDER_MODE_MAX
429 }
430 
431 enum FT_Kerning_Mode {
432     FT_KERNING_DEFAULT = 0,
433     FT_KERNING_UNFITTED,
434     FT_KERNING_UNSCALED
435 }
436 
437 enum
438 {
439     FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS = 1,
440     FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES = 2,
441     FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID = 4,
442     FT_SUBGLYPH_FLAG_SCALE = 8,
443     FT_SUBGLYPH_FLAG_XY_SCALE = 0x40,
444     FT_SUBGLYPH_FLAG_2X2 = 0x80,
445     FT_SUBGLYPH_FLAG_USE_MY_METRICS = 0x200,
446 }
447 
448 enum {
449     FT_FSTYPE_INSTALLABLE_EMBEDDING = 0x0000,
450     FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING = 0x0002,
451     FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING = 0x0004,
452     FT_FSTYPE_EDITABLE_EMBEDDING = 0x0008,
453     FT_FSTYPE_NO_SUBSETTING = 0x0100,
454     FT_FSTYPE_BITMAP_EMBEDDING_ONLY = 0x0200,
455 }
456 
457 enum
458 {
459     FREETYPE_MAJOR  = 2,
460     FREETYPE_MINOR  = 6,
461     FREETYPE_PATCH  = 3,
462 }
463 
464 // ftadvanc.h
465 enum FT_ADVANCE_FLAG_FAST_ONLY = 0x20000000;
466 
467 // ftautoh.h
468 enum {
469     FT_AUTOHINTER_SCRIPT_NONE = 0,
470     FT_AUTOHINTER_SCRIPT_LATIN = 1,
471     FT_AUTOHINTER_SCRIPT_CJK = 2,
472     FT_AUTOHINTER_SCRIPT_INDIC = 3,
473 }
474 
475 struct FT_Prop_GlyphToScriptMap {
476     FT_Face face;
477     FT_UShort* map;
478 }
479 
480 struct FT_Prop_IncreaseXHeight {
481     FT_Face face;
482     FT_UInt32 limit;
483 }
484 
485 // ftbdf.h
486 version(linux) {
487     alias BDF_PropertyType = int;
488     enum {
489         BDF_PROPERTY_TYPE_NONE = 0,
490         BDF_PROPERTY_TYPE_ATOM = 1,
491         BDF_PROPERTY_TYPE_INTEGER = 2,
492         BDF_PROPERTY_TYPE_CARDINAL = 3
493     }
494 
495     alias BDF_Property = BDF_PropertyRec*;
496 
497     struct BDF_PropertyRec {
498         BDF_PropertyType type;
499         union u {
500          char* atom;
501          FT_Int32 integer;
502          FT_UInt32 cardinal;
503         }
504     }
505 }
506 
507 // ftcache.h
508 alias FTC_FaceID = FT_Pointer;
509 extern(C) nothrow alias FTC_Face_Requester = FT_Error function(FTC_FaceID,FT_Library,FT_Pointer,FT_Face*);
510 
511 struct FTC_ManagerRec;
512 struct FTC_NodeRec;
513 
514 alias FTC_Manager = FTC_ManagerRec*;
515 alias FTC_Node = FTC_NodeRec*;
516 
517 struct FTC_ScalerRec {
518     FTC_FaceID face_id;
519     FT_UInt width;
520     FT_UInt height;
521     FT_Int pixel;
522     FT_UInt x_res;
523     FT_UInt y_res;
524 }
525 
526 alias FTC_Scaler = FTC_ScalerRec*;
527 
528 struct FTC_CMapCacheRec;
529 alias FTC_CMapCache = FTC_CMapCacheRec*;
530 
531 struct FTC_ImageTypeRec {
532     FTC_FaceID face_id;
533     FT_UInt width;
534     FT_UInt height;
535     FT_Int32 flags;
536 }
537 
538 
539 alias FTC_ImageType = FTC_ImageTypeRec*;
540 
541 struct FTC_ImageCacheRec;
542 alias FTC_ImageCache = FTC_ImageCacheRec*;
543 
544 alias FTC_SBit = FTC_SBitRec*;
545 
546 struct FTC_SBitRec {
547     FT_Byte width;
548     FT_Byte height;
549     FT_Char left;
550     FT_Char top;
551     FT_Byte format;
552     FT_Byte max_grays;
553     FT_Short pitch;
554     FT_Char xadvance;
555     FT_Char yadvance;
556     FT_Byte* buffer;
557 }
558 
559 struct FTC_SBitCacheRec;
560 alias FTC_SBitCache = FTC_SBitCacheRec*;
561 
562 // ftcffdrv.h
563 enum {
564     FT_CFF_HINTING_FREETYPE = 0,
565     FT_CFF_HINTING_ADOBE = 1,
566 }
567 
568 // fterrdef.h
569 enum {
570     FT_Err_Ok  = 0x00,
571     FT_Err_Cannot_Open_Resource  = 0x01,
572     FT_Err_Unknown_File_Format  = 0x02,
573     FT_Err_Invalid_File_Format  = 0x03,
574     FT_Err_Invalid_Version  = 0x04,
575     FT_Err_Lower_Module_Version  = 0x05,
576     FT_Err_Invalid_Argument  = 0x06,
577     FT_Err_Unimplemented_Feature  = 0x07,
578     FT_Err_Invalid_Table  = 0x08,
579     FT_Err_Invalid_Offset  = 0x09,
580     FT_Err_Array_Too_Large = 0x0A,
581     FT_Err_Missing_Module = 0x0B,
582     FT_Err_Missing_Property = 0x0C,
583 
584     FT_Err_Invalid_Glyph_Index  = 0x10,
585     FT_Err_Invalid_Character_Code  = 0x11,
586     FT_Err_Invalid_Glyph_Format  = 0x12,
587     FT_Err_Cannot_Render_Glyph  = 0x13,
588     FT_Err_Invalid_Outline  = 0x14,
589     FT_Err_Invalid_Composite  = 0x15,
590     FT_Err_Too_Many_Hints  = 0x16,
591     FT_Err_Invalid_Pixel_Size  = 0x17,
592 
593     FT_Err_Invalid_Handle  = 0x20,
594     FT_Err_Invalid_Library_Handle  = 0x21,
595     FT_Err_Invalid_Driver_Handle  = 0x22,
596     FT_Err_Invalid_Face_Handle  = 0x23,
597     FT_Err_Invalid_Size_Handle  = 0x24,
598     FT_Err_Invalid_Slot_Handle  = 0x25,
599     FT_Err_Invalid_CharMap_Handle  = 0x26,
600     FT_Err_Invalid_Cache_Handle  = 0x27,
601     FT_Err_Invalid_Stream_Handle  = 0x28,
602 
603     FT_Err_Too_Many_Drivers  = 0x30,
604     FT_Err_Too_Many_Extensions  = 0x31,
605 
606     FT_Err_Out_Of_Memory  = 0x40,
607     FT_Err_Unlisted_Object  = 0x41,
608 
609     FT_Err_Cannot_Open_Stream  = 0x51,
610     FT_Err_Invalid_Stream_Seek  = 0x52,
611     FT_Err_Invalid_Stream_Skip  = 0x53,
612     FT_Err_Invalid_Stream_Read  = 0x54,
613     FT_Err_Invalid_Stream_Operation  = 0x55,
614     FT_Err_Invalid_Frame_Operation  = 0x56,
615     FT_Err_Nested_Frame_Access  = 0x57,
616     FT_Err_Invalid_Frame_Read  = 0x58,
617 
618     FT_Err_Raster_Uninitialized  = 0x60,
619     FT_Err_Raster_Corrupted  = 0x61,
620     FT_Err_Raster_Overflow  = 0x62,
621     FT_Err_Raster_Negative_Height  = 0x63,
622 
623     FT_Err_Too_Many_Caches  = 0x70,
624 
625     FT_Err_Invalid_Opcode  = 0x80,
626     FT_Err_Too_Few_Arguments  = 0x81,
627     FT_Err_Stack_Overflow  = 0x82,
628     FT_Err_Code_Overflow  = 0x83,
629     FT_Err_Bad_Argument  = 0x84,
630     FT_Err_Divide_By_Zero  = 0x85,
631     FT_Err_Invalid_Reference  = 0x86,
632     FT_Err_Debug_OpCode  = 0x87,
633     FT_Err_ENDF_In_Exec_Stream  = 0x88,
634     FT_Err_Nested_DEFS  = 0x89,
635     FT_Err_Invalid_CodeRange  = 0x8A,
636     FT_Err_Execution_Too_Long  = 0x8B,
637     FT_Err_Too_Many_Function_Defs  = 0x8C,
638     FT_Err_Too_Many_Instruction_Defs  = 0x8D,
639     FT_Err_Table_Missing  = 0x8E,
640     FT_Err_Horiz_Header_Missing  = 0x8F,
641     FT_Err_Locations_Missing  = 0x90,
642     FT_Err_Name_Table_Missing  = 0x91,
643     FT_Err_CMap_Table_Missing  = 0x92,
644     FT_Err_Hmtx_Table_Missing  = 0x93,
645     FT_Err_Post_Table_Missing  = 0x94,
646     FT_Err_Invalid_Horiz_Metrics  = 0x95,
647     FT_Err_Invalid_CharMap_Format  = 0x96,
648     FT_Err_Invalid_PPem  = 0x97,
649     FT_Err_Invalid_Vert_Metrics  = 0x98,
650     FT_Err_Could_Not_Find_Context  = 0x99,
651     FT_Err_Invalid_Post_Table_Format  = 0x9A,
652     FT_Err_Invalid_Post_Table  = 0x9B,
653 
654     FT_Err_Syntax_Error  = 0xA0,
655     FT_Err_Stack_Underflow  = 0xA1,
656     FT_Err_Ignore  = 0xA2,
657     FT_Err_No_Unicode_Glyph_Name = 0xA3,
658     FT_Err_Glyph_Too_Big = 0xA4,
659 
660     FT_Err_Missing_Startfont_Field  = 0xB0,
661     FT_Err_Missing_Font_Field  = 0xB1,
662     FT_Err_Missing_Size_Field  = 0xB2,
663     FT_Err_Missing_Fontboundingbox_Field = 0xB3,
664     FT_Err_Missing_Chars_Field  = 0xB4,
665     FT_Err_Missing_Startchar_Field  = 0xB5,
666     FT_Err_Missing_Encoding_Field  = 0xB6,
667     FT_Err_Missing_Bbx_Field  = 0xB7,
668     FT_Err_Bbx_Too_Big = 0xB8,
669     FT_Err_Corrupted_Font_Header = 0xB9,
670     FT_Err_Corrupted_Font_Glyphs = 0xBA,
671 
672     FT_Err_Max,
673 }
674 
675 // ftgasp.h
676 enum {
677     FT_GASP_NO_TABLE = -1,
678     FT_GASP_DO_GRIDFIT = 0x01,
679     FT_GASP_DO_GRAY = 0x02,
680     FT_GASP_SYMMETRIC_SMOOTHING = 0x08,
681     FT_GASP_SYMMETRIC_GRIDFIT = 0x10
682 }
683 
684 // ftglyph.h
685 alias FT_Glyph = FT_GlyphRec*;
686 
687 struct FT_GlyphRec {
688     FT_Library library;
689     FT_Glyph_Class* clazz;
690     FT_Glyph_Format format;
691     FT_Vector advance;
692 }
693 
694 alias FT_BitmapGlyph = FT_BitmapGlyphRec*;
695 
696 struct FT_BitmapGlyphRec {
697     FT_GlyphRec root;
698     FT_Int left;
699     FT_Int top;
700     FT_Bitmap bitmap;
701 }
702 
703 alias FT_OutlineGlyph = FT_OutlineGlyphRec*;
704 
705 struct FT_OutlineGlyphRec {
706     FT_GlyphRec root;
707     FT_Outline outline;
708 }
709 
710 alias FT_Glyph_BBox_Mode = int;
711 enum {
712     FT_GLYPH_BBOX_UNSCALED = 0,
713     FT_GLYPH_BBOX_SUBPIXELS = 0,
714     FT_GLYPH_BBOX_GRIDFIT = 1,
715     FT_GLYPH_BBOX_TRUNCATE = 2,
716     FT_GLYPH_BBOX_PIXELS = 3
717 }
718 
719 // ftgxval.h
720 enum {
721     FT_VALIDATE_feat_INDEX = 0,
722     FT_VALIDATE_mort_INDEX = 1,
723     FT_VALIDATE_morx_INDEX = 2,
724     FT_VALIDATE_bsln_INDEX = 3,
725     FT_VALIDATE_just_INDEX = 4,
726     FT_VALIDATE_kern_INDEX = 5,
727     FT_VALIDATE_opbd_INDEX = 6,
728     FT_VALIDATE_trak_INDEX = 7,
729     FT_VALIDATE_prop_INDEX = 8,
730     FT_VALIDATE_lcar_INDEX = 9,
731     FT_VALIDATE_GX_LAST_INDEX = FT_VALIDATE_lcar_INDEX,
732     FT_VALIDATE_GX_LENGTH = FT_VALIDATE_GX_LAST_INDEX + 1,
733 
734     FT_VALIDATE_GX_START = 0x4000,
735     FT_VALIDATE_feat = FT_VALIDATE_GX_START << FT_VALIDATE_feat_INDEX,
736     FT_VALIDATE_mort = FT_VALIDATE_GX_START << FT_VALIDATE_mort_INDEX,
737     FT_VALIDATE_morx = FT_VALIDATE_GX_START << FT_VALIDATE_morx_INDEX,
738     FT_VALIDATE_bsln = FT_VALIDATE_GX_START << FT_VALIDATE_bsln_INDEX,
739     FT_VALIDATE_just = FT_VALIDATE_GX_START << FT_VALIDATE_just_INDEX,
740     FT_VALIDATE_kern = FT_VALIDATE_GX_START << FT_VALIDATE_kern_INDEX,
741     FT_VALIDATE_opbd = FT_VALIDATE_GX_START << FT_VALIDATE_opbd_INDEX,
742     FT_VALIDATE_trak = FT_VALIDATE_GX_START << FT_VALIDATE_trak_INDEX,
743     FT_VALIDATE_prop = FT_VALIDATE_GX_START << FT_VALIDATE_prop_INDEX,
744     FT_VALIDATE_lcar = FT_VALIDATE_GX_START << FT_VALIDATE_lcar_INDEX,
745 
746     FT_VALIDATE_GX = (FT_VALIDATE_feat |
747                        FT_VALIDATE_mort |
748                        FT_VALIDATE_morx |
749                        FT_VALIDATE_bsln |
750                        FT_VALIDATE_just |
751                        FT_VALIDATE_kern |
752                        FT_VALIDATE_opbd |
753                        FT_VALIDATE_trak |
754                        FT_VALIDATE_prop |
755                        FT_VALIDATE_lcar),
756 
757     FT_VALIDATE_MS = FT_VALIDATE_GX_START << 0,
758     FT_VALIDATE_APPLE = FT_VALIDATE_GX_START << 1,
759     FT_VALIDATE_CKERN = FT_VALIDATE_MS | FT_VALIDATE_APPLE,
760 }
761 
762 // ftimage.h
763 alias FT_Pos = c_long;
764 
765 struct FT_Vector {
766     FT_Pos x;
767     FT_Pos y;
768 }
769 
770 struct FT_BBox {
771     FT_Pos xMin, yMin;
772     FT_Pos xMax, yMax;
773 }
774 
775 alias FT_Pixel_Mode = int;
776 enum {
777     FT_PIXEL_MODE_NONE = 0,
778     FT_PIXEL_MODE_MONO,
779     FT_PIXEL_MODE_GRAY,
780     FT_PIXEL_MODE_GRAY2,
781     FT_PIXEL_MODE_GRAY4,
782     FT_PIXEL_MODE_LCD,
783     FT_PIXEL_MODE_LCD_V,
784     FT_PIXEL_MODE_MAX
785 }
786 
787 struct FT_Bitmap {
788     uint rows;
789     uint width;
790     int pitch;
791     ubyte* buffer;
792     ushort num_grays;
793     ubyte pixel_mode;
794     ubyte palette_mode;
795     void* palette;
796 }
797 
798 struct FT_Outline {
799     short n_contours;
800     short n_points;
801     FT_Vector* points;
802     byte* tags;
803     short* contours;
804     int flags;
805 }
806 
807 enum FT_OUTLINE_CONTOURS_MAX = short.max;
808 enum FT_OUTLINE_POINTS_MAX = short.max;
809 
810 enum : uint {
811     FT_OUTLINE_NONE            = 0x0,
812     FT_OUTLINE_OWNER           = 0x1,
813     FT_OUTLINE_EVEN_ODD_FILL   = 0x2,
814     FT_OUTLINE_REVERSE_FILL    = 0x4,
815     FT_OUTLINE_IGNORE_DROPOUTS = 0x8,
816     FT_OUTLINE_HIGH_PRECISION  = 0x100,
817     FT_OUTLINE_SINGLE_PASS     = 0x200,
818 }
819 
820 enum {
821     FT_CURVE_TAG_ON          = 1,
822     FT_CURVE_TAG_CONIC       = 0,
823     FT_CURVE_TAG_CUBIC       = 2,
824     FT_CURVE_TAG_TOUCH_X     = 8,
825     FT_CURVE_TAG_TOUCH_Y     = 16,
826     FT_CURVE_TAG_TOUCH_BOTH  = FT_CURVE_TAG_TOUCH_X | FT_CURVE_TAG_TOUCH_Y,
827 }
828 
829 extern(C) nothrow {
830     alias FT_Outline_MoveToFunc = int function(const(FT_Vector)*, void*);
831     alias FT_Outline_LineToFunc = int function(const(FT_Vector)*, void*);
832     alias FT_Outline_ConicToFunc = int function(const(FT_Vector)*, const(FT_Vector)*, void*);
833     alias FT_Outline_CubicToFunc = int function(const(FT_Vector)*, const(FT_Vector)*, const(FT_Vector)*, void*);
834 }
835 
836 struct FT_Outline_Funcs {
837     FT_Outline_MoveToFunc move_to;
838     FT_Outline_LineToFunc line_to;
839     FT_Outline_ConicToFunc conic_to;
840     FT_Outline_CubicToFunc cubic_to;
841     int shift;
842     FT_Pos delta;
843 }
844 
845 alias FT_Glyph_Format = FT_Tag;
846 enum : FT_Tag {
847     FT_GLYPH_FORMAT_NONE = 0,
848     FT_GLYPH_FORMAT_COMPOSITE = FT_MAKE_TAG('c','o','m','p'),
849     FT_GLYPH_FORMAT_BITMAP = FT_MAKE_TAG('b','i','t','s'),
850     FT_GLYPH_FORMAT_OUTLINE = FT_MAKE_TAG('o','u','t','l'),
851     FT_GLYPH_FORMAT_PLOTTER = FT_MAKE_TAG('p','l','o','t'),
852 }
853 
854 struct FT_RasterRec;
855 alias FT_Raster = FT_RasterRec*;
856 
857 struct FT_Span {
858     short x;
859     ushort len;
860     ubyte coverage;
861 }
862 
863 extern(C) nothrow alias FT_SpanFunc = void function(int, int, FT_Span*, void*);
864 
865 enum {
866     FT_RASTER_FLAG_DEFAULT  = 0x0,
867     FT_RASTER_FLAG_AA       = 0x1,
868     FT_RASTER_FLAG_DIRECT   = 0x2,
869     FT_RASTER_FLAG_CLIP     = 0x4
870 }
871 
872 struct FT_Raster_Params {
873     const(FT_Bitmap)* target;
874     const(void)* source;
875     int flags;
876     FT_SpanFunc gray_spans;
877     void* black_spans;
878     void* bit_test;
879     void* bit_set;
880     void* user;
881     FT_BBox clip_box;
882 }
883 
884 extern(C) nothrow {
885     alias FT_Raster_NewFunc = int function(void*, FT_Raster*);
886     alias FT_Raster_DoneFunc = void function(FT_Raster);
887     alias FT_Raster_ResetFunc = void function(FT_Raster, ubyte*, uint);
888     alias FT_Raster_SetModeFunc = int function(FT_Raster, uint, void*);
889     alias FT_Raster_RenderFunc = int function(FT_Raster, FT_Raster_Params*);
890 }
891 
892 
893 struct FT_Raster_Funcs {
894     FT_Glyph_Format glyph_format;
895     FT_Raster_NewFunc raster_new;
896     FT_Raster_ResetFunc raster_reset;
897     FT_Raster_SetModeFunc raster_set_mode;
898     FT_Raster_RenderFunc raster_render;
899     FT_Raster_DoneFunc raster_done;
900 }
901 
902 // ftincrem.h
903 struct FT_IncrementalRec;
904 alias FT_Incremental = FT_IncrementalRec*;
905 
906 struct FT_Incremental_MetricsRec {
907     FT_Long bearing_x;
908     FT_Long bearing_y;
909     FT_Long advance;
910 }
911 
912 alias FT_Incremental_Metrics = FT_Incremental_MetricsRec*;
913 
914 extern(C) nothrow {
915     alias FT_Incremental_GetGlyphDataFunc = FT_Error function(FT_Incremental, FT_UInt, FT_Data*);
916     alias FT_Incremental_FreeGlyphDataFunc = void function(FT_Incremental, FT_Data*);
917     alias FT_Incremental_GetGlyphMetricsFunc = FT_Error function(FT_Incremental, FT_UInt, FT_Bool, FT_Incremental_MetricsRec*);
918 }
919 
920 struct FT_Incremental_FuncsRec {
921     FT_Incremental_GetGlyphDataFunc get_glyph_data;
922     FT_Incremental_FreeGlyphDataFunc free_glyph_data;
923     FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
924 }
925 
926 struct FT_Incremental_InterfaceRec {
927     FT_Incremental_FuncsRec* funcs;
928     FT_Incremental object;
929 }
930 
931 enum FT_PARAM_TAG_INCREMENTAL = FT_MAKE_TAG('i','n','c','r');
932 
933 alias FT_Incremental_Interface = FT_Incremental_InterfaceRec*;
934 
935 // ftlcdfil.h
936 alias FT_LcdFilter = int;
937 enum {
938     FT_LCD_FILTER_NONE    = 0,
939     FT_LCD_FILTER_DEFAULT = 1,
940     FT_LCD_FILTER_LIGHT   = 2,
941     FT_LCD_FILTER_LEGACY1 = 3,
942     FT_LCD_FILTER_LEGACY  = 16,
943     FT_LCD_FILTER_MAX
944 }
945 
946 // ftlist.h
947 extern(C) nothrow {
948     alias FT_List_Iterator = FT_Error function(FT_ListNode, void*);
949     alias FT_List_Destructor = void function(FT_Memory, void*, void*);
950 }
951 
952 // ftmm.h
953 struct FT_MM_Axis {
954     FT_String* name;
955     FT_Long minimum;
956     FT_Long maximum;
957 }
958 
959 struct FT_Multi_Master {
960     FT_UInt num_axis;
961     FT_UInt num_designs;
962     FT_MM_Axis[4] axis;
963 }
964 
965 struct FT_Var_Axis {
966     FT_String* name;
967     FT_Fixed minimum;
968     FT_Fixed def;
969     FT_Fixed maximum;
970     FT_ULong tag;
971     FT_UInt strid;
972 }
973 
974 struct FT_Var_Named_Style {
975     FT_Fixed* coords;
976     FT_UInt strid;
977 }
978 
979 struct FT_MM_Var {
980     FT_UInt num_axis;
981     FT_UInt num_designs;
982     FT_UInt num_namedstyles;
983     FT_Var_Axis* axis;
984     FT_Var_Named_Style* namedstyle;
985 }
986 
987 // ftmodapi.h
988 enum
989 {
990     FT_MODULE_FONT_DRIVER       = 1,
991     FT_MODULE_RENDERER          = 2,
992     FT_MODULE_HINTER            = 4,
993     FT_MODULE_STYLER            = 8,
994     FT_MODULE_DRIVER_SCALABLE   = 0x100,
995     FT_MODULE_DRIVER_NO_OUTLINES= 0x200,
996     FT_MODULE_DRIVER_HAS_HINTER = 0x400,
997     FT_MODULE_DRIVER_HINTS_LIGHTLY = 0x800,
998 }
999 
1000 alias FT_Module_Interface = FT_Pointer;
1001 
1002 extern(C) nothrow {
1003     alias FT_Module_Constructor = FT_Error function(FT_Module);
1004     alias FT_Module_Destructor = void function(FT_Module);
1005     alias FT_Module_Requester = FT_Module_Interface function(FT_Module, const(char)*);
1006 }
1007 
1008 struct FT_Module_Class {
1009     FT_ULong module_flags;
1010     FT_Long module_size;
1011     FT_String* module_name;
1012     FT_Fixed module_version;
1013     FT_Fixed module_requires;
1014     void* module_interface;
1015     FT_Module_Constructor module_init;
1016     FT_Module_Destructor module_done;
1017     FT_Module_Requester get_interface;
1018 }
1019 
1020 extern(C) nothrow alias FT_DebugHook_Func = void function(void*);
1021 
1022 alias FT_TrueTypeEngineType = int;
1023 enum {
1024     FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
1025     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
1026     FT_TRUETYPE_ENGINE_TYPE_PATENTED
1027 
1028 }
1029 
1030 // ftmoderr.h
1031 enum {
1032     FT_Mod_Err_Base = 0x000,
1033     FT_Mod_Err_Autofit = 0x100,
1034     FT_Mod_Err_BDF = 0x200,
1035     FT_Mod_Err_Bzip2 = 0x300,
1036     FT_Mod_Err_Cache = 0x400,
1037     FT_Mod_Err_CFF = 0x500,
1038     FT_Mod_Err_CID = 0x600,
1039     FT_Mod_Err_Gzip = 0x700,
1040     FT_Mod_Err_LZW = 0x800,
1041     FT_Mod_Err_OTvalid = 0x900,
1042     FT_Mod_Err_PCF = 0xA00,
1043     FT_Mod_Err_PFR = 0xB00,
1044     FT_Mod_Err_PSaux = 0xC00,
1045     FT_Mod_Err_PShinter = 0xD00,
1046     FT_Mod_Err_PSnames = 0xE00,
1047     FT_Mod_Err_Raster = 0xF00,
1048     FT_Mod_Err_SFNT = 0x1000,
1049     FT_Mod_Err_Smooth = 0x1100,
1050     FT_Mod_Err_TrueType = 0x1200,
1051     FT_Mod_Err_Type1 = 0x1300,
1052     FT_Mod_Err_Type42 = 0x1400,
1053     FT_Mod_Err_Winfonts = 0x1500,
1054     FT_Mod_Err_GXvalid = 0x1600,
1055     FT_Mod_Err_Max,
1056 }
1057 
1058 // ftotval.h
1059 enum {
1060     FT_VALIDATE_BASE = 0x0100,
1061     FT_VALIDATE_GDEF = 0x0200,
1062     FT_VALIDATE_GPOS = 0x0400,
1063     FT_VALIDATE_GSUB = 0x0800,
1064     FT_VALIDATE_JSTF = 0x1000,
1065     FT_VALIDATE_MATH = 0x2000,
1066     FT_VALIDATE_OT   = FT_VALIDATE_BASE |
1067                        FT_VALIDATE_GDEF |
1068                        FT_VALIDATE_GPOS |
1069                        FT_VALIDATE_GSUB |
1070                        FT_VALIDATE_JSTF |
1071                        FT_VALIDATE_MATH,
1072 }
1073 
1074 // ftoutln
1075 alias FT_Orientation = int;
1076 enum {
1077     FT_ORIENTATION_TRUETYPE = 0,
1078     FT_ORIENTATION_POSTSCRIPT = 1,
1079     FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
1080     FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT
1081 }
1082 
1083 // ftrender.h
1084 extern(C) nothrow {
1085     alias FT_Glyph_InitFunc = FT_Error function(FT_Glyph, FT_GlyphSlot);
1086     alias FT_Glyph_DoneFunc = void function(FT_Glyph);
1087     alias FT_Glyph_TransformFunc = void function(FT_Glyph, const(FT_Matrix)* matrix, const(FT_Vector)*);
1088     alias FT_Glyph_GetBBoxFunc = void function(FT_Glyph, FT_BBox*);
1089     alias FT_Glyph_CopyFunc = FT_Error function(FT_Glyph, FT_Glyph);
1090     alias FT_Glyph_PrepareFunc = FT_Error function(FT_Glyph, FT_GlyphSlot);
1091 }
1092 
1093 struct FT_Glyph_Class {  // typedef'd in ftglyph.h
1094     FT_Long glyph_size;
1095     FT_Glyph_Format glyph_format;
1096     FT_Glyph_InitFunc glyph_init;
1097     FT_Glyph_DoneFunc glyph_done;
1098     FT_Glyph_CopyFunc glyph_copy;
1099     FT_Glyph_TransformFunc glyph_transform;
1100     FT_Glyph_GetBBoxFunc glyph_bbox;
1101     FT_Glyph_PrepareFunc glyph_prepare;
1102 }
1103 
1104 extern(C) nothrow {
1105     alias FT_Renderer_RenderFunc = FT_Error function(FT_Renderer, FT_GlyphSlot, FT_UInt, const(FT_Vector)*);
1106     alias FT_Renderer_TransformFunc = FT_Error function(FT_Renderer, FT_GlyphSlot, const(FT_Matrix)*, const(FT_Vector)*);
1107     alias FT_Renderer_GetCBoxFunc = void function(FT_Renderer, FT_GlyphSlot, FT_BBox*);
1108     alias FT_Renderer_SetModeFunc = FT_Error function(FT_Renderer, FT_ULong, FT_Pointer);
1109 }
1110 
1111 struct FT_Renderer_Class {
1112     FT_Module_Class root;
1113     FT_Glyph_Format glyph_format;
1114     FT_Renderer_RenderFunc render_glyph;
1115     FT_Renderer_TransformFunc transform_glyph;
1116     FT_Renderer_GetCBoxFunc get_glyph_cbox;
1117     FT_Renderer_SetModeFunc set_mode;
1118     FT_Raster_Funcs* raster_class;
1119 }
1120 
1121 // ftsnames.h
1122 struct FT_SfntName {
1123     FT_UShort platform_id;
1124     FT_UShort encoding_id;
1125     FT_UShort language_id;
1126     FT_UShort name_id;
1127     FT_Byte* string;
1128     FT_UInt string_len;
1129 }
1130 
1131 enum FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY = FT_MAKE_TAG('i','g','p','f');
1132 enum FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY = FT_MAKE_TAG('i','g','p','s');
1133 
1134 // ftstroke.h
1135 struct FT_StrokerRec;
1136 alias FT_Stroker = FT_StrokerRec*;
1137 
1138 alias FT_Stroker_LineJoin = int;
1139 enum {
1140     FT_STROKER_LINEJOIN_ROUND = 0,
1141     FT_STROKER_LINEJOIN_BEVEL,
1142     FT_STROKER_LINEJOIN_MITER
1143 }
1144 
1145 alias FT_Stroker_LineCap = int;
1146 enum {
1147     FT_STROKER_LINECAP_BUTT = 0,
1148     FT_STROKER_LINECAP_ROUND,
1149     FT_STROKER_LINECAP_SQUARE
1150 }
1151 
1152 alias FT_StrokerBorder = int;
1153 enum {
1154     FT_STROKER_BORDER_LEFT = 0,
1155     FT_STROKER_BORDER_RIGHT
1156 }
1157 
1158 // ftsystem.h
1159 alias FT_Memory = FT_MemoryRec*;
1160 
1161 extern(C) nothrow {
1162     alias FT_Alloc_Func = void* function(FT_Memory, c_long);
1163     alias FT_Free_Func = void  function(FT_Memory, void*);
1164     alias FT_Realloc_Func = void* function(FT_Memory, c_long, c_long, void*);
1165 }
1166 
1167 struct FT_MemoryRec {
1168     void* user;
1169     FT_Alloc_Func alloc;
1170     FT_Free_Func free;
1171     FT_Realloc_Func realloc;
1172 }
1173 
1174 alias FT_Stream = FT_StreamRec*;
1175 
1176 union FT_StreamDesc {
1177     int value;
1178     void* pointer;
1179 }
1180 
1181 extern(C) nothrow {
1182     alias FT_Stream_IoFunc = c_ulong function(FT_Stream, c_ulong, ubyte*, c_ulong);
1183     alias FT_Stream_CloseFunc = void function(FT_Stream);
1184 }
1185 
1186 struct FT_StreamRec {
1187     ubyte* base;
1188     c_ulong size;
1189     c_ulong pos;
1190     FT_StreamDesc descriptor;
1191     FT_StreamDesc pathname;
1192     FT_Stream_IoFunc read;
1193     FT_Stream_CloseFunc close;
1194     FT_Memory memory;
1195     ubyte* cursor;
1196     ubyte* limit;
1197 }
1198 
1199 // fttrigon.h
1200 alias FT_Angle = FT_Fixed;
1201 
1202 enum {
1203     FT_ANGLE_PI     = 180 << 16,
1204     FT_ANGLE_2PI    = FT_ANGLE_PI * 2,
1205     FT_ANGLE_PI2    = FT_ANGLE_PI / 2,
1206     FT_ANGLE_PI4    = FT_ANGLE_PI / 4
1207 }
1208 
1209 // ftttdrv.h
1210 enum TT_INTERPRETER_VERSION_35 = 35;
1211 enum TT_INTERPRETER_VERSION_38 = 38;
1212 
1213 // ftwinfnt.h
1214 enum {
1215     FT_WinFNT_ID_CP1252 = 0,
1216     FT_WinFNT_ID_DEFAULT = 1,
1217     FT_WinFNT_ID_SYMBOL = 2,
1218     FT_WinFNT_ID_MAC = 77,
1219     FT_WinFNT_ID_CP932 = 128,
1220     FT_WinFNT_ID_CP949 = 129,
1221     FT_WinFNT_ID_CP1361 = 130,
1222     FT_WinFNT_ID_CP936 = 134,
1223     FT_WinFNT_ID_CP950 = 136,
1224     FT_WinFNT_ID_CP1253 = 161,
1225     FT_WinFNT_ID_CP1254 = 162,
1226     FT_WinFNT_ID_CP1258 = 163,
1227     FT_WinFNT_ID_CP1255 = 177,
1228     FT_WinFNT_ID_CP1256 = 178,
1229     FT_WinFNT_ID_CP1257 = 186,
1230     FT_WinFNT_ID_CP1251 = 204,
1231     FT_WinFNT_ID_CP874 = 222,
1232     FT_WinFNT_ID_CP1250 = 238,
1233     FT_WinFNT_ID_OEM = 255,
1234 }
1235 
1236 
1237 struct FT_WinFNT_HeaderRec {
1238     FT_UShort _version;
1239     FT_ULong file_size;
1240     FT_Byte[60] copyright;
1241     FT_UShort file_type;
1242     FT_UShort nominal_point_size;
1243     FT_UShort vertical_resolution;
1244     FT_UShort horizontal_resolution;
1245     FT_UShort ascent;
1246     FT_UShort internal_leading;
1247     FT_UShort external_leading;
1248     FT_Byte italic;
1249     FT_Byte underline;
1250     FT_Byte strike_out;
1251     FT_UShort weight;
1252     FT_Byte charset;
1253     FT_UShort pixel_width;
1254     FT_UShort pixel_height;
1255     FT_Byte pitch_and_family;
1256     FT_UShort avg_width;
1257     FT_UShort max_width;
1258     FT_Byte first_char;
1259     FT_Byte last_char;
1260     FT_Byte default_char;
1261     FT_Byte break_char;
1262     FT_UShort bytes_per_row;
1263     FT_ULong device_offset;
1264     FT_ULong face_name_offset;
1265     FT_ULong bits_pointer;
1266     FT_ULong bits_offset;
1267     FT_Byte reserved;
1268     FT_ULong flags;
1269     FT_UShort A_space;
1270     FT_UShort B_space;
1271     FT_UShort C_space;
1272     FT_UShort color_table_offset;
1273     FT_ULong[4] reserved1;
1274 }
1275 
1276 alias FT_WinFNT_Header = FT_WinFNT_HeaderRec*;
1277 
1278 // t1tables.h
1279 struct PS_FontInfoRec {
1280     FT_String* _version;
1281     FT_String* notice;
1282     FT_String* full_name;
1283     FT_String* family_name;
1284     FT_String* weight;
1285     FT_Long italic_angle;
1286     FT_Bool is_fixed_pitch;
1287     FT_Short underline_position;
1288     FT_UShort underline_thickness;
1289 }
1290 
1291 alias PS_FontInfo = PS_FontInfoRec*;
1292 
1293 struct PS_PrivateRec {
1294     FT_Int unique_id;
1295     FT_Int lenIV;
1296     FT_Byte num_blue_values;
1297     FT_Byte num_other_blues;
1298     FT_Byte num_family_blues;
1299     FT_Byte num_family_other_blues;
1300     FT_Short[14] blue_values;
1301     FT_Short[10] other_blues;
1302     FT_Short[14] family_blues;
1303     FT_Short[10] family_other_blues;
1304     FT_Fixed blue_scale;
1305     FT_Int blue_shift;
1306     FT_Int blue_fuzz;
1307     FT_UShort[1] standard_width;
1308     FT_UShort[1] standard_height;
1309     FT_Byte num_snap_widths;
1310     FT_Byte num_snap_heights;
1311     FT_Bool force_bold;
1312     FT_Bool round_stem_up;
1313     FT_Short[13] snap_widths;
1314     FT_Short[13] snap_heights;
1315     FT_Fixed expansion_factor;
1316     FT_Long language_group;
1317     FT_Long password;
1318     FT_Short[2] min_feature;
1319 }
1320 
1321 alias PS_Private = PS_PrivateRec*;
1322 
1323 alias T1_Blend_Flags = int;
1324 enum {
1325     T1_BLEND_UNDERLINE_POSITION = 0,
1326     T1_BLEND_UNDERLINE_THICKNESS,
1327     T1_BLEND_ITALIC_ANGLE,
1328     T1_BLEND_BLUE_VALUES,
1329     T1_BLEND_OTHER_BLUES,
1330     T1_BLEND_STANDARD_WIDTH,
1331     T1_BLEND_STANDARD_HEIGHT,
1332     T1_BLEND_STEM_SNAP_WIDTHS,
1333     T1_BLEND_STEM_SNAP_HEIGHTS,
1334     T1_BLEND_BLUE_SCALE,
1335     T1_BLEND_BLUE_SHIFT,
1336     T1_BLEND_FAMILY_BLUES,
1337     T1_BLEND_FAMILY_OTHER_BLUES,
1338     T1_BLEND_FORCE_BOLD,
1339     T1_BLEND_MAX
1340 }
1341 
1342 enum T1_MAX_MM_DESIGNS = 16;
1343 enum T1_MAX_MM_AXIS = 4;
1344 enum T1_MAX_MM_MAP_POINTS = 20;
1345 
1346 struct PS_DesignMapRec {
1347     FT_Byte num_points;
1348     FT_Long* design_points;
1349     FT_Fixed* blend_points;
1350 }
1351 
1352 alias PS_DesignMap = PS_DesignMapRec*;
1353 
1354 struct PS_BlendRec {
1355     FT_UInt num_designs;
1356     FT_UInt num_axis;
1357     FT_String*[T1_MAX_MM_AXIS] axis_names;
1358     FT_Fixed*[T1_MAX_MM_DESIGNS] design_pos;
1359     PS_DesignMapRec[T1_MAX_MM_AXIS] design_map;
1360     FT_Fixed* weight_vector;
1361     FT_Fixed* default_weight_vector;
1362     PS_FontInfo[T1_MAX_MM_DESIGNS+1] font_infos;
1363     PS_Private[T1_MAX_MM_DESIGNS+1] privates;
1364     FT_ULong blend_bitflags;
1365     FT_BBox*[T1_MAX_MM_DESIGNS+1] bboxes;
1366     FT_UInt[T1_MAX_MM_DESIGNS] default_design_vector;
1367     FT_UInt num_default_design_vector;
1368 }
1369 
1370 alias PS_Blend = PS_BlendRec*;
1371 
1372 struct CID_FaceDictRec {
1373     PS_PrivateRec private_dict;
1374     FT_UInt len_buildchar;
1375     FT_Fixed forcebold_threshold;
1376     FT_Pos stroke_width;
1377     FT_Fixed expansion_factor;
1378     FT_Byte paint_type;
1379     FT_Byte font_type;
1380     FT_Matrix font_matrix;
1381     FT_Vector font_offset;
1382     FT_UInt num_subrs;
1383     FT_ULong subrmap_offset;
1384     FT_Int sd_bytes;
1385 }
1386 
1387 alias CID_FaceDict = CID_FaceDictRec*;
1388 
1389 struct CID_FaceInfoRec {
1390     FT_String* cid_font_name;
1391     FT_Fixed cid_version;
1392     FT_Int cid_font_type;
1393     FT_String* registry;
1394     FT_String* ordering;
1395     FT_Int supplement;
1396     PS_FontInfoRec font_info;
1397     FT_BBox font_bbox;
1398     FT_ULong uid_base;
1399     FT_Int num_xuid;
1400     FT_ULong[16] xuid;
1401     FT_ULong cidmap_offset;
1402     FT_Int fd_bytes;
1403     FT_Int gd_bytes;
1404     FT_ULong cid_count;
1405     FT_Int num_dicts;
1406     CID_FaceDict font_dicts;
1407     FT_ULong data_offset;
1408 }
1409 
1410 alias CID_FaceInfo = CID_FaceInfoRec*;
1411 
1412 alias T1_EncodingType = int;
1413 enum {
1414     T1_ENCODING_TYPE_NONE = 0,
1415     T1_ENCODING_TYPE_ARRAY,
1416     T1_ENCODING_TYPE_STANDARD,
1417     T1_ENCODING_TYPE_ISOLATIN1,
1418     T1_ENCODING_TYPE_EXPERT,
1419 }
1420 
1421 alias PS_Dict_Keys = int;
1422 enum {
1423     PS_DICT_FONT_TYPE,
1424     PS_DICT_FONT_MATRIX,
1425     PS_DICT_FONT_BBOX,
1426     PS_DICT_PAINT_TYPE,
1427     PS_DICT_FONT_NAME,
1428     PS_DICT_UNIQUE_ID,
1429     PS_DICT_NUM_CHAR_STRINGS,
1430     PS_DICT_CHAR_STRING_KEY,
1431     PS_DICT_CHAR_STRING,
1432     PS_DICT_ENCODING_TYPE,
1433     PS_DICT_ENCODING_ENTRY,
1434 
1435     PS_DICT_NUM_SUBRS,
1436     PS_DICT_SUBR,
1437     PS_DICT_STD_HW,
1438     PS_DICT_STD_VW,
1439     PS_DICT_NUM_BLUE_VALUES,
1440     PS_DICT_BLUE_VALUE,
1441     PS_DICT_BLUE_FUZZ,
1442     PS_DICT_NUM_OTHER_BLUES,
1443     PS_DICT_OTHER_BLUE,
1444     PS_DICT_NUM_FAMILY_BLUES,
1445     PS_DICT_FAMILY_BLUE,
1446     PS_DICT_NUM_FAMILY_OTHER_BLUES,
1447     PS_DICT_FAMILY_OTHER_BLUE,
1448     PS_DICT_BLUE_SCALE,
1449     PS_DICT_BLUE_SHIFT,
1450     PS_DICT_NUM_STEM_SNAP_H,
1451     PS_DICT_STEM_SNAP_H,
1452     PS_DICT_NUM_STEM_SNAP_V,
1453     PS_DICT_STEM_SNAP_V,
1454     PS_DICT_FORCE_BOLD,
1455     PS_DICT_RND_STEM_UP,
1456     PS_DICT_MIN_FEATURE,
1457     PS_DICT_LEN_IV,
1458     PS_DICT_PASSWORD,
1459     PS_DICT_LANGUAGE_GROUP,
1460 
1461     PS_DICT_VERSION,
1462     PS_DICT_NOTICE,
1463     PS_DICT_FULL_NAME,
1464     PS_DICT_FAMILY_NAME,
1465     PS_DICT_WEIGHT,
1466     PS_DICT_IS_FIXED_PITCH,
1467     PS_DICT_UNDERLINE_POSITION,
1468     PS_DICT_UNDERLINE_THICKNESS,
1469     PS_DICT_FS_TYPE,
1470     PS_DICT_ITALIC_ANGLE,
1471 
1472     PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
1473 }
1474 
1475 // ttnameid.h
1476 enum {
1477     TT_PLATFORM_APPLE_UNICODE = 0,
1478     TT_PLATFORM_MACINTOSH = 1,
1479     TT_PLATFORM_MICROSOFT = 3,
1480     TT_PLATFORM_CUSTOM = 4,
1481     TT_PLATFORM_ADOBE = 7,
1482 }
1483 
1484 enum {
1485     TT_APPLE_ID_DEFAULT = 0,
1486     TT_APPLE_ID_UNICODE_1_1 = 1,
1487     TT_APPLE_ID_UNICODE_2_0 = 3,
1488     TT_APPLE_ID_UNICODE_32 = 4,
1489     TT_APPLE_ID_VARIANT_SELECTOR = 5,
1490 }
1491 
1492 enum {
1493     TT_MAC_ID_ROMAN = 0,
1494     TT_MAC_ID_JAPANESE = 1,
1495     TT_MAC_ID_TRADITIONAL_CHINESE = 2,
1496     TT_MAC_ID_KOREAN = 3,
1497     TT_MAC_ID_ARABIC = 4,
1498     TT_MAC_ID_HEBREW = 5,
1499     TT_MAC_ID_GREEK = 6,
1500     TT_MAC_ID_RUSSIAN = 7,
1501     TT_MAC_ID_RSYMBOL = 8,
1502     TT_MAC_ID_DEVANAGARI = 9,
1503     TT_MAC_ID_GURMUKHI = 10,
1504     TT_MAC_ID_GUJARATI = 11,
1505     TT_MAC_ID_ORIYA = 12,
1506     TT_MAC_ID_BENGALI = 13,
1507     TT_MAC_ID_TAMIL = 14,
1508     TT_MAC_ID_TELUGU = 15,
1509     TT_MAC_ID_KANNADA = 16,
1510     TT_MAC_ID_MALAYALAM = 17,
1511     TT_MAC_ID_SINHALESE = 18,
1512     TT_MAC_ID_BURMESE = 19,
1513     TT_MAC_ID_KHMER = 20,
1514     TT_MAC_ID_THAI = 21,
1515     TT_MAC_ID_LAOTIAN = 22,
1516     TT_MAC_ID_GEORGIAN = 23,
1517     TT_MAC_ID_ARMENIAN = 24,
1518     TT_MAC_ID_MALDIVIAN = 25,
1519     TT_MAC_ID_SIMPLIFIED_CHINESE = 25,
1520     TT_MAC_ID_TIBETAN = 26,
1521     TT_MAC_ID_MONGOLIAN = 27,
1522     TT_MAC_ID_GEEZ = 28,
1523     TT_MAC_ID_SLAVIC = 29,
1524     TT_MAC_ID_VIETNAMESE = 30,
1525     TT_MAC_ID_SINDHI = 31,
1526     TT_MAC_ID_UNINTERP = 32,
1527 }
1528 
1529 enum {
1530     TT_ISO_ID_7BIT_ASCII = 0,
1531     TT_ISO_ID_10646 = 1,
1532     TT_ISO_ID_8859_1 = 2,
1533 }
1534 
1535 enum {
1536     TT_MS_ID_SYMBOL_CS = 0,
1537     TT_MS_ID_UNICODE_CS = 1,
1538     TT_MS_ID_SJIS = 2,
1539     TT_MS_ID_GB2312 = 3,
1540     TT_MS_ID_BIG_5 = 4,
1541     TT_MS_ID_WANSUNG = 5,
1542     TT_MS_ID_JOHAB = 6,
1543     TT_MS_ID_UCS_4 = 10,
1544 }
1545 
1546 enum {
1547     TT_ADOBE_ID_STANDARD = 0,
1548     TT_ADOBE_ID_EXPERT = 1,
1549     TT_ADOBE_ID_CUSTOM = 2,
1550     TT_ADOBE_ID_LATIN_1 = 3,
1551 }
1552 
1553 enum {
1554     TT_MAC_LANGID_ENGLISH = 0,
1555     TT_MAC_LANGID_FRENCH = 1,
1556     TT_MAC_LANGID_GERMAN = 2,
1557     TT_MAC_LANGID_ITALIAN = 3,
1558     TT_MAC_LANGID_DUTCH = 4,
1559     TT_MAC_LANGID_SWEDISH = 5,
1560     TT_MAC_LANGID_SPANISH = 6,
1561     TT_MAC_LANGID_DANISH = 7,
1562     TT_MAC_LANGID_PORTUGUESE = 8,
1563     TT_MAC_LANGID_NORWEGIAN = 9,
1564     TT_MAC_LANGID_HEBREW = 10,
1565     TT_MAC_LANGID_JAPANESE = 11,
1566     TT_MAC_LANGID_ARABIC = 12,
1567     TT_MAC_LANGID_FINNISH = 13,
1568     TT_MAC_LANGID_GREEK = 14,
1569     TT_MAC_LANGID_ICELANDIC = 15,
1570     TT_MAC_LANGID_MALTESE = 16,
1571     TT_MAC_LANGID_TURKISH = 17,
1572     TT_MAC_LANGID_CROATIAN = 18,
1573     TT_MAC_LANGID_CHINESE_TRADITIONAL = 19,
1574     TT_MAC_LANGID_URDU = 20,
1575     TT_MAC_LANGID_HINDI = 21,
1576     TT_MAC_LANGID_THAI = 22,
1577     TT_MAC_LANGID_KOREAN = 23,
1578     TT_MAC_LANGID_LITHUANIAN = 24,
1579     TT_MAC_LANGID_POLISH = 25,
1580     TT_MAC_LANGID_HUNGARIAN = 26,
1581     TT_MAC_LANGID_ESTONIAN = 27,
1582     TT_MAC_LANGID_LETTISH = 28,
1583     TT_MAC_LANGID_SAAMISK = 29,
1584     TT_MAC_LANGID_FAEROESE = 30,
1585     TT_MAC_LANGID_FARSI = 31,
1586     TT_MAC_LANGID_RUSSIAN = 32,
1587     TT_MAC_LANGID_CHINESE_SIMPLIFIED = 33,
1588     TT_MAC_LANGID_FLEMISH = 34,
1589     TT_MAC_LANGID_IRISH = 35,
1590     TT_MAC_LANGID_ALBANIAN = 36,
1591     TT_MAC_LANGID_ROMANIAN = 37,
1592     TT_MAC_LANGID_CZECH = 38,
1593     TT_MAC_LANGID_SLOVAK = 39,
1594     TT_MAC_LANGID_SLOVENIAN = 40,
1595     TT_MAC_LANGID_YIDDISH = 41,
1596     TT_MAC_LANGID_SERBIAN = 42,
1597     TT_MAC_LANGID_MACEDONIAN = 43,
1598     TT_MAC_LANGID_BULGARIAN = 44,
1599     TT_MAC_LANGID_UKRAINIAN = 45,
1600     TT_MAC_LANGID_BYELORUSSIAN = 46,
1601     TT_MAC_LANGID_UZBEK = 47,
1602     TT_MAC_LANGID_KAZAKH = 48,
1603     TT_MAC_LANGID_AZERBAIJANI = 49,
1604     TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT = 49,
1605     TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT = 50,
1606     TT_MAC_LANGID_ARMENIAN = 51,
1607     TT_MAC_LANGID_GEORGIAN = 52,
1608     TT_MAC_LANGID_MOLDAVIAN = 53,
1609     TT_MAC_LANGID_KIRGHIZ = 54,
1610     TT_MAC_LANGID_TAJIKI = 55,
1611     TT_MAC_LANGID_TURKMEN = 56,
1612     TT_MAC_LANGID_MONGOLIAN = 57,
1613     TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT = 57,
1614     TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT = 58,
1615     TT_MAC_LANGID_PASHTO = 59,
1616     TT_MAC_LANGID_KURDISH = 60,
1617     TT_MAC_LANGID_KASHMIRI = 61,
1618     TT_MAC_LANGID_SINDHI = 62,
1619     TT_MAC_LANGID_TIBETAN = 63,
1620     TT_MAC_LANGID_NEPALI = 64,
1621     TT_MAC_LANGID_SANSKRIT = 65,
1622     TT_MAC_LANGID_MARATHI = 66,
1623     TT_MAC_LANGID_BENGALI = 67,
1624     TT_MAC_LANGID_ASSAMESE = 68,
1625     TT_MAC_LANGID_GUJARATI = 69,
1626     TT_MAC_LANGID_PUNJABI = 70,
1627     TT_MAC_LANGID_ORIYA = 71,
1628     TT_MAC_LANGID_MALAYALAM = 72,
1629     TT_MAC_LANGID_KANNADA = 73,
1630     TT_MAC_LANGID_TAMIL = 74,
1631     TT_MAC_LANGID_TELUGU = 75,
1632     TT_MAC_LANGID_SINHALESE = 76,
1633     TT_MAC_LANGID_BURMESE = 77,
1634     TT_MAC_LANGID_KHMER = 78,
1635     TT_MAC_LANGID_LAO = 79,
1636     TT_MAC_LANGID_VIETNAMESE = 80,
1637     TT_MAC_LANGID_INDONESIAN = 81,
1638     TT_MAC_LANGID_TAGALOG = 82,
1639     TT_MAC_LANGID_MALAY_ROMAN_SCRIPT = 83,
1640     TT_MAC_LANGID_MALAY_ARABIC_SCRIPT = 84,
1641     TT_MAC_LANGID_AMHARIC = 85,
1642     TT_MAC_LANGID_TIGRINYA = 86,
1643     TT_MAC_LANGID_GALLA = 87,
1644     TT_MAC_LANGID_SOMALI = 88,
1645     TT_MAC_LANGID_SWAHILI = 89,
1646     TT_MAC_LANGID_RUANDA = 90,
1647     TT_MAC_LANGID_RUNDI = 91,
1648     TT_MAC_LANGID_CHEWA = 92,
1649     TT_MAC_LANGID_MALAGASY = 93,
1650     TT_MAC_LANGID_ESPERANTO = 94,
1651     TT_MAC_LANGID_WELSH = 128,
1652     TT_MAC_LANGID_BASQUE = 129,
1653     TT_MAC_LANGID_CATALAN = 130,
1654     TT_MAC_LANGID_LATIN = 131,
1655     TT_MAC_LANGID_QUECHUA = 132,
1656     TT_MAC_LANGID_GUARANI = 133,
1657     TT_MAC_LANGID_AYMARA = 134,
1658     TT_MAC_LANGID_TATAR = 135,
1659     TT_MAC_LANGID_UIGHUR = 136,
1660     TT_MAC_LANGID_DZONGKHA = 137,
1661     TT_MAC_LANGID_JAVANESE = 138,
1662     TT_MAC_LANGID_SUNDANESE = 139,
1663     TT_MAC_LANGID_GALICIAN = 140,
1664     TT_MAC_LANGID_AFRIKAANS = 141,
1665     TT_MAC_LANGID_BRETON = 142,
1666     TT_MAC_LANGID_INUKTITUT = 143,
1667     TT_MAC_LANGID_SCOTTISH_GAELIC = 144,
1668     TT_MAC_LANGID_MANX_GAELIC = 145,
1669     TT_MAC_LANGID_IRISH_GAELIC = 146,
1670     TT_MAC_LANGID_TONGAN = 147,
1671     TT_MAC_LANGID_GREEK_POLYTONIC = 148,
1672     TT_MAC_LANGID_GREELANDIC = 149,
1673     TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT = 150,
1674 }
1675 
1676 enum {
1677     TT_MS_LANGID_ARABIC_GENERAL = 0x0001,
1678     TT_MS_LANGID_ARABIC_SAUDI_ARABIA = 0x0401,
1679     TT_MS_LANGID_ARABIC_IRAQ = 0x0801,
1680     TT_MS_LANGID_ARABIC_EGYPT = 0x0c01,
1681     TT_MS_LANGID_ARABIC_LIBYA = 0x1001,
1682     TT_MS_LANGID_ARABIC_ALGERIA = 0x1401,
1683     TT_MS_LANGID_ARABIC_MOROCCO = 0x1801,
1684     TT_MS_LANGID_ARABIC_TUNISIA = 0x1c01,
1685     TT_MS_LANGID_ARABIC_OMAN = 0x2001,
1686     TT_MS_LANGID_ARABIC_YEMEN = 0x2401,
1687     TT_MS_LANGID_ARABIC_SYRIA = 0x2801,
1688     TT_MS_LANGID_ARABIC_JORDAN = 0x2c01,
1689     TT_MS_LANGID_ARABIC_LEBANON = 0x3001,
1690     TT_MS_LANGID_ARABIC_KUWAIT = 0x3401,
1691     TT_MS_LANGID_ARABIC_UAE = 0x3801,
1692     TT_MS_LANGID_ARABIC_BAHRAIN = 0x3c01,
1693     TT_MS_LANGID_ARABIC_QATAR = 0x4001,
1694     TT_MS_LANGID_BULGARIAN_BULGARIA = 0x0402,
1695     TT_MS_LANGID_CATALAN_SPAIN = 0x0403,
1696     TT_MS_LANGID_CHINESE_GENERAL = 0x0004,
1697     TT_MS_LANGID_CHINESE_TAIWAN = 0x0404,
1698     TT_MS_LANGID_CHINESE_PRC = 0x0804,
1699     TT_MS_LANGID_CHINESE_HONG_KONG = 0x0c04,
1700     TT_MS_LANGID_CHINESE_SINGAPORE = 0x1004,
1701     TT_MS_LANGID_CHINESE_MACAU = 0x1404,
1702     TT_MS_LANGID_CZECH_CZECH_REPUBLIC = 0x0405,
1703     TT_MS_LANGID_DANISH_DENMARK = 0x0406,
1704     TT_MS_LANGID_GERMAN_GERMANY = 0x0407,
1705     TT_MS_LANGID_GERMAN_SWITZERLAND = 0x0807,
1706     TT_MS_LANGID_GERMAN_AUSTRIA = 0x0c07,
1707     TT_MS_LANGID_GERMAN_LUXEMBOURG = 0x1007,
1708     TT_MS_LANGID_GERMAN_LIECHTENSTEI = 0x1407,
1709     TT_MS_LANGID_GREEK_GREECE = 0x0408,
1710     TT_MS_LANGID_ENGLISH_GENERAL = 0x0009,
1711     TT_MS_LANGID_ENGLISH_UNITED_STATES = 0x0409,
1712     TT_MS_LANGID_ENGLISH_UNITED_KINGDOM = 0x0809,
1713     TT_MS_LANGID_ENGLISH_AUSTRALIA = 0x0c09,
1714     TT_MS_LANGID_ENGLISH_CANADA = 0x1009,
1715     TT_MS_LANGID_ENGLISH_NEW_ZEALAND = 0x1409,
1716     TT_MS_LANGID_ENGLISH_IRELAND = 0x1809,
1717     TT_MS_LANGID_ENGLISH_SOUTH_AFRICA = 0x1c09,
1718     TT_MS_LANGID_ENGLISH_JAMAICA = 0x2009,
1719     TT_MS_LANGID_ENGLISH_CARIBBEAN = 0x2409,
1720     TT_MS_LANGID_ENGLISH_BELIZE = 0x2809,
1721     TT_MS_LANGID_ENGLISH_TRINIDAD = 0x2c09,
1722     TT_MS_LANGID_ENGLISH_ZIMBABWE = 0x3009,
1723     TT_MS_LANGID_ENGLISH_PHILIPPINES = 0x3409,
1724     TT_MS_LANGID_ENGLISH_INDONESIA = 0x3809,
1725     TT_MS_LANGID_ENGLISH_HONG_KONG = 0x3c09,
1726     TT_MS_LANGID_ENGLISH_INDIA = 0x4009,
1727     TT_MS_LANGID_ENGLISH_MALAYSIA = 0x4409,
1728     TT_MS_LANGID_ENGLISH_SINGAPORE = 0x4809,
1729     TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT = 0x040a,
1730     TT_MS_LANGID_SPANISH_MEXICO = 0x080a,
1731     TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT = 0x0c0a,
1732     TT_MS_LANGID_SPANISH_GUATEMALA = 0x100a,
1733     TT_MS_LANGID_SPANISH_COSTA_RICA = 0x140a,
1734     TT_MS_LANGID_SPANISH_PANAMA = 0x180a,
1735     TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC = 0x1c0a,
1736     TT_MS_LANGID_SPANISH_VENEZUELA = 0x200a,
1737     TT_MS_LANGID_SPANISH_COLOMBIA = 0x240a,
1738     TT_MS_LANGID_SPANISH_PERU = 0x280a,
1739     TT_MS_LANGID_SPANISH_ARGENTINA = 0x2c0a,
1740     TT_MS_LANGID_SPANISH_ECUADOR = 0x300a,
1741     TT_MS_LANGID_SPANISH_CHILE = 0x340a,
1742     TT_MS_LANGID_SPANISH_URUGUAY = 0x380a,
1743     TT_MS_LANGID_SPANISH_PARAGUAY = 0x3c0a,
1744     TT_MS_LANGID_SPANISH_BOLIVIA = 0x400a,
1745     TT_MS_LANGID_SPANISH_EL_SALVADOR = 0x440a,
1746     TT_MS_LANGID_SPANISH_HONDURAS = 0x480a,
1747     TT_MS_LANGID_SPANISH_NICARAGUA = 0x4c0a,
1748     TT_MS_LANGID_SPANISH_PUERTO_RICO = 0x500a,
1749     TT_MS_LANGID_SPANISH_UNITED_STATES = 0x540a,
1750     TT_MS_LANGID_SPANISH_LATIN_AMERICA = 0xE40aU,
1751     TT_MS_LANGID_FINNISH_FINLAND = 0x040b,
1752     TT_MS_LANGID_FRENCH_FRANCE = 0x040c,
1753     TT_MS_LANGID_FRENCH_BELGIUM = 0x080c,
1754     TT_MS_LANGID_FRENCH_CANADA = 0x0c0c,
1755     TT_MS_LANGID_FRENCH_SWITZERLAND = 0x100c,
1756     TT_MS_LANGID_FRENCH_LUXEMBOURG = 0x140c,
1757     TT_MS_LANGID_FRENCH_MONACO = 0x180c,
1758     TT_MS_LANGID_FRENCH_WEST_INDIES = 0x1c0c,
1759     TT_MS_LANGID_FRENCH_REUNION = 0x200c,
1760     TT_MS_LANGID_FRENCH_CONGO = 0x240c,
1761     TT_MS_LANGID_FRENCH_ZAIRE = TT_MS_LANGID_FRENCH_CONGO,
1762     TT_MS_LANGID_FRENCH_SENEGAL = 0x280c,
1763     TT_MS_LANGID_FRENCH_CAMEROON = 0x2c0c,
1764     TT_MS_LANGID_FRENCH_COTE_D_IVOIRE = 0x300c,
1765     TT_MS_LANGID_FRENCH_MALI = 0x340c,
1766     TT_MS_LANGID_FRENCH_MOROCCO = 0x380c,
1767     TT_MS_LANGID_FRENCH_HAITI = 0x3c0c,
1768     TT_MS_LANGID_FRENCH_NORTH_AFRICA = 0xE40cU,
1769     TT_MS_LANGID_HEBREW_ISRAEL = 0x040d,
1770     TT_MS_LANGID_HUNGARIAN_HUNGARY = 0x040e,
1771     TT_MS_LANGID_ICELANDIC_ICELAND = 0x040f,
1772     TT_MS_LANGID_ITALIAN_ITALY = 0x0410,
1773     TT_MS_LANGID_ITALIAN_SWITZERLAND = 0x0810,
1774     TT_MS_LANGID_JAPANESE_JAPAN = 0x0411,
1775     TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA = 0x0412,
1776     TT_MS_LANGID_KOREAN_JOHAB_KOREA = 0x0812,
1777     TT_MS_LANGID_DUTCH_NETHERLANDS = 0x0413,
1778     TT_MS_LANGID_DUTCH_BELGIUM = 0x0813,
1779     TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL = 0x0414,
1780     TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK = 0x0814,
1781     TT_MS_LANGID_POLISH_POLAND = 0x0415,
1782     TT_MS_LANGID_PORTUGUESE_BRAZIL = 0x0416,
1783     TT_MS_LANGID_PORTUGUESE_PORTUGAL = 0x0816,
1784     TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND = 0x0417,
1785     TT_MS_LANGID_ROMANIAN_ROMANIA = 0x0418,
1786     TT_MS_LANGID_MOLDAVIAN_MOLDAVIA = 0x0818,
1787     TT_MS_LANGID_RUSSIAN_RUSSIA = 0x0419,
1788     TT_MS_LANGID_RUSSIAN_MOLDAVIA = 0x0819,
1789     TT_MS_LANGID_CROATIAN_CROATIA = 0x041a,
1790     TT_MS_LANGID_SERBIAN_SERBIA_LATIN = 0x081a,
1791     TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC = 0x0c1a,
1792     TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA = 0x101a,
1793     TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA = 0x141a,
1794     TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN = 0x181a,
1795     TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC = 0x181a,
1796     TT_MS_LANGID_SLOVAK_SLOVAKIA = 0x041b,
1797     TT_MS_LANGID_ALBANIAN_ALBANIA = 0x041c,
1798     TT_MS_LANGID_SWEDISH_SWEDEN = 0x041d,
1799     TT_MS_LANGID_SWEDISH_FINLAND = 0x081d,
1800     TT_MS_LANGID_THAI_THAILAND = 0x041e,
1801     TT_MS_LANGID_TURKISH_TURKEY = 0x041f,
1802     TT_MS_LANGID_URDU_PAKISTAN = 0x0420,
1803     TT_MS_LANGID_URDU_INDIA = 0x0820,
1804     TT_MS_LANGID_INDONESIAN_INDONESIA = 0x0421,
1805     TT_MS_LANGID_UKRAINIAN_UKRAINE = 0x0422,
1806     TT_MS_LANGID_BELARUSIAN_BELARUS = 0x0423,
1807     TT_MS_LANGID_SLOVENE_SLOVENIA = 0x0424,
1808     TT_MS_LANGID_ESTONIAN_ESTONIA = 0x0425,
1809     TT_MS_LANGID_LATVIAN_LATVIA = 0x0426,
1810     TT_MS_LANGID_LITHUANIAN_LITHUANIA = 0x0427,
1811     TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA = 0x0827,
1812     TT_MS_LANGID_TAJIK_TAJIKISTAN = 0x0428,
1813     TT_MS_LANGID_FARSI_IRAN = 0x0429,
1814     TT_MS_LANGID_VIETNAMESE_VIET_NAM = 0x042a,
1815     TT_MS_LANGID_ARMENIAN_ARMENIA = 0x042b,
1816     TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN = 0x042c,
1817     TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC = 0x082c,
1818     TT_MS_LANGID_BASQUE_SPAIN = 0x042d,
1819     TT_MS_LANGID_SORBIAN_GERMANY = 0x042e,
1820     TT_MS_LANGID_MACEDONIAN_MACEDONIA = 0x042f,
1821     TT_MS_LANGID_SUTU_SOUTH_AFRICA = 0x0430,
1822     TT_MS_LANGID_TSONGA_SOUTH_AFRICA = 0x0431,
1823     TT_MS_LANGID_TSWANA_SOUTH_AFRICA = 0x0432,
1824     TT_MS_LANGID_VENDA_SOUTH_AFRICA = 0x0433,
1825     TT_MS_LANGID_XHOSA_SOUTH_AFRICA = 0x0434,
1826     TT_MS_LANGID_ZULU_SOUTH_AFRICA = 0x0435,
1827     TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA = 0x0436,
1828     TT_MS_LANGID_GEORGIAN_GEORGIA = 0x0437,
1829     TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS = 0x0438,
1830     TT_MS_LANGID_HINDI_INDIA = 0x0439,
1831     TT_MS_LANGID_MALTESE_MALTA = 0x043a,
1832     TT_MS_LANGID_SAMI_NORTHERN_NORWAY = 0x043b,
1833     TT_MS_LANGID_SAMI_NORTHERN_SWEDEN = 0x083b,
1834     TT_MS_LANGID_SAMI_NORTHERN_FINLAND = 0x0C3b,
1835     TT_MS_LANGID_SAMI_LULE_NORWAY = 0x103b,
1836     TT_MS_LANGID_SAMI_LULE_SWEDEN = 0x143b,
1837     TT_MS_LANGID_SAMI_SOUTHERN_NORWAY = 0x183b,
1838     TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN = 0x1C3b,
1839     TT_MS_LANGID_SAMI_SKOLT_FINLAND = 0x203b,
1840     TT_MS_LANGID_SAMI_INARI_FINLAND = 0x243b,
1841     TT_MS_LANGID_SAAMI_LAPONIA = 0x043b,
1842     TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM = 0x083c,
1843     TT_MS_LANGID_IRISH_GAELIC_IRELAND = 0x043c,
1844     TT_MS_LANGID_YIDDISH_GERMANY = 0x043d,
1845     TT_MS_LANGID_MALAY_MALAYSIA = 0x043e,
1846     TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM = 0x083e,
1847     TT_MS_LANGID_KAZAK_KAZAKSTAN = 0x043f,
1848     TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN  = 0x0440,
1849     TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC = TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN,
1850     TT_MS_LANGID_SWAHILI_KENYA = 0x0441,
1851     TT_MS_LANGID_TURKMEN_TURKMENISTAN = 0x0442,
1852     TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN = 0x0443,
1853     TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC = 0x0843,
1854     TT_MS_LANGID_TATAR_TATARSTAN = 0x0444,
1855     TT_MS_LANGID_BENGALI_INDIA = 0x0445,
1856     TT_MS_LANGID_BENGALI_BANGLADESH = 0x0845,
1857     TT_MS_LANGID_PUNJABI_INDIA = 0x0446,
1858     TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN = 0x0846,
1859     TT_MS_LANGID_GUJARATI_INDIA = 0x0447,
1860     TT_MS_LANGID_ORIYA_INDIA = 0x0448,
1861     TT_MS_LANGID_TAMIL_INDIA = 0x0449,
1862     TT_MS_LANGID_TELUGU_INDIA = 0x044a,
1863     TT_MS_LANGID_KANNADA_INDIA = 0x044b,
1864     TT_MS_LANGID_MALAYALAM_INDIA = 0x044c,
1865     TT_MS_LANGID_ASSAMESE_INDIA = 0x044d,
1866     TT_MS_LANGID_MARATHI_INDIA = 0x044e,
1867     TT_MS_LANGID_SANSKRIT_INDIA = 0x044f,
1868     TT_MS_LANGID_MONGOLIAN_MONGOLIA = 0x0450,
1869     TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN = 0x0850,
1870     TT_MS_LANGID_TIBETAN_CHINA = 0x0451,
1871     TT_MS_LANGID_DZONGHKA_BHUTAN = 0x0851,
1872     TT_MS_LANGID_TIBETAN_BHUTAN = TT_MS_LANGID_DZONGHKA_BHUTAN,
1873     TT_MS_LANGID_WELSH_WALES = 0x0452,
1874     TT_MS_LANGID_KHMER_CAMBODIA = 0x0453,
1875     TT_MS_LANGID_LAO_LAOS = 0x0454,
1876     TT_MS_LANGID_BURMESE_MYANMAR = 0x0455,
1877     TT_MS_LANGID_GALICIAN_SPAIN = 0x0456,
1878     TT_MS_LANGID_KONKANI_INDIA = 0x0457,
1879     TT_MS_LANGID_MANIPURI_INDIA = 0x0458,
1880     TT_MS_LANGID_SINDHI_INDIA = 0x0459,
1881     TT_MS_LANGID_SINDHI_PAKISTAN = 0x0859,
1882     TT_MS_LANGID_SYRIAC_SYRIA = 0x045a,
1883     TT_MS_LANGID_SINHALESE_SRI_LANKA = 0x045b,
1884     TT_MS_LANGID_CHEROKEE_UNITED_STATES = 0x045c,
1885     TT_MS_LANGID_INUKTITUT_CANADA = 0x045d,
1886     TT_MS_LANGID_AMHARIC_ETHIOPIA = 0x045e,
1887     TT_MS_LANGID_TAMAZIGHT_MOROCCO = 0x045f,
1888     TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN = 0x085f,
1889     TT_MS_LANGID_KASHMIRI_PAKISTAN = 0x0460,
1890     TT_MS_LANGID_KASHMIRI_SASIA = 0x0860,
1891     TT_MS_LANGID_KASHMIRI_INDIA = TT_MS_LANGID_KASHMIRI_SASIA,
1892     TT_MS_LANGID_NEPALI_NEPAL = 0x0461,
1893     TT_MS_LANGID_NEPALI_INDIA = 0x0861,
1894     TT_MS_LANGID_FRISIAN_NETHERLANDS = 0x0462,
1895     TT_MS_LANGID_PASHTO_AFGHANISTAN = 0x0463,
1896     TT_MS_LANGID_FILIPINO_PHILIPPINES = 0x0464,
1897     TT_MS_LANGID_DHIVEHI_MALDIVES = 0x0465,
1898     TT_MS_LANGID_DIVEHI_MALDIVES = TT_MS_LANGID_DHIVEHI_MALDIVES,
1899     TT_MS_LANGID_EDO_NIGERIA = 0x0466,
1900     TT_MS_LANGID_FULFULDE_NIGERIA = 0x0467,
1901     TT_MS_LANGID_HAUSA_NIGERIA = 0x0468,
1902     TT_MS_LANGID_IBIBIO_NIGERIA = 0x0469,
1903     TT_MS_LANGID_YORUBA_NIGERIA = 0x046a,
1904     TT_MS_LANGID_QUECHUA_BOLIVIA = 0x046b,
1905     TT_MS_LANGID_QUECHUA_ECUADOR = 0x086b,
1906     TT_MS_LANGID_QUECHUA_PERU = 0x0c6b,
1907     TT_MS_LANGID_SEPEDI_SOUTH_AFRICA = 0x046c,
1908     TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA = TT_MS_LANGID_SEPEDI_SOUTH_AFRICA,
1909     TT_MS_LANGID_IGBO_NIGERIA = 0x0470,
1910     TT_MS_LANGID_KANURI_NIGERIA = 0x0471,
1911     TT_MS_LANGID_OROMO_ETHIOPIA = 0x0472,
1912     TT_MS_LANGID_TIGRIGNA_ETHIOPIA = 0x0473,
1913     TT_MS_LANGID_TIGRIGNA_ERYTHREA = 0x0873,
1914     TT_MS_LANGID_TIGRIGNA_ERYTREA = TT_MS_LANGID_TIGRIGNA_ERYTHREA,
1915     TT_MS_LANGID_GUARANI_PARAGUAY = 0x0474,
1916     TT_MS_LANGID_HAWAIIAN_UNITED_STATES = 0x0475,
1917     TT_MS_LANGID_LATIN = 0x0476,
1918     TT_MS_LANGID_SOMALI_SOMALIA = 0x0477,
1919     TT_MS_LANGID_YI_CHINA = 0x0478,
1920     TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES = 0x0479,
1921     TT_MS_LANGID_UIGHUR_CHINA = 0x0480,
1922     TT_MS_LANGID_MAORI_NEW_ZEALAND = 0x0481,
1923 }
1924 
1925 enum {
1926     TT_NAME_ID_COPYRIGHT = 0,
1927     TT_NAME_ID_FONT_FAMILY = 1,
1928     TT_NAME_ID_FONT_SUBFAMILY = 2,
1929     TT_NAME_ID_UNIQUE_ID = 3,
1930     TT_NAME_ID_FULL_NAME = 4,
1931     TT_NAME_ID_VERSION_STRING = 5,
1932     TT_NAME_ID_PS_NAME = 6,
1933     TT_NAME_ID_TRADEMARK = 7,
1934     TT_NAME_ID_MANUFACTURER = 8,
1935     TT_NAME_ID_DESIGNER = 9,
1936     TT_NAME_ID_DESCRIPTION = 10,
1937     TT_NAME_ID_VENDOR_URL = 11,
1938     TT_NAME_ID_DESIGNER_URL = 12,
1939     TT_NAME_ID_LICENSE = 13,
1940     TT_NAME_ID_LICENSE_URL = 14,
1941     TT_NAME_ID_PREFERRED_FAMILY = 16,
1942     TT_NAME_ID_PREFERRED_SUBFAMILY = 17,
1943     TT_NAME_ID_MAC_FULL_NAME = 18,
1944     TT_NAME_ID_SAMPLE_TEXT = 19,
1945     TT_NAME_ID_CID_FINDFONT_NAME = 20,
1946     TT_NAME_ID_WWS_FAMILY = 21,
1947     TT_NAME_ID_WWS_SUBFAMILY = 22,
1948 }
1949 
1950 enum {
1951     TT_UCR_BASIC_LATIN = 1 <<  0,
1952     TT_UCR_LATIN1_SUPPLEMENT = 1 <<  1,
1953     TT_UCR_LATIN_EXTENDED_A = 1 <<  2,
1954     TT_UCR_LATIN_EXTENDED_B = 1 <<  3,
1955     TT_UCR_IPA_EXTENSIONS = 1 <<  4,
1956     TT_UCR_SPACING_MODIFIER = 1 <<  5,
1957     TT_UCR_COMBINING_DIACRITICS = 1 <<  6,
1958     TT_UCR_GREEK = 1 <<  7,
1959     TT_UCR_COPTIC = 1 <<  8,
1960     TT_UCR_CYRILLIC = 1 <<  9,
1961     TT_UCR_ARMENIAN = 1 << 10,
1962     TT_UCR_HEBREW = 1 << 11,
1963     TT_UCR_VAI = 1 << 12,
1964     TT_UCR_ARABIC = 1 << 13,
1965     TT_UCR_NKO = 1 << 14,
1966     TT_UCR_DEVANAGARI = 1 << 15,
1967     TT_UCR_BENGALI = 1 << 16,
1968     TT_UCR_GURMUKHI = 1 << 17,
1969     TT_UCR_GUJARATI = 1 << 18,
1970     TT_UCR_ORIYA = 1 << 19,
1971     TT_UCR_TAMIL = 1 << 20,
1972     TT_UCR_TELUGU = 1 << 21,
1973     TT_UCR_KANNADA = 1 << 22,
1974     TT_UCR_MALAYALAM = 1 << 23,
1975     TT_UCR_THAI = 1 << 24,
1976     TT_UCR_LAO = 1 << 25,
1977     TT_UCR_GEORGIAN = 1 << 26,
1978     TT_UCR_BALINESE = 1 << 27,
1979     TT_UCR_HANGUL_JAMO = 1 << 28,
1980     TT_UCR_LATIN_EXTENDED_ADDITIONAL = 1 << 29,
1981     TT_UCR_GREEK_EXTENDED = 1 << 30,
1982     TT_UCR_SUPERSCRIPTS_SUBSCRIPTS = 1 <<  0,
1983     TT_UCR_CURRENCY_SYMBOLS = 1 <<  1,
1984     TT_UCR_COMBINING_DIACRITICS_SYMB = 1 <<  2,
1985     TT_UCR_LETTERLIKE_SYMBOLS = 1 <<  3,
1986     TT_UCR_NUMBER_FORMS = 1 <<  4,
1987     TT_UCR_ARROWS = 1 <<  5,
1988     TT_UCR_MATHEMATICAL_OPERATORS = 1 <<  6,
1989     TT_UCR_MISCELLANEOUS_TECHNICAL = 1 <<  7,
1990     TT_UCR_CONTROL_PICTURES = 1 <<  8,
1991     TT_UCR_OCR = 1 <<  9,
1992     TT_UCR_ENCLOSED_ALPHANUMERICS = 1 << 10,
1993     TT_UCR_BOX_DRAWING = 1 << 11,
1994     TT_UCR_BLOCK_ELEMENTS = 1 << 12,
1995     TT_UCR_GEOMETRIC_SHAPES = 1 << 13,
1996     TT_UCR_MISCELLANEOUS_SYMBOLS = 1 << 14,
1997     TT_UCR_DINGBATS = 1 << 15,
1998     TT_UCR_CJK_SYMBOLS = 1 << 16,
1999     TT_UCR_HIRAGANA = 1 << 17,
2000     TT_UCR_KATAKANA = 1 << 18,
2001     TT_UCR_BOPOMOFO = 1 << 19,
2002     TT_UCR_HANGUL_COMPATIBILITY_JAMO = 1 << 20,
2003     TT_UCR_CJK_MISC = 1 << 21,
2004     TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS = 1 << 22,
2005     TT_UCR_CJK_COMPATIBILITY = 1 << 23,
2006     TT_UCR_HANGUL = 1 << 24,
2007     TT_UCR_SURROGATES = 1 << 25,
2008     TT_UCR_NON_PLANE_0 = TT_UCR_SURROGATES,
2009     TT_UCR_PHOENICIAN = 1 << 26,
2010     TT_UCR_CJK_UNIFIED_IDEOGRAPHS = 1 << 27,
2011     TT_UCR_PRIVATE_USE = 1 << 28,
2012     TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS = 1 << 29,
2013     TT_UCR_ALPHABETIC_PRESENTATION_FORMS = 1 << 30,
2014     TT_UCR_ARABIC_PRESENTATIONS_A = 1 << 31,
2015     TT_UCR_COMBINING_HALF_MARKS = 1 <<  0,
2016     TT_UCR_CJK_COMPATIBILITY_FORMS = 1 <<  1,
2017     TT_UCR_SMALL_FORM_VARIANTS = 1 <<  2,
2018     TT_UCR_ARABIC_PRESENTATIONS_B = 1 <<  3,
2019     TT_UCR_HALFWIDTH_FULLWIDTH_FORMS = 1 <<  4,
2020     TT_UCR_SPECIALS = 1 <<  5,
2021     TT_UCR_TIBETAN = 1 <<  6,
2022     TT_UCR_SYRIAC = 1 <<  7,
2023     TT_UCR_THAANA = 1 <<  8,
2024     TT_UCR_SINHALA = 1 <<  9,
2025     TT_UCR_MYANMAR = 1 << 10,
2026     TT_UCR_ETHIOPIC = 1 << 11,
2027     TT_UCR_CHEROKEE = 1 << 12,
2028     TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS = 1 << 13,
2029     TT_UCR_OGHAM = 1 << 14,
2030     TT_UCR_RUNIC = 1 << 15,
2031     TT_UCR_KHMER = 1 << 16,
2032     TT_UCR_MONGOLIAN = 1 << 17,
2033     TT_UCR_BRAILLE = 1 << 18,
2034     TT_UCR_YI = 1 << 19,
2035     TT_UCR_PHILIPPINE = 1 << 20,
2036     TT_UCR_OLD_ITALIC = 1 << 21,
2037     TT_UCR_GOTHIC = 1 << 22,
2038     TT_UCR_DESERET = 1 << 23,
2039     TT_UCR_MUSICAL_SYMBOLS = 1 << 24,
2040     TT_UCR_MATH_ALPHANUMERIC_SYMBOLS = 1 << 25,
2041     TT_UCR_PRIVATE_USE_SUPPLEMENTARY = 1 << 26,
2042     TT_UCR_VARIATION_SELECTORS = 1 << 27,
2043     TT_UCR_TAGS = 1 << 28,
2044     TT_UCR_LIMBU = 1 << 29,
2045     TT_UCR_TAI_LE = 1 << 30,
2046     TT_UCR_NEW_TAI_LUE = 1 << 31,
2047     TT_UCR_BUGINESE = 1 <<  0,
2048     TT_UCR_GLAGOLITIC = 1 <<  1,
2049     TT_UCR_TIFINAGH = 1 <<  2,
2050     TT_UCR_YIJING = 1 <<  3,
2051     TT_UCR_SYLOTI_NAGRI = 1 <<  4,
2052     TT_UCR_LINEAR_B = 1 <<  5,
2053     TT_UCR_ANCIENT_GREEK_NUMBERS = 1 <<  6,
2054     TT_UCR_UGARITIC = 1 <<  7,
2055     TT_UCR_OLD_PERSIAN = 1 <<  8,
2056     TT_UCR_SHAVIAN = 1 <<  9,
2057     TT_UCR_OSMANYA = 1 << 10,
2058     TT_UCR_CYPRIOT_SYLLABARY = 1 << 11,
2059     TT_UCR_KHAROSHTHI = 1 << 12,
2060     TT_UCR_TAI_XUAN_JING = 1 << 13,
2061     TT_UCR_CUNEIFORM = 1 << 14,
2062     TT_UCR_COUNTING_ROD_NUMERALS = 1 << 15,
2063     TT_UCR_SUNDANESE = 1 << 16,
2064     TT_UCR_LEPCHA = 1 << 17,
2065     TT_UCR_OL_CHIKI = 1 << 18,
2066     TT_UCR_SAURASHTRA = 1 << 19,
2067     TT_UCR_KAYAH_LI = 1 << 20,
2068     TT_UCR_REJANG = 1 << 21,
2069     TT_UCR_CHAM = 1 << 22,
2070     TT_UCR_ANCIENT_SYMBOLS = 1 << 23,
2071     TT_UCR_PHAISTOS_DISC = 1 << 24,
2072     TT_UCR_OLD_ANATOLIAN = 1 << 25,
2073     TT_UCR_GAME_TILES = 1 << 26,
2074 }
2075 
2076 // tttables.h
2077 struct TT_Header {
2078     FT_Fixed Table_Version;
2079     FT_Fixed Font_Revision;
2080     FT_Long CheckSum_Adjust;
2081     FT_Long Magic_Number;
2082     FT_UShort Flags;
2083     FT_UShort Units_Per_EM;
2084     FT_Long[2] Created;
2085     FT_Long[2] Modified;
2086     FT_Short xMin;
2087     FT_Short yMin;
2088     FT_Short xMax;
2089     FT_Short yMax;
2090     FT_UShort Mac_Style;
2091     FT_UShort Lowest_Rec_PPEM;
2092     FT_Short Font_Direction;
2093     FT_Short Index_To_Loc_Format;
2094     FT_Short Glyph_Data_Format;
2095 }
2096 
2097 struct TT_HoriHeader {
2098     FT_Fixed Version;
2099     FT_Short Ascender;
2100     FT_Short Descender;
2101     FT_Short Line_Gap;
2102     FT_UShort advance_Width_Max;
2103     FT_Short min_Left_Side_Bearing;
2104     FT_Short min_Right_Side_Bearing;
2105     FT_Short xMax_Extent;
2106     FT_Short caret_Slope_Rise;
2107     FT_Short caret_Slope_Run;
2108     FT_Short caret_Offset;
2109     FT_Short[4] Reserved;
2110     FT_Short metric_Data_Format;
2111     FT_UShort number_Of_HMetrics;
2112     void* long_metrics;
2113     void* short_metrics;
2114 }
2115 
2116 struct TT_VertHeader {
2117     FT_Fixed Version;
2118     FT_Short Ascender;
2119     FT_Short Descender;
2120     FT_Short Line_Gap;
2121     FT_UShort advance_Height_Max;
2122     FT_Short min_Top_Side_Bearing;
2123     FT_Short min_Bottom_Side_Bearing;
2124     FT_Short yMax_Extent;
2125     FT_Short caret_Slope_Rise;
2126     FT_Short caret_Slope_Run;
2127     FT_Short caret_Offset;
2128     FT_Short[4] Reserved;
2129     FT_Short metric_Data_Format;
2130     FT_UShort number_Of_VMetrics;
2131     void* long_metrics;
2132     void* short_metrics;
2133 }
2134 
2135 struct TT_OS2 {
2136     FT_UShort _version;
2137     FT_Short xAvgCharWidth;
2138     FT_UShort usWeightClass;
2139     FT_UShort usWidthClass;
2140     FT_UShort fsType;
2141     FT_Short ySubscriptXSize;
2142     FT_Short ySubscriptYSize;
2143     FT_Short ySubscriptXOffset;
2144     FT_Short ySubscriptYOffset;
2145     FT_Short ySuperscriptXSize;
2146     FT_Short ySuperscriptYSize;
2147     FT_Short ySuperscriptXOffset;
2148     FT_Short ySuperscriptYOffset;
2149     FT_Short yStrikeoutSize;
2150     FT_Short yStrikeoutPosition;
2151     FT_Short sFamilyClass;
2152     FT_Byte[10] panose;
2153     FT_ULong ulUnicodeRange1;
2154     FT_ULong ulUnicodeRange2;
2155     FT_ULong ulUnicodeRange3;
2156     FT_ULong ulUnicodeRange4;
2157     FT_Char[4] achVendID;
2158     FT_UShort fsSelection;
2159     FT_UShort usFirstCharIndex;
2160     FT_UShort usLastCharIndex;
2161     FT_Short sTypoAscender;
2162     FT_Short sTypoDescender;
2163     FT_Short sTypoLineGap;
2164     FT_UShort usWinAscent;
2165     FT_UShort usWinDescent;
2166     FT_ULong ulCodePageRange1;
2167     FT_ULong ulCodePageRange2;
2168     FT_Short sxHeight;
2169     FT_Short sCapHeight;
2170     FT_UShort usDefaultChar;
2171     FT_UShort usBreakChar;
2172     FT_UShort usMaxContext;
2173     FT_UShort usLowerOpticalPointSize;
2174     FT_UShort usUpperOpticalPointSize;
2175 }
2176 
2177 struct TT_Postscript {
2178     FT_Fixed FormatType;
2179     FT_Fixed italicAngle;
2180     FT_Short underlinePosition;
2181     FT_Short underlineThickness;
2182     FT_ULong isFixedPitch;
2183     FT_ULong minMemType42;
2184     FT_ULong maxMemType42;
2185     FT_ULong minMemType1;
2186     FT_ULong maxMemType1;
2187 }
2188 
2189 struct TT_PCLT {
2190     FT_Fixed Version;
2191     FT_ULong FontNumber;
2192     FT_UShort Pitch;
2193     FT_UShort xHeight;
2194     FT_UShort Style;
2195     FT_UShort TypeFamily;
2196     FT_UShort CapHeight;
2197     FT_UShort SymbolSet;
2198     FT_Char[16] TypeFace;
2199     FT_Char[8] CharacterComplement;
2200     FT_Char[6] FileName;
2201     FT_Char StrokeWeight;
2202     FT_Char WidthType;
2203     FT_Byte SerifStyle;
2204     FT_Byte Reserved;
2205 }
2206 
2207 struct TT_MaxProfile {
2208     FT_Fixed _version;
2209     FT_UShort numGlyphs;
2210     FT_UShort maxPoints;
2211     FT_UShort maxContours;
2212     FT_UShort maxCompositePoints;
2213     FT_UShort maxCompositeContours;
2214     FT_UShort maxZones;
2215     FT_UShort maxTwilightPoints;
2216     FT_UShort maxStorage;
2217     FT_UShort maxFunctionDefs;
2218     FT_UShort maxInstructionDefs;
2219     FT_UShort maxStackElements;
2220     FT_UShort maxSizeOfInstructions;
2221     FT_UShort maxComponentElements;
2222     FT_UShort maxComponentDepth;
2223 }
2224 
2225 alias FT_Sfnt_Tag = int;
2226 enum {
2227     FT_SFNT_HEAD,
2228     FT_SFNT_MAXP,
2229     FT_SFNT_OS2,
2230     FT_SFNT_HHEA,
2231     FT_SFNT_VHEA,
2232     FT_SFNT_POST,
2233     FT_SFNT_PCLT,
2234     FT_SFNT_MAX
2235 }