Synchronize with FreeType.
[ttfautohint.git] / lib / taglobal.h
blobd3ba3185a013a28340ab5fa09dc07c0b6fda2d24
1 /* taglobal.h */
3 /*
4 * Copyright (C) 2011-2013 by Werner Lemberg.
6 * This file is part of the ttfautohint library, and may only be used,
7 * modified, and distributed under the terms given in `COPYING'. By
8 * continuing to use, modify, or distribute this file you indicate that you
9 * have read `COPYING' and understand and accept it fully.
11 * The file `COPYING' mentioned in the previous paragraph is distributed
12 * with the ttfautohint library.
16 /* originally file `afglobal.h' (2011-Mar-28) from FreeType */
18 /* heavily modified 2011 by Werner Lemberg <wl@gnu.org> */
20 #ifndef __TAGLOBAL_H__
21 #define __TAGLOBAL_H__
23 #include "ta.h"
24 #include "tatypes.h"
27 extern TA_WritingSystemClass const ta_writing_system_classes[];
28 extern TA_ScriptClass const ta_script_classes[];
30 #ifdef TA_DEBUG
31 extern const char* ta_script_names[];
32 #endif
35 /* Default values and flags for both autofitter globals */
36 /* (originally found in AF_ModuleRec, we use FONT instead) */
37 /* and face globals (in TA_FaceGlobalsRec). */
39 /* index of fallback script in `ta_script_classes' */
40 #define TA_SCRIPT_FALLBACK TA_SCRIPT_NONE
41 /* a bit mask indicating an uncovered glyph */
42 #define TA_SCRIPT_UNASSIGNED 0x7F
43 /* if this flag is set, we have an ASCII digit */
44 #define TA_DIGIT 0x80
46 /* `increase-x-height' property */
47 #define TA_PROP_INCREASE_X_HEIGHT_MIN 6
48 #define TA_PROP_INCREASE_X_HEIGHT_MAX 0
51 /* note that glyph_scripts[] maps each glyph to an index into the */
52 /* `ta_script_classes' array. */
53 typedef struct TA_FaceGlobalsRec_
55 FT_Face face;
56 FT_Long glyph_count; /* same as face->num_glyphs */
57 FT_Byte* glyph_scripts;
59 /* per-face auto-hinter properties */
60 FT_UInt increase_x_height;
62 TA_ScriptMetrics metrics[TA_SCRIPT_MAX];
64 FONT* font; /* to access global properties */
65 } TA_FaceGlobalsRec;
68 /* this models the global hints data for a given face, */
69 /* decomposed into script-specific items */
71 FT_Error
72 ta_face_globals_new(FT_Face face,
73 TA_FaceGlobals *aglobals,
74 FONT* font);
76 FT_Error
77 ta_face_globals_get_metrics(TA_FaceGlobals globals,
78 FT_UInt gindex,
79 FT_UInt options,
80 TA_ScriptMetrics *ametrics);
82 void
83 ta_face_globals_free(TA_FaceGlobals globals);
85 FT_Bool
86 ta_face_globals_is_digit(TA_FaceGlobals globals,
87 FT_UInt gindex);
89 #endif /* __TAGLOBAL_H__ */
91 /* end of taglobal.h */