Formatting.
[ttfautohint.git] / lib / taglobal.h
blob702fbd7cbdf2479c15e0ec72340e0b67a3bd7acc
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"
25 #include "taharfbuzz.h"
28 extern TA_WritingSystemClass const ta_writing_system_classes[];
31 #undef SCRIPT
32 #define SCRIPT(s, S, d, h, sc1, sc2, sc3) \
33 extern const TA_ScriptClassRec ta_ ## s ## _script_class;
35 #include "ttfautohint-scripts.h"
37 extern TA_ScriptClass const ta_script_classes[];
40 #undef STYLE
41 #define STYLE(s, S, d, ws, sc, ss, c) \
42 extern const TA_StyleClassRec ta_ ## s ## _style_class;
44 #include "tastyles.h"
46 extern TA_StyleClass const ta_style_classes[];
49 #ifdef TA_DEBUG
50 extern const char* ta_style_names[];
51 #endif
54 /* Default values and flags for both autofitter globals */
55 /* (originally found in AF_ModuleRec, we use FONT instead) */
56 /* and face globals (in TA_FaceGlobalsRec). */
58 /* index of fallback style in `ta_style_classes' */
59 #define TA_STYLE_FALLBACK TA_STYLE_NONE_DFLT
60 /* default script for OpenType */
61 #define TA_SCRIPT_DEFAULT AF_SCRIPT_LATN
62 /* a bit mask indicating an uncovered glyph */
63 #define TA_STYLE_UNASSIGNED 0x7F
64 /* if this flag is set, we have an ASCII digit */
65 #define TA_DIGIT 0x80
67 /* `increase-x-height' property */
68 #define TA_PROP_INCREASE_X_HEIGHT_MIN 6
69 #define TA_PROP_INCREASE_X_HEIGHT_MAX 0
72 /* note that glyph_styles[] maps each glyph to an index into the */
73 /* `ta_style_classes' array. */
74 typedef struct TA_FaceGlobalsRec_
76 FT_Face face;
77 FT_Long glyph_count; /* same as face->num_glyphs */
78 FT_Byte* glyph_styles;
80 hb_font_t* hb_font;
82 /* per-face auto-hinter properties */
83 FT_UInt increase_x_height;
85 TA_StyleMetrics metrics[TA_STYLE_MAX];
87 FONT* font; /* to access global properties */
88 } TA_FaceGlobalsRec;
91 /* this models the global hints data for a given face, */
92 /* decomposed into style-specific items */
94 FT_Error
95 ta_face_globals_new(FT_Face face,
96 TA_FaceGlobals *aglobals,
97 FONT* font);
99 FT_Error
100 ta_face_globals_get_metrics(TA_FaceGlobals globals,
101 FT_UInt gindex,
102 FT_UInt options,
103 TA_StyleMetrics *ametrics);
105 void
106 ta_face_globals_free(TA_FaceGlobals globals);
108 FT_Bool
109 ta_face_globals_is_digit(TA_FaceGlobals globals,
110 FT_UInt gindex);
112 #endif /* __TAGLOBAL_H__ */
114 /* end of taglobal.h */