1 /***************************************************************************/
5 /* Auto-fitter data for blue strings (specification). */
7 /* Copyright 2013, 2014 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
26 /* an auxiliary macro to decode a UTF-8 character -- since we only use */
27 /* hard-coded, self-converted data, no error checking is performed */
28 #define GET_UTF8_CHAR( ch, p ) \
29 ch = (unsigned char)*p++; \
40 else if ( ch < 0xF0 ) \
51 for ( ; len > 0; len-- ) \
52 ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
56 /*************************************************************************/
57 /*************************************************************************/
59 /***** B L U E S T R I N G S *****/
61 /*************************************************************************/
62 /*************************************************************************/
64 /* At the bottommost level, we define strings for finding blue zones. */
67 #define AF_BLUE_STRING_MAX_LEN @AF_BLUE_STRING_MAX_LEN@
69 /* The AF_Blue_String enumeration values are offsets into the */
70 /* `af_blue_strings' array. */
72 typedef enum AF_Blue_String_
76 AF_BLUE_STRING_MAX /* do not remove */
81 FT_LOCAL_ARRAY( char )
85 /*************************************************************************/
86 /*************************************************************************/
88 /***** B L U E S T R I N G S E T S *****/
90 /*************************************************************************/
91 /*************************************************************************/
93 /* The next level is to group blue strings into style-specific sets. */
96 /* Properties are specific to a writing system. We assume that a given */
97 /* blue string can't be used in more than a single writing system, which */
99 #define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) /* must have value 1 */
100 #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1 << 1 )
101 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 2 )
102 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 3 )
104 #define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 ) /* must have value 1 */
105 #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 ) /* must have value 2 */
106 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
109 #define AF_BLUE_STRINGSET_MAX_LEN @AF_BLUE_STRINGSET_MAX_LEN@
111 /* The AF_Blue_Stringset enumeration values are offsets into the */
112 /* `af_blue_stringsets' array. */
114 typedef enum AF_Blue_Stringset_
116 @AF_BLUE_STRINGSET_ENUM@
118 AF_BLUE_STRINGSET_MAX /* do not remove */
123 typedef struct AF_Blue_StringRec_
125 AF_Blue_String string;
126 FT_UShort properties;
131 FT_LOCAL_ARRAY( AF_Blue_StringRec )
132 af_blue_stringsets[];
139 #endif /* __AFBLUE_H__ */