ReactOS 0.4.16-dev-1067-ge98bba2
afhints.h File Reference
#include "aftypes.h"
Include dependency graph for afhints.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AF_PointRec_
 
struct  AF_SegmentRec_
 
struct  AF_EdgeRec_
 
struct  AF_AxisHintsRec_
 
struct  AF_GlyphHintsRec_
 

Macros

#define xxAF_SORT_SEGMENTS
 
#define AF_FLAG_NONE   0
 
#define AF_FLAG_CONIC   ( 1U << 0 )
 
#define AF_FLAG_CUBIC   ( 1U << 1 )
 
#define AF_FLAG_CONTROL   ( AF_FLAG_CONIC | AF_FLAG_CUBIC )
 
#define AF_FLAG_TOUCH_X   ( 1U << 2 )
 
#define AF_FLAG_TOUCH_Y   ( 1U << 3 )
 
#define AF_FLAG_WEAK_INTERPOLATION   ( 1U << 4 )
 
#define AF_FLAG_NEAR   ( 1U << 5 )
 
#define AF_EDGE_NORMAL   0
 
#define AF_EDGE_ROUND   ( 1U << 0 )
 
#define AF_EDGE_SERIF   ( 1U << 1 )
 
#define AF_EDGE_DONE   ( 1U << 2 )
 
#define AF_EDGE_NEUTRAL   ( 1U << 3 ) /* edge aligns to a neutral blue zone */
 
#define AF_SEGMENTS_EMBEDDED   18 /* number of embedded segments */
 
#define AF_EDGES_EMBEDDED   12 /* number of embedded edges */
 
#define AF_POINTS_EMBEDDED   96 /* number of embedded points */
 
#define AF_CONTOURS_EMBEDDED   8 /* number of embedded contours */
 
#define AF_HINTS_TEST_SCALER(h, f)   ( (h)->scaler_flags & (f) )
 
#define AF_HINTS_TEST_OTHER(h, f)   ( (h)->other_flags & (f) )
 
#define AF_HINTS_DO_HORIZONTAL(h)    !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )
 
#define AF_HINTS_DO_VERTICAL(h)    !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL )
 
#define AF_HINTS_DO_BLUES(h)   1
 
#define AF_HINTS_DO_ADVANCE(h)    !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
 
#define AF_HINTS_DO_WARP(h)    !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_WARPER )
 
#define AF_SEGMENT_LEN(seg)   ( (seg)->max_coord - (seg)->min_coord )
 
#define AF_SEGMENT_DIST(seg1, seg2)
 

Typedefs

typedef FT_BEGIN_HEADER enum AF_Dimension_ AF_Dimension
 
typedef enum AF_Direction_ AF_Direction
 
typedef struct AF_PointRec_AF_Point
 
typedef struct AF_SegmentRec_AF_Segment
 
typedef struct AF_EdgeRec_AF_Edge
 
typedef struct AF_PointRec_ AF_PointRec
 
typedef struct AF_SegmentRec_ AF_SegmentRec
 
typedef struct AF_EdgeRec_ AF_EdgeRec
 
typedef struct AF_AxisHintsRec_ AF_AxisHintsRec
 
typedef struct AF_AxisHintsRec_AF_AxisHints
 
typedef struct AF_GlyphHintsRec_ AF_GlyphHintsRec
 

Enumerations

enum  AF_Dimension_ { AF_DIMENSION_HORZ = 0 , AF_DIMENSION_VERT = 1 , AF_DIMENSION_MAX }
 
enum  AF_Direction_ {
  AF_DIR_NONE = 4 , AF_DIR_RIGHT = 1 , AF_DIR_LEFT = -1 , AF_DIR_UP = 2 ,
  AF_DIR_DOWN = -2
}
 

Functions

 af_direction_compute (FT_Pos dx, FT_Pos dy)
 
 af_axis_hints_new_segment (AF_AxisHints axis, FT_Memory memory, AF_Segment *asegment)
 
 af_axis_hints_new_edge (AF_AxisHints axis, FT_Int fpos, AF_Direction dir, FT_Bool top_to_bottom_hinting, FT_Memory memory, AF_Edge *edge)
 
 af_glyph_hints_init (AF_GlyphHints hints, FT_Memory memory)
 
 af_glyph_hints_rescale (AF_GlyphHints hints, AF_StyleMetrics metrics)
 
 af_glyph_hints_reload (AF_GlyphHints hints, FT_Outline *outline)
 
 af_glyph_hints_save (AF_GlyphHints hints, FT_Outline *outline)
 
 af_glyph_hints_align_edge_points (AF_GlyphHints hints, AF_Dimension dim)
 
 af_glyph_hints_align_strong_points (AF_GlyphHints hints, AF_Dimension dim)
 
 af_glyph_hints_align_weak_points (AF_GlyphHints hints, AF_Dimension dim)
 
 af_glyph_hints_done (AF_GlyphHints hints)
 

Macro Definition Documentation

◆ AF_CONTOURS_EMBEDDED

#define AF_CONTOURS_EMBEDDED   8 /* number of embedded contours */

Definition at line 338 of file afhints.h.

◆ AF_EDGE_DONE

#define AF_EDGE_DONE   ( 1U << 2 )

Definition at line 232 of file afhints.h.

◆ AF_EDGE_NEUTRAL

#define AF_EDGE_NEUTRAL   ( 1U << 3 ) /* edge aligns to a neutral blue zone */

Definition at line 233 of file afhints.h.

◆ AF_EDGE_NORMAL

#define AF_EDGE_NORMAL   0

Definition at line 229 of file afhints.h.

◆ AF_EDGE_ROUND

#define AF_EDGE_ROUND   ( 1U << 0 )

Definition at line 230 of file afhints.h.

◆ AF_EDGE_SERIF

#define AF_EDGE_SERIF   ( 1U << 1 )

Definition at line 231 of file afhints.h.

◆ AF_EDGES_EMBEDDED

#define AF_EDGES_EMBEDDED   12 /* number of embedded edges */

