Run `update-copyright'.
[ttfautohint.git] / lib / taglobal.h
blob9a34ecdb6ab7cf37a7bc950e5b9f8e165f06b6e2
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 /* Default values and flags for both autofitter globals */
28 /* (originally found in AF_ModuleRec, we use FONT instead) */
29 /* and face globals (in TA_FaceGlobalsRec). */
31 /* index of fallback script in `ta_script_classes' */
32 #define TA_SCRIPT_FALLBACK 0
33 /* a bit mask indicating an uncovered glyph */
34 #define TA_SCRIPT_NONE 0x7F
35 /* if this flag is set, we have an ASCII digit */
36 #define TA_DIGIT 0x80
38 /* `increase-x-height' property */
39 #define TA_PROP_INCREASE_X_HEIGHT_MIN 6
40 #define TA_PROP_INCREASE_X_HEIGHT_MAX 0
43 /* note that glyph_scripts[] is used to map each glyph into */
44 /* an index into the `ta_script_classes' array. */
45 typedef struct TA_FaceGlobalsRec_
47 FT_Face face;
48 FT_Long glyph_count; /* same as face->num_glyphs */
49 FT_Byte* glyph_scripts;
51 /* per-face auto-hinter properties */
52 FT_UInt increase_x_height;
54 TA_ScriptMetrics metrics[TA_SCRIPT_MAX];
56 FONT* font; /* to access global properties */
57 } TA_FaceGlobalsRec;
60 /* this models the global hints data for a given face, */
61 /* decomposed into script-specific items */
63 FT_Error
64 ta_face_globals_new(FT_Face face,
65 TA_FaceGlobals *aglobals,
66 FONT* font);
68 FT_Error
69 ta_face_globals_get_metrics(TA_FaceGlobals globals,
70 FT_UInt gindex,
71 FT_UInt options,
72 TA_ScriptMetrics *ametrics);
74 void
75 ta_face_globals_free(TA_FaceGlobals globals);
77 FT_Bool
78 ta_face_globals_is_digit(TA_FaceGlobals globals,
79 FT_UInt gindex);
81 #endif /* __TAGLOBAL_H__ */
83 /* end of taglobal.h */