Synchronize with FreeType, part 2.
[ttfautohint.git] / lib / taglobal.h
blobd3b12d5d786dea29e4a2c1ca64bc5b2adc6d0287
1 /* taglobal.h */
3 /*
4 * Copyright (C) 2011-2014 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_StyleClass const ta_style_classes[];
31 #ifdef TA_DEBUG
32 extern const char* ta_style_names[];
33 #endif
36 /* Default values and flags for both autofitter globals */
37 /* (originally found in AF_ModuleRec, we use FONT instead) */
38 /* and face globals (in TA_FaceGlobalsRec). */
40 /* index of fallback style in `ta_style_classes' */
41 #define TA_STYLE_FALLBACK TA_STYLE_NONE
42 /* a bit mask indicating an uncovered glyph */
43 #define TA_STYLE_UNASSIGNED 0x7F
44 /* if this flag is set, we have an ASCII digit */
45 #define TA_DIGIT 0x80
47 /* `increase-x-height' property */
48 #define TA_PROP_INCREASE_X_HEIGHT_MIN 6
49 #define TA_PROP_INCREASE_X_HEIGHT_MAX 0
52 /* note that glyph_styles[] maps each glyph to an index into the */
53 /* `ta_style_classes' array. */
54 typedef struct TA_FaceGlobalsRec_
56 FT_Face face;
57 FT_Long glyph_count; /* same as face->num_glyphs */
58 FT_Byte* glyph_styles;
60 /* per-face auto-hinter properties */
61 FT_UInt increase_x_height;
63 TA_StyleMetrics metrics[TA_STYLE_MAX];
65 FONT* font; /* to access global properties */
66 } TA_FaceGlobalsRec;
69 /* this models the global hints data for a given face, */
70 /* decomposed into style-specific items */
72 FT_Error
73 ta_face_globals_new(FT_Face face,
74 TA_FaceGlobals *aglobals,
75 FONT* font);
77 FT_Error
78 ta_face_globals_get_metrics(TA_FaceGlobals globals,
79 FT_UInt gindex,
80 FT_UInt options,
81 TA_StyleMetrics *ametrics);
83 void
84 ta_face_globals_free(TA_FaceGlobals globals);
86 FT_Bool
87 ta_face_globals_is_digit(TA_FaceGlobals globals,
88 FT_UInt gindex);
90 #endif /* __TAGLOBAL_H__ */
92 /* end of taglobal.h */