Definition at line 309 of file afhints.h.

◆ AF_FLAG_CONIC

#define AF_FLAG_CONIC   ( 1U << 0 )

Definition at line 213 of file afhints.h.

◆ AF_FLAG_CONTROL

#define AF_FLAG_CONTROL   ( AF_FLAG_CONIC | AF_FLAG_CUBIC )

Definition at line 215 of file afhints.h.

◆ AF_FLAG_CUBIC

#define AF_FLAG_CUBIC   ( 1U << 1 )

Definition at line 214 of file afhints.h.

◆ AF_FLAG_NEAR

#define AF_FLAG_NEAR   ( 1U << 5 )

Definition at line 225 of file afhints.h.

◆ AF_FLAG_NONE

#define AF_FLAG_NONE   0

Definition at line 210 of file afhints.h.

◆ AF_FLAG_TOUCH_X

#define AF_FLAG_TOUCH_X   ( 1U << 2 )

Definition at line 218 of file afhints.h.

◆ AF_FLAG_TOUCH_Y

#define AF_FLAG_TOUCH_Y   ( 1U << 3 )

Definition at line 219 of file afhints.h.

◆ AF_FLAG_WEAK_INTERPOLATION

#define AF_FLAG_WEAK_INTERPOLATION   ( 1U << 4 )

Definition at line 222 of file afhints.h.

◆ AF_HINTS_DO_ADVANCE

#define AF_HINTS_DO_ADVANCE (   h)     !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )

Definition at line 408 of file afhints.h.

◆ AF_HINTS_DO_BLUES

#define AF_HINTS_DO_BLUES (   h)    1

Definition at line 403 of file afhints.h.

◆ AF_HINTS_DO_HORIZONTAL

#define AF_HINTS_DO_HORIZONTAL (   h)     !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )

Definition at line 397 of file afhints.h.

◆ AF_HINTS_DO_VERTICAL

#define AF_HINTS_DO_VERTICAL (   h)     !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL )

Definition at line 400 of file afhints.h.

◆ AF_HINTS_DO_WARP

#define AF_HINTS_DO_WARP (   h)     !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_WARPER )

Definition at line 411 of file afhints.h.

◆ AF_HINTS_TEST_OTHER

#define AF_HINTS_TEST_OTHER (   h,
  f 
)    ( (h)->other_flags & (f) )

Definition at line 380 of file afhints.h.

◆ AF_HINTS_TEST_SCALER

#define AF_HINTS_TEST_SCALER (   h,
  f 
)    ( (h)->scaler_flags & (f) )

Definition at line 379 of file afhints.h.

◆ AF_POINTS_EMBEDDED

#define AF_POINTS_EMBEDDED   96 /* number of embedded points */

Definition at line 337 of file afhints.h.

◆ AF_SEGMENT_DIST

#define AF_SEGMENT_DIST (   seg1,
  seg2 
)
Value:
( ( (seg1)->pos > (seg2)->pos ) \
? (seg1)->pos - (seg2)->pos \
: (seg2)->pos - (seg1)->pos )

Definition at line 477 of file afhints.h.

◆ AF_SEGMENT_LEN

#define AF_SEGMENT_LEN (   seg)    ( (seg)->max_coord - (seg)->min_coord )

Definition at line 475 of file afhints.h.

◆ AF_SEGMENTS_EMBEDDED

#define AF_SEGMENTS_EMBEDDED   18 /* number of embedded segments */

Definition at line 308 of file afhints.h.

◆ xxAF_SORT_SEGMENTS

#define xxAF_SORT_SEGMENTS

Definition at line 24 of file afhints.h.

Typedef Documentation

◆ AF_AxisHints

◆ AF_AxisHintsRec

◆ AF_Dimension

◆ AF_Direction

◆ AF_Edge

Definition at line 238 of file afhints.h.

◆ AF_EdgeRec

◆ AF_GlyphHintsRec

◆ AF_Point

Definition at line 236 of file afhints.h.

◆ AF_PointRec

◆ AF_Segment

Definition at line 237 of file afhints.h.

◆ AF_SegmentRec

Enumeration Type Documentation

◆ AF_Dimension_

Enumerator
AF_DIMENSION_HORZ 
AF_DIMENSION_VERT 
AF_DIMENSION_MAX 

Definition at line 33 of file afhints.h.

