ReactOS 0.4.15-dev-7674-gc0b4db1
afcjk.h
Go to the documentation of this file.
1/***************************************************************************/
2/* */
3/* afcjk.h */
4/* */
5/* Auto-fitter hinting routines for CJK writing system (specification). */
6/* */
7/* Copyright 2006-2018 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 AFCJK_H_
20#define AFCJK_H_
21
22#include "afhints.h"
23#include "aflatin.h"
24
25
27
28
29 /* the CJK-specific writing system */
30
31 AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class )
32
33
34 /*************************************************************************/
35 /*************************************************************************/
36 /***** *****/
37 /***** C J K G L O B A L M E T R I C S *****/
38 /***** *****/
39 /*************************************************************************/
40 /*************************************************************************/
41
42
43 /*
44 * CJK glyphs tend to fill the square. So we have both vertical and
45 * horizontal blue zones. But some glyphs have flat bounding strokes that
46 * leave some space between neighbour glyphs.
47 */
48
49#define AF_CJK_IS_TOP_BLUE( b ) \
50 ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP )
51#define AF_CJK_IS_HORIZ_BLUE( b ) \
52 ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ )
53#define AF_CJK_IS_RIGHT_BLUE AF_CJK_IS_TOP_BLUE
54
55#define AF_CJK_MAX_WIDTHS 16
56
57
58#define AF_CJK_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
59#define AF_CJK_BLUE_TOP ( 1U << 1 ) /* result of AF_CJK_IS_TOP_BLUE */
60#define AF_CJK_BLUE_ADJUSTMENT ( 1U << 2 ) /* used for scale adjustment */
61 /* optimization */
62
63
64 typedef struct AF_CJKBlueRec_
65 {
67 AF_WidthRec shoot; /* undershoot */
69
71
72
73 typedef struct AF_CJKAxisRec_
74 {
77
78 FT_UInt width_count; /* number of used widths */
80 FT_Pos edge_distance_threshold; /* used for creating edges */
81 FT_Pos standard_width; /* the default stem thickness */
82 FT_Bool extra_light; /* is standard width very light? */
83
84 /* used for horizontal metrics too for CJK */
88
91
93
94
95 typedef struct AF_CJKMetricsRec_
96 {
100
102
103
104#ifdef AF_CONFIG_OPTION_CJK
106 af_cjk_metrics_init( AF_CJKMetrics metrics,
107 FT_Face face );
108
109 FT_LOCAL( void )
110 af_cjk_metrics_scale( AF_CJKMetrics metrics,
111 AF_Scaler scaler );
112
114 af_cjk_hints_init( AF_GlyphHints hints,
116
118 af_cjk_hints_apply( FT_UInt glyph_index,
122
123 /* shared; called from afindic.c */
124 FT_LOCAL( void )
125 af_cjk_metrics_check_digits( AF_CJKMetrics metrics,
126 FT_Face face );
127
128 FT_LOCAL( void )
129 af_cjk_metrics_init_widths( AF_CJKMetrics metrics,
130 FT_Face face );
131#endif /* AF_CONFIG_OPTION_CJK */
132
133
134/* */
135
137
138#endif /* AFCJK_H_ */
139
140
141/* END */
@ AF_BLUE_STRINGSET_MAX
Definition: afblue.h:388
struct AF_CJKAxisRec_ AF_CJKAxisRec
struct AF_CJKMetricsRec_ * AF_CJKMetrics
struct AF_CJKMetricsRec_ AF_CJKMetricsRec
#define AF_CJK_MAX_WIDTHS
Definition: afcjk.h:55
struct AF_CJKBlueRec_ * AF_CJKBlue
struct AF_CJKAxisRec_ * AF_CJKAxis
struct AF_CJKBlueRec_ AF_CJKBlueRec
@ AF_DIMENSION_MAX
Definition: afhints.h:40
#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
FT_UInt blue_count
Definition: afcjk.h:86
FT_UInt width_count
Definition: afcjk.h:78
FT_Pos org_delta
Definition: afcjk.h:90
FT_Pos standard_width
Definition: afcjk.h:81
FT_Fixed scale
Definition: afcjk.h:75
FT_Fixed org_scale
Definition: afcjk.h:89
FT_Pos edge_distance_threshold
Definition: afcjk.h:80
FT_Pos delta
Definition: afcjk.h:76
AF_WidthRec widths[AF_CJK_MAX_WIDTHS]
Definition: afcjk.h:79
FT_Bool extra_light
Definition: afcjk.h:82
FT_Bool control_overshoot
Definition: afcjk.h:85
AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX]
Definition: afcjk.h:87
AF_WidthRec shoot
Definition: afcjk.h:67
FT_UInt flags
Definition: afcjk.h:68
AF_WidthRec ref
Definition: afcjk.h:66
FT_UInt units_per_em
Definition: afcjk.h:98
AF_CJKAxisRec axis[AF_DIMENSION_MAX]
Definition: afcjk.h:99
AF_StyleMetricsRec root
Definition: afcjk.h:97
Definition: mesh.c:5330