ReactOS 0.4.15-dev-7958-gcd0bb1a
aflatin.h
Go to the documentation of this file.
1/***************************************************************************/
2/* */
3/* aflatin.h */
4/* */
5/* Auto-fitter hinting routines for latin writing system */
6/* (specification). */
7/* */
8/* Copyright 2003-2018 by */
9/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10/* */
11/* This file is part of the FreeType project, and may only be used, */
12/* modified, and distributed under the terms of the FreeType project */
13/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14/* this file you indicate that you have read the license and */
15/* understand and accept it fully. */
16/* */
17/***************************************************************************/
18
19
20#ifndef AFLATIN_H_
21#define AFLATIN_H_
22
23#include "afhints.h"
24
25
27
28 /* the `latin' writing system */
29
30 AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin_writing_system_class )
31
32
33 /* constants are given with units_per_em == 2048 in mind */
34#define AF_LATIN_CONSTANT( metrics, c ) \
35 ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
36
37
38 /*************************************************************************/
39 /*************************************************************************/
40 /***** *****/
41 /***** L A T I N G L O B A L M E T R I C S *****/
42 /***** *****/
43 /*************************************************************************/
44 /*************************************************************************/
45
46
47 /*
48 * The following declarations could be embedded in the file `aflatin.c';
49 * they have been made semi-public to allow alternate writing system
50 * hinters to re-use some of them.
51 */
52
53
54#define AF_LATIN_IS_TOP_BLUE( b ) \
55 ( (b)->properties & AF_BLUE_PROPERTY_LATIN_TOP )
56#define AF_LATIN_IS_SUB_TOP_BLUE( b ) \
57 ( (b)->properties & AF_BLUE_PROPERTY_LATIN_SUB_TOP )
58#define AF_LATIN_IS_NEUTRAL_BLUE( b ) \
59 ( (b)->properties & AF_BLUE_PROPERTY_LATIN_NEUTRAL )
60#define AF_LATIN_IS_X_HEIGHT_BLUE( b ) \
61 ( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT )
62#define AF_LATIN_IS_LONG_BLUE( b ) \
63 ( (b)->properties & AF_BLUE_PROPERTY_LATIN_LONG )
64
65#define AF_LATIN_MAX_WIDTHS 16
66
67
68#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
69#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */
70#define AF_LATIN_BLUE_SUB_TOP ( 1U << 2 ) /* we have a subscript top */
71 /* blue zone */
72#define AF_LATIN_BLUE_NEUTRAL ( 1U << 3 ) /* we have neutral blue zone */
73#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 4 ) /* used for scale adjustment */
74 /* optimization */
75
76
77 typedef struct AF_LatinBlueRec_
78 {
84
86
87
88 typedef struct AF_LatinAxisRec_
89 {
92
93 FT_UInt width_count; /* number of used widths */
95 FT_Pos edge_distance_threshold; /* used for creating edges */
96 FT_Pos standard_width; /* the default stem thickness */
97 FT_Bool extra_light; /* is standard width very light? */
98
99 /* ignored for horizontal metrics */
102
105
107
108
109 typedef struct AF_LatinMetricsRec_
110 {
114
116
117
120 FT_Face face );
121
122 FT_LOCAL( void )
124 AF_Scaler scaler );
125
126 FT_LOCAL( void )
128 FT_Face face );
129
130 FT_LOCAL( void )
132 FT_Face face );
133
134
135 /*************************************************************************/
136 /*************************************************************************/
137 /***** *****/
138 /***** L A T I N G L Y P H A N A L Y S I S *****/
139 /***** *****/
140 /*************************************************************************/
141 /*************************************************************************/
142
143#define AF_LATIN_HINTS_HORZ_SNAP ( 1U << 0 ) /* stem width snapping */
144#define AF_LATIN_HINTS_VERT_SNAP ( 1U << 1 ) /* stem height snapping */
145#define AF_LATIN_HINTS_STEM_ADJUST ( 1U << 2 ) /* stem width/height */
146 /* adjustment */
147#define AF_LATIN_HINTS_MONO ( 1U << 3 ) /* monochrome rendering */
148
149
150#define AF_LATIN_HINTS_DO_HORZ_SNAP( h ) \
151 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_HORZ_SNAP )
152
153#define AF_LATIN_HINTS_DO_VERT_SNAP( h ) \
154 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_VERT_SNAP )
155
156#define AF_LATIN_HINTS_DO_STEM_ADJUST( h ) \
157 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_STEM_ADJUST )
158
159#define AF_LATIN_HINTS_DO_MONO( h ) \
160 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_MONO )
161
162
163 /*
164 * The next functions shouldn't normally be exported. However, other
165 * writing systems might like to use these functions as-is.
166 */
169 AF_Dimension dim );
170
171 FT_LOCAL( void )
173 FT_UInt width_count,
174 AF_WidthRec* widths,
175 AF_Dimension dim );
176
179 AF_Dimension dim );
180
183 FT_UInt width_count,
184 AF_WidthRec* widths,
185 AF_Dimension dim );
186
187/* */
188
190
191#endif /* AFLATIN_H_ */
192
193
194/* END */
@ AF_BLUE_STRINGSET_MAX
Definition: afblue.h:388
FT_BEGIN_HEADER enum AF_Dimension_ AF_Dimension
@ AF_DIMENSION_MAX
Definition: afhints.h:40
af_latin_metrics_init(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:1113
struct AF_LatinBlueRec_ AF_LatinBlueRec
struct AF_LatinBlueRec_ * AF_LatinBlue
#define AF_LATIN_MAX_WIDTHS
Definition: aflatin.h:65
struct AF_LatinMetricsRec_ AF_LatinMetricsRec
af_latin_metrics_scale(AF_LatinMetrics metrics, AF_Scaler scaler)
Definition: aflatin.c:1459
af_latin_hints_link_segments(AF_GlyphHints hints, FT_UInt width_count, AF_WidthRec *widths, AF_Dimension dim)
Definition: aflatin.c:1927
af_latin_hints_compute_segments(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:1499
struct AF_LatinMetricsRec_ * AF_LatinMetrics
struct AF_LatinAxisRec_ * AF_LatinAxis
af_latin_metrics_init_widths(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:61
af_latin_metrics_check_digits(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:1054
af_latin_hints_compute_edges(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:2065
af_latin_hints_detect_features(AF_GlyphHints hints, FT_UInt width_count, AF_WidthRec *widths, AF_Dimension dim)
Definition: aflatin.c:2422
struct AF_LatinAxisRec_ AF_LatinAxisRec
#define AF_DECLARE_WRITING_SYSTEM_CLASS(writing_system_class)
Definition: aftypes.h:491
FT_BEGIN_HEADER struct AF_WidthRec_ AF_WidthRec
#define FT_LOCAL(x)
Definition: ftconfig.h:387
#define FT_END_HEADER
Definition: ftheader.h:54
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
signed long FT_Fixed
Definition: fttypes.h:288
int FT_Error
Definition: fttypes.h:300
unsigned int FT_UInt
Definition: fttypes.h:231
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
namespace GUID const ADDRINFOEXW * hints
Definition: sock.c:80
AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX]
Definition: aflatin.h:101
FT_Bool extra_light
Definition: aflatin.h:97
AF_WidthRec widths[AF_LATIN_MAX_WIDTHS]
Definition: aflatin.h:94
FT_Pos delta
Definition: aflatin.h:91
FT_Pos edge_distance_threshold
Definition: aflatin.h:95
FT_Pos standard_width
Definition: aflatin.h:96
FT_UInt width_count
Definition: aflatin.h:93
FT_Pos org_delta
Definition: aflatin.h:104
FT_Fixed scale
Definition: aflatin.h:90
FT_Fixed org_scale
Definition: aflatin.h:103
FT_UInt blue_count
Definition: aflatin.h:100
FT_UInt flags
Definition: aflatin.h:83
FT_Pos descender
Definition: aflatin.h:82
FT_Pos ascender
Definition: aflatin.h:81
AF_WidthRec ref
Definition: aflatin.h:79
AF_WidthRec shoot
Definition: aflatin.h:80
AF_StyleMetricsRec root
Definition: aflatin.h:111
FT_UInt units_per_em
Definition: aflatin.h:112
AF_LatinAxisRec axis[AF_DIMENSION_MAX]
Definition: aflatin.h:113