34 {
35 AF_DIMENSION_HORZ = 0, /* x coordinates, */
36 /* i.e., vertical segments & edges */
37 AF_DIMENSION_VERT = 1, /* y coordinates, */
38 /* i.e., horizontal segments & edges */
39
40 AF_DIMENSION_MAX /* do not remove */
41
FT_BEGIN_HEADER enum AF_Dimension_ AF_Dimension
@ AF_DIMENSION_HORZ
Definition: afhints.h:35
@ AF_DIMENSION_MAX
Definition: afhints.h:40
@ AF_DIMENSION_VERT
Definition: afhints.h:37

◆ AF_Direction_

Enumerator
AF_DIR_NONE 
AF_DIR_RIGHT 
AF_DIR_LEFT 
AF_DIR_UP 
AF_DIR_DOWN 

Definition at line 47 of file afhints.h.

48 {
49 AF_DIR_NONE = 4,
50 AF_DIR_RIGHT = 1,
51 AF_DIR_LEFT = -1,
52 AF_DIR_UP = 2,
53 AF_DIR_DOWN = -2
54
enum AF_Direction_ AF_Direction
@ AF_DIR_RIGHT
Definition: afhints.h:50
@ AF_DIR_DOWN
Definition: afhints.h:53
@ AF_DIR_UP
Definition: afhints.h:52
@ AF_DIR_LEFT
Definition: afhints.h:51
@ AF_DIR_NONE
Definition: afhints.h:49

Function Documentation

◆ af_axis_hints_new_edge()

af_axis_hints_new_edge ( AF_AxisHints  axis,
FT_Int  fpos,
AF_Direction  dir,
FT_Bool  top_to_bottom_hinting,
FT_Memory  memory,
AF_Edge edge 
)

Definition at line 99 of file afhints.c.

105 {
107 AF_Edge edge = NULL;
108 AF_Edge edges;
109
110
111 if ( axis->num_edges < AF_EDGES_EMBEDDED )
112 {
113 if ( !axis->edges )
114 {
115 axis->edges = axis->embedded.edges;
117 }
118 }
119 else if ( axis->num_edges >= axis->max_edges )
120 {
121 FT_Int old_max = axis->max_edges;
122 FT_Int new_max = old_max;
123 FT_Int big_max = (FT_Int)( FT_INT_MAX / sizeof ( *edge ) );
124
125
126 if ( old_max >= big_max )
127 {
128 error = FT_THROW( Out_Of_Memory );
129 goto Exit;
130 }
131
132 new_max += ( new_max >> 2 ) + 4;
133 if ( new_max < old_max || new_max > big_max )
134 new_max = big_max;
135
136 if ( axis->edges == axis->embedded.edges )
137 {
138 if ( FT_NEW_ARRAY( axis->edges, new_max ) )
139 goto Exit;
140 ft_memcpy( axis->edges, axis->embedded.edges,
141 sizeof ( axis->embedded.edges ) );
142 }
143 else
144 {
145 if ( FT_RENEW_ARRAY( axis->edges, old_max, new_max ) )
146 goto Exit;
147 }
148
149 axis->max_edges = new_max;
150 }
151
152 edges = axis->edges;
153 edge = edges + axis->num_edges;
154
155 while ( edge > edges )
156 {
157 if ( top_to_bottom_hinting ? ( edge[-1].fpos > fpos )
158 : ( edge[-1].fpos < fpos ) )
159 break;
160
161 /* we want the edge with same position and minor direction */
162 /* to appear before those in the major one in the list */
163 if ( edge[-1].fpos == fpos && dir == axis->major_dir )
164 break;
165
166 edge[0] = edge[-1];
167 edge--;
168 }
169
170 axis->num_edges++;
171
172 Exit:
173 *anedge = edge;
174 return error;
175 }
#define AF_EDGES_EMBEDDED
Definition: afhints.h:309
unsigned int dir
Definition: maze.c:112
#define NULL
Definition: types.h:112
return FT_Err_Ok
Definition: ftbbox.c:527
#define FT_THROW(e)
Definition: ftdebug.h:241
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:332
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
Definition: ftmemory.h:335
#define ft_memcpy
Definition: ftstdlib.h:82
#define FT_INT_MAX
Definition: ftstdlib.h:63
int FT_Error
Definition: fttypes.h:299
signed int FT_Int
Definition: fttypes.h:220
#define error(str)
Definition: mkdosfs.c:1605
static void Exit(void)
Definition: sock.c:1330
FT_Int num_edges
Definition: afhints.h:320
AF_Edge edges
Definition: afhints.h:322
AF_Direction major_dir
Definition: afhints.h:324
FT_Int max_edges
Definition: afhints.h:321
struct AF_AxisHintsRec_::@4365 embedded
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by af_latin_hints_compute_edges().

◆ af_axis_hints_new_segment()

af_axis_hints_new_segment ( AF_AxisHints  axis,
FT_Memory  memory,
AF_Segment asegment 
)

Definition at line 38 of file afhints.c.

41 {
43 AF_Segment segment = NULL;
44
45
47 {
48 if ( !axis->segments )
49 {
50 axis->segments = axis->embedded.segments;
52 }
53 }
54 else if ( axis->num_segments >= axis->max_segments )
55 {
56 FT_Int old_max = axis->max_segments;
57 FT_Int new_max = old_max;
58 FT_Int big_max = (FT_Int)( FT_INT_MAX / sizeof ( *segment ) );
59
60
61 if ( old_max >= big_max )
62 {
63 error = FT_THROW( Out_Of_Memory );
64 goto Exit;
65 }
66
67 new_max += ( new_max >> 2 ) + 4;
68 if ( new_max < old_max || new_max > big_max )
69 new_max = big_max;
70
71 if ( axis->segments == axis->embedded.segments )
72 {
73 if ( FT_NEW_ARRAY( axis->segments, new_max ) )
74 goto Exit;
75 ft_memcpy( axis->segments, axis->embedded.segments,
76 sizeof ( axis->embedded.segments ) );
77 }
78 else
79 {
80 if ( FT_RENEW_ARRAY( axis->segments, old_max, new_max ) )
81 goto Exit;
82 }
83
84 axis->max_segments = new_max;
85 }
86
87 segment = axis->segments + axis->num_segments++;
88
89 Exit:
90 *asegment = segment;
91 return error;
92 }
#define AF_SEGMENTS_EMBEDDED
Definition: afhints.h:308
AF_Segment segments
Definition: afhints.h:315
FT_Int num_segments
Definition: afhints.h:313
FT_Int max_segments
Definition: afhints.h:314

Referenced by af_latin_hints_compute_segments().

◆ af_direction_compute()

af_direction_compute ( FT_Pos  dx,
FT_Pos  dy 
)

Definition at line 643 of file afhints.c.

645 {
646 FT_Pos ll, ss; /* long and short arm lengths */
647 AF_Direction dir; /* candidate direction */
648
649
650 if ( dy >= dx )
651 {
652 if ( dy >= -dx )
653 {
654 dir = AF_DIR_UP;
655 ll = dy;
656 ss = dx;
657 }
658 else
659 {
661 ll = -dx;
662 ss = dy;
663 }
664 }
665 else /* dy < dx */
666 {
667 if ( dy >= -dx )
668 {
670 ll = dx;
671 ss = dy;
672 }
673 else
674 {
676 ll = -dy;
677 ss = dx;
678 }
679 }
680
681 /* return no direction if arm lengths do not differ enough */
682 /* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */
683 /* the long arm is never negative */
684 if ( ll <= 14 * FT_ABS( ss ) )
686
687 return dir;
688 }
w ll
Definition: byte_order.h:167
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
#define FT_ABS(a)
Definition: ftobjs.h:73
#define ss
Definition: i386-dis.c:441
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97

Referenced by af_glyph_hints_reload().

◆ af_glyph_hints_align_edge_points()

af_glyph_hints_align_edge_points ( AF_GlyphHints  hints,
AF_Dimension  dim 
)

Definition at line 1219 of file afhints.c.

1221 {
1222 AF_AxisHints axis = & hints->axis[dim];
1223 AF_Segment segments = axis->segments;
1224 AF_Segment segment_limit = segments + axis->num_segments;
1225 AF_Segment seg;
1226
1227
1228 if ( dim == AF_DIMENSION_HORZ )
1229 {
1230 for ( seg = segments; seg < segment_limit; seg++ )
1231 {
1232 AF_Edge edge = seg->edge;
1234
1235
1236 if ( !edge )
1237 continue;
1238
1239 first = seg->first;
1240 last = seg->last;
1241 point = first;
1242 for (;;)
1243 {
1244 point->x = edge->pos;
1245 point->flags |= AF_FLAG_TOUCH_X;
1246
1247 if ( point == last )
1248 break;
1249
1250 point = point->next;
1251 }
1252 }
1253 }
1254 else
1255 {
1256 for ( seg = segments; seg < segment_limit; seg++ )
1257 {
1258 AF_Edge edge = seg->edge;
1260
1261
1262 if ( !edge )
1263 continue;
1264
1265 first = seg->first;
1266 last = seg->last;
1267 point = first;
1268 for (;;)
1269 {
1270 point->y = edge->pos;
1271 point->flags |= AF_FLAG_TOUCH_Y;
1272
1273 if ( point == last )
1274 break;
1275
1276 point = point->next;
1277 }
1278 }
1279 }
1280 }
#define AF_FLAG_TOUCH_Y
Definition: afhints.h:219
#define AF_FLAG_TOUCH_X
Definition: afhints.h:218
POINTL point
Definition: edittest.c:50
const GLint * first
Definition: glext.h:5794
static UINT UINT last
Definition: font.c:45
namespace GUID const ADDRINFOEXW * hints
Definition: sock.c:80
FT_Pos pos
Definition: afhints.h:292
AF_Point last
Definition: afhints.h:283
AF_Point first
Definition: afhints.h:282
AF_Edge edge
Definition: afhints.h:274
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329

Referenced by af_latin_hints_apply().

◆ af_glyph_hints_align_strong_points()

af_glyph_hints_align_strong_points ( AF_GlyphHints  hints,
AF_Dimension  dim 
)

Definition at line 1294 of file afhints.c.

1296 {
1297 AF_Point points = hints->points;
1298 AF_Point point_limit = points + hints->num_points;
1299 AF_AxisHints axis = &hints->axis[dim];
1300 AF_Edge edges = axis->edges;
1301 AF_Edge edge_limit = edges + axis->num_edges;
1302 FT_UInt touch_flag;
1303
1304
1305 if ( dim == AF_DIMENSION_HORZ )
1306 touch_flag = AF_FLAG_TOUCH_X;
1307 else
1308 touch_flag = AF_FLAG_TOUCH_Y;
1309
1310 if ( edges < edge_limit )
1311 {
1313 AF_Edge edge;
1314
1315
1316 for ( point = points; point < point_limit; point++ )
1317 {
1318 FT_Pos u, ou, fu; /* point position */
1319 FT_Pos delta;
1320
1321
1322 if ( point->flags & touch_flag )
1323 continue;
1324
1325 /* if this point is candidate to weak interpolation, we */
1326 /* interpolate it after all strong points have been processed */
1327
1328 if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) )
1329 continue;
1330
1331 if ( dim == AF_DIMENSION_VERT )
1332 {
1333 u = point->fy;
1334 ou = point->oy;
1335 }
1336 else
1337 {
1338 u = point->fx;
1339 ou = point->ox;
1340 }
1341
1342 fu = u;
1343
1344 /* is the point before the first edge? */
1345 edge = edges;
1346 delta = edge->fpos - u;
1347 if ( delta >= 0 )
1348 {
1349 u = edge->pos - ( edge->opos - ou );
1350
1351#ifdef FT_DEBUG_AUTOFIT
1352 point->before[dim] = edge;
1353 point->after[dim] = NULL;
1354#endif
1355
1356 goto Store_Point;
1357 }
1358
1359 /* is the point after the last edge? */
1360 edge = edge_limit - 1;
1361 delta = u - edge->fpos;
1362 if ( delta >= 0 )
1363 {
1364 u = edge->pos + ( ou - edge->opos );
1365
1366#ifdef FT_DEBUG_AUTOFIT
1367 point->before[dim] = NULL;
1368 point->after[dim] = edge;
1369#endif
1370
1371 goto Store_Point;
1372 }
1373
1374 {
1375 FT_PtrDist min, max, mid;
1376 FT_Pos fpos;
1377
1378
1379 /* find enclosing edges */
1380 min = 0;
1381 max = edge_limit - edges;
1382
1383#if 1
1384 /* for a small number of edges, a linear search is better */
1385 if ( max <= 8 )
1386 {
1387 FT_PtrDist nn;
1388
1389
1390 for ( nn = 0; nn < max; nn++ )
1391 if ( edges[nn].fpos >= u )
1392 break;
1393
1394 if ( edges[nn].fpos == u )
1395 {
1396 u = edges[nn].pos;
1397 goto Store_Point;
1398 }
1399 min = nn;
1400 }
1401 else
1402#endif
1403 while ( min < max )
1404 {
1405 mid = ( max + min ) >> 1;
1406 edge = edges + mid;
1407 fpos = edge->fpos;
1408
1409 if ( u < fpos )
1410 max = mid;
1411 else if ( u > fpos )
1412 min = mid + 1;
1413 else
1414 {
1415 /* we are on the edge */
1416 u = edge->pos;
1417
1418#ifdef FT_DEBUG_AUTOFIT
1419 point->before[dim] = NULL;
1420 point->after[dim] = NULL;
1421#endif
1422
1423 goto Store_Point;
1424 }
1425 }
1426
1427 /* point is not on an edge */
1428 {
1429 AF_Edge before = edges + min - 1;
1430 AF_Edge after = edges + min + 0;
1431
1432
1433#ifdef FT_DEBUG_AUTOFIT
1434 point->before[dim] = before;
1435 point->after[dim] = after;
1436#endif
1437
1438 /* assert( before && after && before != after ) */
1439 if ( before->scale == 0 )
1440 before->scale = FT_DivFix( after->pos - before->pos,
1441 after->fpos - before->fpos );
1442
1443 u = before->pos + FT_MulFix( fu - before->fpos,
1444 before->scale );
1445 }
1446 }
1447
1448 Store_Point:
1449 /* save the point position */
1450 if ( dim == AF_DIMENSION_HORZ )
1451 point->x = u;
1452 else
1453 point->y = u;
1454
1455 point->flags |= touch_flag;
1456 }
1457 }
1458 }
#define AF_FLAG_WEAK_INTERPOLATION
Definition: afhints.h:222
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:608
FT_MulFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:509
ft_ptrdiff_t FT_PtrDist
Definition: fttypes.h:336
unsigned int FT_UInt
Definition: fttypes.h:231
GLsizei const GLfloat * points
Definition: glext.h:8112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define min(a, b)
Definition: monoChain.cc:55
FT_Short fpos
Definition: afhints.h:290
FT_Pos opos
Definition: afhints.h:291
#define max(a, b)
Definition: svc.c:63
__inline int before(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2390
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2395

Referenced by af_latin_hints_apply().

◆ af_glyph_hints_align_weak_points()

af_glyph_hints_align_weak_points ( AF_GlyphHints  hints,
AF_Dimension  dim 
)

Definition at line 1568 of file afhints.c.

1570 {
1571 AF_Point points = hints->points;
1572 AF_Point point_limit = points + hints->num_points;
1573 AF_Point* contour = hints->contours;
1574 AF_Point* contour_limit = contour + hints->num_contours;
1575 FT_UInt touch_flag;
1577 AF_Point end_point;
1578 AF_Point first_point;
1579
1580
1581 /* PASS 1: Move segment points to edge positions */
1582
1583 if ( dim == AF_DIMENSION_HORZ )
1584 {
1585 touch_flag = AF_FLAG_TOUCH_X;
1586
1587 for ( point = points; point < point_limit; point++ )
1588 {
1589 point->u = point->x;
1590 point->v = point->ox;
1591 }
1592 }
1593 else
1594 {
1595 touch_flag = AF_FLAG_TOUCH_Y;
1596
1597 for ( point = points; point < point_limit; point++ )
1598 {
1599 point->u = point->y;
1600 point->v = point->oy;
1601 }
1602 }
1603
1604 for ( ; contour < contour_limit; contour++ )
1605 {
1606 AF_Point first_touched, last_touched;
1607
1608
1609 point = *contour;
1610 end_point = point->prev;
1611 first_point = point;
1612
1613 /* find first touched point */
1614 for (;;)
1615 {
1616 if ( point > end_point ) /* no touched point in contour */
1617 goto NextContour;
1618
1619 if ( point->flags & touch_flag )
1620 break;
1621
1622 point++;
1623 }
1624
1625 first_touched = point;
1626
1627 for (;;)
1628 {
1629 FT_ASSERT( point <= end_point &&
1630 ( point->flags & touch_flag ) != 0 );
1631
1632 /* skip any touched neighbours */
1633 while ( point < end_point &&
1634 ( point[1].flags & touch_flag ) != 0 )
1635 point++;
1636
1637 last_touched = point;
1638
1639 /* find the next touched point, if any */
1640 point++;
1641 for (;;)
1642 {
1643 if ( point > end_point )
1644 goto EndContour;
1645
1646 if ( ( point->flags & touch_flag ) != 0 )
1647 break;
1648
1649 point++;
1650 }
1651
1652 /* interpolate between last_touched and point */
1653 af_iup_interp( last_touched + 1, point - 1,
1654 last_touched, point );
1655 }
1656
1657 EndContour:
1658 /* special case: only one point was touched */
1659 if ( last_touched == first_touched )
1660 af_iup_shift( first_point, end_point, first_touched );
1661
1662 else /* interpolate the last part */
1663 {
1664 if ( last_touched < end_point )
1665 af_iup_interp( last_touched + 1, end_point,
1666 last_touched, first_touched );
1667
1668 if ( first_touched > points )
1669 af_iup_interp( first_point, first_touched - 1,
1670 last_touched, first_touched );
1671 }
1672
1673 NextContour:
1674 ;
1675 }
1676
1677 /* now save the interpolated values back to x/y */
1678 if ( dim == AF_DIMENSION_HORZ )
1679 {
1680 for ( point = points; point < point_limit; point++ )
1681 point->x = point->u;
1682 }
1683 else
1684 {
1685 for ( point = points; point < point_limit; point++ )
1686 point->y = point->u;
1687 }
1688 }
static void af_iup_interp(AF_Point p1, AF_Point p2, AF_Point ref1, AF_Point ref2)
Definition: afhints.c:1500
static void af_iup_shift(AF_Point p1, AF_Point p2, AF_Point ref)
Definition: afhints.c:1473
#define FT_ASSERT(condition)
Definition: ftdebug.h:239
GLbitfield flags
Definition: glext.h:7161

Referenced by af_latin_hints_apply().

◆ af_glyph_hints_done()

af_glyph_hints_done ( AF_GlyphHints  hints)

Definition at line 702 of file afhints.c.

703 {
705 int dim;
706
707
708 if ( !( hints && hints->memory ) )
709 return;
710
711 memory = hints->memory;
712
713 /*
714 * note that we don't need to free the segment and edge
715 * buffers since they are really within the hints->points array
716 */
717 for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
718 {
719 AF_AxisHints axis = &hints->axis[dim];
720
721
722 axis->num_segments = 0;
723 axis->max_segments = 0;
724 if ( axis->segments != axis->embedded.segments )
725 FT_FREE( axis->segments );
726
727 axis->num_edges = 0;
728 axis->max_edges = 0;
729 if ( axis->edges != axis->embedded.edges )
730 FT_FREE( axis->edges );
731 }
732
733 if ( hints->contours != hints->embedded.contours )
734 FT_FREE( hints->contours );
735 hints->max_contours = 0;
736 hints->num_contours = 0;
737
738 if ( hints->points != hints->embedded.points )
739 FT_FREE( hints->points );
740 hints->max_points = 0;
741 hints->num_points = 0;
742
743 hints->memory = NULL;
744 }
#define FT_FREE(ptr)
Definition: ftmemory.h:328
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
static char memory[1024 *256]
Definition: process.c:116

Referenced by af_autofitter_done(), af_autofitter_load_glyph(), and af_latin_metrics_init_widths().

◆ af_glyph_hints_init()

af_glyph_hints_init ( AF_GlyphHints  hints,
FT_Memory  memory 
)

Definition at line 692 of file afhints.c.

694 {
695 /* no need to initialize the embedded items */
696 FT_MEM_ZERO( hints, sizeof ( *hints ) - sizeof ( hints->embedded ) );
697 hints->memory = memory;
698 }
#define FT_MEM_ZERO(dest, count)
Definition: ftmemory.h:235

Referenced by af_autofitter_load_glyph(), and af_latin_metrics_init_widths().

◆ af_glyph_hints_reload()

af_glyph_hints_reload ( AF_GlyphHints  hints,
FT_Outline outline 
)

Definition at line 762 of file afhints.c.

764 {
767 FT_UInt old_max, new_max;
768 FT_Fixed x_scale = hints->x_scale;
769 FT_Fixed y_scale = hints->y_scale;
770 FT_Pos x_delta = hints->x_delta;
771 FT_Pos y_delta = hints->y_delta;
772 FT_Memory memory = hints->memory;
773
774
775 hints->num_points = 0;
776 hints->num_contours = 0;
777
778 hints->axis[0].num_segments = 0;
779 hints->axis[0].num_edges = 0;
780 hints->axis[1].num_segments = 0;
781 hints->axis[1].num_edges = 0;
782
783 /* first of all, reallocate the contours array if necessary */
784 new_max = (FT_UInt)outline->n_contours;
785 old_max = (FT_UInt)hints->max_contours;
786
787 if ( new_max <= AF_CONTOURS_EMBEDDED )
788 {
789 if ( !hints->contours )
790 {
791 hints->contours = hints->embedded.contours;
792 hints->max_contours = AF_CONTOURS_EMBEDDED;
793 }
794 }
795 else if ( new_max > old_max )
796 {
797 if ( hints->contours == hints->embedded.contours )
798 hints->contours = NULL;
799
800 new_max = ( new_max + 3 ) & ~3U; /* round up to a multiple of 4 */
801
802 if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )
803 goto Exit;
804
805 hints->max_contours = (FT_Int)new_max;
806 }
807
808 /*
809 * then reallocate the points arrays if necessary --
810 * note that we reserve two additional point positions, used to
811 * hint metrics appropriately
812 */
813 new_max = (FT_UInt)( outline->n_points + 2 );
814 old_max = (FT_UInt)hints->max_points;
815
816 if ( new_max <= AF_POINTS_EMBEDDED )
817 {
818 if ( !hints->points )
819 {
820 hints->points = hints->embedded.points;
821 hints->max_points = AF_POINTS_EMBEDDED;
822 }
823 }
824 else if ( new_max > old_max )
825 {
826 if ( hints->points == hints->embedded.points )
827 hints->points = NULL;
828
829 new_max = ( new_max + 2 + 7 ) & ~7U; /* round up to a multiple of 8 */
830
831 if ( FT_RENEW_ARRAY( hints->points, old_max, new_max ) )
832 goto Exit;
833
834 hints->max_points = (FT_Int)new_max;
835 }
836
837 hints->num_points = outline->n_points;
838 hints->num_contours = outline->n_contours;
839
840 /* We can't rely on the value of `FT_Outline.flags' to know the fill */
841 /* direction used for a glyph, given that some fonts are broken (e.g., */
842 /* the Arphic ones). We thus recompute it each time we need to. */
843 /* */
844 hints->axis[AF_DIMENSION_HORZ].major_dir = AF_DIR_UP;
845 hints->axis[AF_DIMENSION_VERT].major_dir = AF_DIR_LEFT;
846
848 {
849 hints->axis[AF_DIMENSION_HORZ].major_dir = AF_DIR_DOWN;
850 hints->axis[AF_DIMENSION_VERT].major_dir = AF_DIR_RIGHT;
851 }
852
853 hints->x_scale = x_scale;
854 hints->y_scale = y_scale;
855 hints->x_delta = x_delta;
856 hints->y_delta = y_delta;
857
858 hints->xmin_delta = 0;
859 hints->xmax_delta = 0;
860
861 points = hints->points;
862 if ( hints->num_points == 0 )
863 goto Exit;
864
865 {
867 AF_Point point_limit = points + hints->num_points;
868
869 /* value 20 in `near_limit' is heuristic */
870 FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM;
871 FT_Int near_limit = 20 * units_per_em / 2048;
872
873
874 /* compute coordinates & Bezier flags, next and prev */
875 {
876 FT_Vector* vec = outline->points;
877 char* tag = outline->tags;
878 FT_Short endpoint = outline->contours[0];
880 AF_Point prev = end;
881 FT_Int contour_index = 0;
882
883
884 for ( point = points; point < point_limit; point++, vec++, tag++ )
885 {
886 FT_Pos out_x, out_y;
887
888
889 point->in_dir = (FT_Char)AF_DIR_NONE;
890 point->out_dir = (FT_Char)AF_DIR_NONE;
891
892 point->fx = (FT_Short)vec->x;
893 point->fy = (FT_Short)vec->y;
894 point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta;
895 point->oy = point->y = FT_MulFix( vec->y, y_scale ) + y_delta;
896
897 end->fx = (FT_Short)outline->points[endpoint].x;
898 end->fy = (FT_Short)outline->points[endpoint].y;
899
900 switch ( FT_CURVE_TAG( *tag ) )
901 {
903 point->flags = AF_FLAG_CONIC;
904 break;
906 point->flags = AF_FLAG_CUBIC;
907 break;
908 default:
909 point->flags = AF_FLAG_NONE;
910 }
911
912 out_x = point->fx - prev->fx;
913 out_y = point->fy - prev->fy;
914
915 if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit )
916 prev->flags |= AF_FLAG_NEAR;
917
918 point->prev = prev;
919 prev->next = point;
920 prev = point;
921
922 if ( point == end )
923 {
924 if ( ++contour_index < outline->n_contours )
925 {
926 endpoint = outline->contours[contour_index];
927 end = points + endpoint;
928 prev = end;
929 }
930 }
931
932#ifdef FT_DEBUG_AUTOFIT
933 point->before[0] = NULL;
934 point->before[1] = NULL;
935 point->after[0] = NULL;
936 point->after[1] = NULL;
937#endif
938
939 }
940 }
941
942 /* set up the contours array */
943 {
944 AF_Point* contour = hints->contours;
945 AF_Point* contour_limit = contour + hints->num_contours;
946 short* end = outline->contours;
947 short idx = 0;
948
949
950 for ( ; contour < contour_limit; contour++, end++ )
951 {
952 contour[0] = points + idx;
953 idx = (short)( end[0] + 1 );
954 }
955 }
956
957 {
958 /*
959 * Compute directions of `in' and `out' vectors.
960 *
961 * Note that distances between points that are very near to each
962 * other are accumulated. In other words, the auto-hinter either
963 * prepends the small vectors between near points to the first
964 * non-near vector, or the sum of small vector lengths exceeds a
965 * threshold, thus `grouping' the small vectors. All intermediate
966 * points are tagged as weak; the directions are adjusted also to
967 * be equal to the accumulated one.
968 */
969
970 FT_Int near_limit2 = 2 * near_limit - 1;
971
972 AF_Point* contour;
973 AF_Point* contour_limit = hints->contours + hints->num_contours;
974
975
976 for ( contour = hints->contours; contour < contour_limit; contour++ )
977 {
978 AF_Point first = *contour;
979 AF_Point next, prev, curr;
980
981 FT_Pos out_x, out_y;
982
983
984 /* since the first point of a contour could be part of a */
985 /* series of near points, go backwards to find the first */
986 /* non-near point and adjust `first' */
987
988 point = first;
989 prev = first->prev;
990
991 while ( prev != first )
992 {
993 out_x = point->fx - prev->fx;
994 out_y = point->fy - prev->fy;
995
996 /*
997 * We use Taxicab metrics to measure the vector length.
998 *
999 * Note that the accumulated distances so far could have the
1000 * opposite direction of the distance measured here. For this
1001 * reason we use `near_limit2' for the comparison to get a
1002 * non-near point even in the worst case.
1003 */
1004 if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 )
1005 break;
1006
1007 point = prev;
1008 prev = prev->prev;
1009 }
1010
1011 /* adjust first point */
1012 first = point;
1013
1014 /* now loop over all points of the contour to get */
1015 /* `in' and `out' vector directions */
1016
1017 curr = first;
1018
1019 /*
1020 * We abuse the `u' and `v' fields to store index deltas to the
1021 * next and previous non-near point, respectively.
1022 *
1023 * To avoid problems with not having non-near points, we point to
1024 * `first' by default as the next non-near point.
1025 *
1026 */
1027 curr->u = (FT_Pos)( first - curr );
1028 first->v = -curr->u;
1029
1030 out_x = 0;
1031 out_y = 0;
1032
1033 next = first;
1034 do
1035 {
1036 AF_Direction out_dir;
1037
1038
1039 point = next;
1040 next = point->next;
1041
1042 out_x += next->fx - point->fx;
1043 out_y += next->fy - point->fy;
1044
1045 if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit )
1046 {
1048 continue;
1049 }
1050
1051 curr->u = (FT_Pos)( next - curr );
1052 next->v = -curr->u;
1053
1054 out_dir = af_direction_compute( out_x, out_y );
1055
1056 /* adjust directions for all points inbetween; */
1057 /* the loop also updates position of `curr' */
1058 curr->out_dir = (FT_Char)out_dir;
1059 for ( curr = curr->next; curr != next; curr = curr->next )
1060 {
1061 curr->in_dir = (FT_Char)out_dir;
1062 curr->out_dir = (FT_Char)out_dir;
1063 }
1064 next->in_dir = (FT_Char)out_dir;
1065
1066 curr->u = (FT_Pos)( first - curr );
1067 first->v = -curr->u;
1068
1069 out_x = 0;
1070 out_y = 0;
1071
1072 } while ( next != first );
1073 }
1074
1075 /*
1076 * The next step is to `simplify' an outline's topology so that we
1077 * can identify local extrema more reliably: A series of
1078 * non-horizontal or non-vertical vectors pointing into the same
1079 * quadrant are handled as a single, long vector. From a
1080 * topological point of the view, the intermediate points are of no
1081 * interest and thus tagged as weak.
1082 */
1083
1084 for ( point = points; point < point_limit; point++ )
1085 {
1086 if ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
1087 continue;
1088
1089 if ( point->in_dir == AF_DIR_NONE &&
1090 point->out_dir == AF_DIR_NONE )
1091 {
1092 /* check whether both vectors point into the same quadrant */
1093
1094 FT_Pos in_x, in_y;
1095 FT_Pos out_x, out_y;
1096
1097 AF_Point next_u = point + point->u;
1098 AF_Point prev_v = point + point->v;
1099
1100
1101 in_x = point->fx - prev_v->fx;
1102 in_y = point->fy - prev_v->fy;
1103
1104 out_x = next_u->fx - point->fx;
1105 out_y = next_u->fy - point->fy;
1106
1107 if ( ( in_x ^ out_x ) >= 0 && ( in_y ^ out_y ) >= 0 )
1108 {
1109 /* yes, so tag current point as weak */
1110 /* and update index deltas */
1111
1113
1114 prev_v->u = (FT_Pos)( next_u - prev_v );
1115 next_u->v = -prev_v->u;
1116 }
1117 }
1118 }
1119
1120 /*
1121 * Finally, check for remaining weak points. Everything else not
1122 * collected in edges so far is then implicitly classified as strong
1123 * points.
1124 */
1125
1126 for ( point = points; point < point_limit; point++ )
1127 {
1128 if ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
1129 continue;
1130
1131 if ( point->flags & AF_FLAG_CONTROL )
1132 {
1133 /* control points are always weak */
1134 Is_Weak_Point:
1136 }
1137 else if ( point->out_dir == point->in_dir )
1138 {
1139 if ( point->out_dir != AF_DIR_NONE )
1140 {
1141 /* current point lies on a horizontal or */
1142 /* vertical segment (but doesn't start or end it) */
1143 goto Is_Weak_Point;
1144 }
1145
1146 {
1147 AF_Point next_u = point + point->u;
1148 AF_Point prev_v = point + point->v;
1149
1150
1151 if ( ft_corner_is_flat( point->fx - prev_v->fx,
1152 point->fy - prev_v->fy,
1153 next_u->fx - point->fx,
1154 next_u->fy - point->fy ) )
1155 {
1156 /* either the `in' or the `out' vector is much more */
1157 /* dominant than the other one, so tag current point */
1158 /* as weak and update index deltas */
1159
1160 prev_v->u = (FT_Pos)( next_u - prev_v );
1161 next_u->v = -prev_v->u;
1162
1163 goto Is_Weak_Point;
1164 }
1165 }
1166 }
1167 else if ( point->in_dir == -point->out_dir )
1168 {
1169 /* current point forms a spike */
1170 goto Is_Weak_Point;
1171 }
1172 }
1173 }
1174 }
1175
1176 Exit:
1177 return error;
1178 }
af_direction_compute(FT_Pos dx, FT_Pos dy)
Definition: afhints.c:643
#define AF_CONTOURS_EMBEDDED
Definition: afhints.h:338
#define AF_FLAG_NEAR
Definition: afhints.h:225
#define AF_FLAG_NONE
Definition: afhints.h:210
#define AF_FLAG_CONIC
Definition: afhints.h:213
#define AF_FLAG_CUBIC
Definition: afhints.h:214
#define AF_FLAG_CONTROL
Definition: afhints.h:215
#define AF_POINTS_EMBEDDED
Definition: afhints.h:337
unsigned int idx
Definition: utils.c:41
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
FT_Vector * vec
Definition: ftbbox.c:470
ft_corner_is_flat(FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
Definition: ftcalc.c:1047
#define FT_CURVE_TAG_CUBIC
Definition: ftimage.h:457
#define FT_CURVE_TAG_CONIC
Definition: ftimage.h:456
#define FT_CURVE_TAG(flag)
Definition: ftimage.h:452
@ FT_ORIENTATION_POSTSCRIPT
Definition: ftoutln.h:544
FT_Outline_Get_Orientation(FT_Outline *outline)
Definition: ftoutln.c:1031
signed char FT_Char
Definition: fttypes.h:143
signed long FT_Fixed
Definition: fttypes.h:287
signed short FT_Short
Definition: fttypes.h:198
GLuint GLuint end
Definition: gl.h:1545
if(dx< 0)
Definition: linetemp.h:194
static unsigned __int64 next
Definition: rand_nt.c:6
AF_Point prev
Definition: afhints.h:253
FT_Char in_dir
Definition: afhints.h:244
AF_Point next
Definition: afhints.h:252
FT_Short fy
Definition: afhints.h:248
FT_Pos u
Definition: afhints.h:250
FT_Pos v
Definition: afhints.h:250
FT_Char out_dir
Definition: afhints.h:245
FT_Short fx
Definition: afhints.h:248
FT_UShort flags
Definition: afhints.h:243
FT_Pos x
Definition: ftimage.h:78
FT_Pos y
Definition: ftimage.h:79
Definition: nis.h:10
Definition: mesh.c:5330
Definition: ecma_167.h:138

Referenced by af_dummy_hints_apply(), af_latin_hints_apply(), and af_latin_metrics_init_widths().

◆ af_glyph_hints_rescale()

af_glyph_hints_rescale ( AF_GlyphHints  hints,
AF_StyleMetrics  metrics 
)

Definition at line 750 of file afhints.c.

752 {
753 hints->metrics = metrics;
754 hints->scaler_flags = metrics->scaler.flags;
755 }
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745

Referenced by af_dummy_hints_init(), af_latin_hints_init(), and af_latin_metrics_init_widths().

◆ af_glyph_hints_save()

af_glyph_hints_save ( AF_GlyphHints  hints,
FT_Outline outline 
)

Definition at line 1184 of file afhints.c.

1186 {
1187 AF_Point point = hints->points;
1188 AF_Point limit = point + hints->num_points;
1189 FT_Vector* vec = outline->points;
1190 char* tag = outline->tags;
1191
1192
1193 for ( ; point < limit; point++, vec++, tag++ )
1194 {
1195 vec->x = point->x;
1196 vec->y = point->y;
1197
1198 if ( point->flags & AF_FLAG_CONIC )
1200 else if ( point->flags & AF_FLAG_CUBIC )
1202 else
1203 tag[0] = FT_CURVE_TAG_ON;
1204 }
1205 }
#define FT_CURVE_TAG_ON
Definition: ftimage.h:455
GLint limit
Definition: glext.h:10326

Referenced by af_dummy_hints_apply(), and af_latin_hints_apply().