Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
aflatin.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* aflatin.h */
4 /* */
5 /* Auto-fitter hinting routines for latin script (specification). */
6 /* */
7 /* Copyright 2003-2007, 2009, 2011-2012 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
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. */
15 /* */
16 /***************************************************************************/
17 
18 
19 #ifndef __AFLATIN_H__
20 #define __AFLATIN_H__
21 
22 #include "afhints.h"
23 
24 
26 
27 
28  /* the latin-specific script class */
29 
30  AF_DECLARE_SCRIPT_CLASS( af_latin_script_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 script hinters to
50  * re-use some of them.
51  */
52 
53 
54  /* Latin (global) metrics management */
55 
56  enum
57  {
64 
66  };
67 
68 
69 #define AF_LATIN_IS_TOP_BLUE( b ) ( (b) == AF_LATIN_BLUE_CAPITAL_TOP || \
70  (b) == AF_LATIN_BLUE_SMALL_F_TOP || \
71  (b) == AF_LATIN_BLUE_SMALL_TOP )
72 
73 #define AF_LATIN_MAX_WIDTHS 16
74 #define AF_LATIN_MAX_BLUES AF_LATIN_BLUE_MAX
75 
76 
77  enum
78  {
79  AF_LATIN_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */
80  AF_LATIN_BLUE_TOP = 1 << 1, /* result of AF_LATIN_IS_TOP_BLUE */
81  AF_LATIN_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
82  /* optimization */
84  };
85 
86 
87  typedef struct AF_LatinBlueRec_
88  {
92 
94 
95 
96  typedef struct AF_LatinAxisRec_
97  {
100 
101  FT_UInt width_count; /* number of used widths */
102  AF_WidthRec widths[AF_LATIN_MAX_WIDTHS]; /* widths array */
103  FT_Pos edge_distance_threshold; /* used for creating edges */
104  FT_Pos standard_width; /* the default stem thickness */
105  FT_Bool extra_light; /* is standard width very light? */
106 
107  /* ignored for horizontal metrics */
110 
113 
115 
116 
117  typedef struct AF_LatinMetricsRec_
118  {
122 
124 
125 
126  FT_LOCAL( FT_Error )
127  af_latin_metrics_init( AF_LatinMetrics metrics,
128  FT_Face face );
129 
130  FT_LOCAL( void )
131  af_latin_metrics_scale( AF_LatinMetrics metrics,
132  AF_Scaler scaler );
133 
134  FT_LOCAL( void )
135  af_latin_metrics_init_widths( AF_LatinMetrics metrics,
136  FT_Face face );
137 
138  FT_LOCAL( void )
139  af_latin_metrics_check_digits( AF_LatinMetrics metrics,
140  FT_Face face );
141 
142 
143  /*************************************************************************/
144  /*************************************************************************/
145  /***** *****/
146  /***** L A T I N G L Y P H A N A L Y S I S *****/
147  /***** *****/
148  /*************************************************************************/
149  /*************************************************************************/
150 
151  enum
152  {
153  AF_LATIN_HINTS_HORZ_SNAP = 1 << 0, /* enable stem width snapping */
154  AF_LATIN_HINTS_VERT_SNAP = 1 << 1, /* enable stem height snapping */
155  AF_LATIN_HINTS_STEM_ADJUST = 1 << 2, /* enable stem width/height */
156  /* adjustment */
157  AF_LATIN_HINTS_MONO = 1 << 3 /* indicate monochrome */
158  /* rendering */
159  };
160 
161 
162 #define AF_LATIN_HINTS_DO_HORZ_SNAP( h ) \
163  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_HORZ_SNAP )
164 
165 #define AF_LATIN_HINTS_DO_VERT_SNAP( h ) \
166  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_VERT_SNAP )
167 
168 #define AF_LATIN_HINTS_DO_STEM_ADJUST( h ) \
169  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_STEM_ADJUST )
170 
171 #define AF_LATIN_HINTS_DO_MONO( h ) \
172  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_MONO )
173 
174 
175  /*
176  * The next functions shouldn't normally be exported. However, other
177  * scripts might like to use these functions as-is.
178  */
179  FT_LOCAL( FT_Error )
181  AF_Dimension dim );
182 
183  FT_LOCAL( void )
185  AF_Dimension dim );
186 
187  FT_LOCAL( FT_Error )
189  AF_Dimension dim );
190 
191  FT_LOCAL( FT_Error )
193  AF_Dimension dim );
194 
195 /* */
196 
198 
199 #endif /* __AFLATIN_H__ */
200 
201 
202 /* END */
int FT_Error
Definition: fttypes.h:296
struct AF_LatinBlueRec_ AF_LatinBlueRec
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:59
AF_WidthRec ref
Definition: aflatin.h:89
#define FT_END_HEADER
Definition: ftheader.h:54
af_latin_metrics_scale(AF_LatinMetrics metrics, AF_Scaler scaler)
Definition: aflatin.c:769
#define AF_DECLARE_SCRIPT_CLASS(script_class)
Definition: aftypes.h:319
struct AF_LatinMetricsRec_ * AF_LatinMetrics
af_latin_metrics_init_widths(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:56
struct AF_LatinAxisRec_ AF_LatinAxisRec
FT_Bool extra_light
Definition: aflatin.h:105
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
AF_ScriptMetricsRec root
Definition: aflatin.h:119
GLenum GLuint GLint GLenum face
FT_UInt blue_count
Definition: aflatin.h:108
FT_Fixed scale
Definition: aflatin.h:98
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
#define AF_LATIN_MAX_WIDTHS
Definition: aflatin.h:73
AF_WidthRec shoot
Definition: aflatin.h:90
struct AF_LatinAxisRec_ * AF_LatinAxis
#define FT_LOCAL(x)
Definition: ftconfig.h:235
struct AF_LatinBlueRec_ * AF_LatinBlue
af_latin_hints_compute_edges(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:1106
FT_Pos org_delta
Definition: aflatin.h:112
af_latin_metrics_check_digits(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:501
FT_Pos delta
Definition: aflatin.h:99
af_latin_metrics_init(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:548
af_latin_hints_detect_features(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:1400
FT_BEGIN_HEADER enum AF_Dimension_ AF_Dimension
signed long FT_Fixed
Definition: fttypes.h:284
unsigned int FT_UInt
Definition: fttypes.h:227
FT_BEGIN_HEADER struct AF_WidthRec_ AF_WidthRec
af_latin_hints_compute_segments(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:793
FT_UInt width_count
Definition: aflatin.h:101
FT_Fixed org_scale
Definition: aflatin.h:111
FT_UInt flags
Definition: aflatin.h:91
FT_Pos edge_distance_threshold
Definition: aflatin.h:103
FT_UInt units_per_em
Definition: aflatin.h:120
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
af_latin_hints_link_segments(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:1013
struct AF_LatinMetricsRec_ AF_LatinMetricsRec
FT_Pos standard_width
Definition: aflatin.h:104