ReactOS 0.4.16-dev-2354-g16de117
ftsynth.c File Reference
Include dependency graph for ftsynth.c:

Go to the source code of this file.

Macros

#define FT_COMPONENT   synth
 

Functions

 FT_GlyphSlot_Oblique (FT_GlyphSlot slot)
 
 FT_GlyphSlot_Embolden (FT_GlyphSlot slot)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   synth

Definition at line 33 of file ftsynth.c.

Function Documentation

◆ FT_GlyphSlot_Embolden()

FT_GlyphSlot_Embolden ( FT_GlyphSlot  slot)

Definition at line 89 of file ftsynth.c.

90 {
94 FT_Pos xstr, ystr;
95
96
97 if ( !slot )
98 return;
99
100 library = slot->library;
101 face = slot->face;
102
103 if ( slot->format != FT_GLYPH_FORMAT_OUTLINE &&
104 slot->format != FT_GLYPH_FORMAT_BITMAP )
105 return;
106
107 /* some reasonable strength */
108 xstr = FT_MulFix( face->units_per_EM,
109 face->size->metrics.y_scale ) / 24;
110 ystr = xstr;
111
112 if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
113 FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
114
115 else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
116 {
117 /* round to full pixels */
118 xstr &= ~63;
119 if ( xstr == 0 )
120 xstr = 1 << 6;
121 ystr &= ~63;
122
123 /*
124 * XXX: overflow check for 16-bit system, for compatibility
125 * with FT_GlyphSlot_Embolden() since FreeType 2.1.10.
126 * unfortunately, this function return no informations
127 * about the cause of error.
128 */
129 if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN )
130 {
131 FT_TRACE1(( "FT_GlyphSlot_Embolden:" ));
132 FT_TRACE1(( "too strong emboldening parameter ystr=%ld\n", ystr ));
133 return;
134 }
136 if ( error )
137 return;
138
139 error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr );
140 if ( error )
141 return;
142 }
143
144 if ( slot->advance.x )
145 slot->advance.x += xstr;
146
147 if ( slot->advance.y )
148 slot->advance.y += ystr;
149
150 slot->metrics.width += xstr;
151 slot->metrics.height += ystr;
152 slot->metrics.horiAdvance += xstr;
153 slot->metrics.vertAdvance += ystr;
154 slot->metrics.horiBearingY += ystr;
155
156 /* XXX: 16-bit overflow case must be excluded before here */
157 if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
158 slot->bitmap_top += (FT_Int)( ystr >> 6 );
159 }
FT_Library library
Definition: cffdrivr.c:660
WORD face[3]
Definition: mesh.c:4747
FT_MulFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:508
FT_GlyphSlot_Own_Bitmap(FT_GlyphSlot slot)
Definition: ftbitmap.c:1172
FT_Bitmap_Embolden(FT_Library library, FT_Bitmap *bitmap, FT_Pos xStrength, FT_Pos yStrength)
Definition: ftbitmap.c:307
#define FT_TRACE1(varformat)
Definition: ftdebug.h:188
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:57
FT_Outline_EmboldenXY(FT_Outline *outline, FT_Pos xstrength, FT_Pos ystrength)
Definition: ftoutln.c:904
#define FT_INT_MIN
Definition: ftstdlib.h:64
#define FT_INT_MAX
Definition: ftstdlib.h:63
int FT_Error
Definition: fttypes.h:299
signed int FT_Int
Definition: fttypes.h:220
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define error(str)
Definition: mkdosfs.c:1605
Definition: vfat.h:185

Referenced by IntGetRealGlyph().

◆ FT_GlyphSlot_Oblique()

FT_GlyphSlot_Oblique ( FT_GlyphSlot  slot)

Definition at line 47 of file ftsynth.c.

48 {
51
52
53 if ( !slot )
54 return;
55
56 outline = &slot->outline;
57
58 /* only oblique outline glyphs */
59 if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
60 return;
61
62 /* we don't touch the advance width */
63
64 /* For italic, simply apply a shear transform, with an angle */
65 /* of about 12 degrees. */
66
67 transform.xx = 0x10000L;
68 transform.yx = 0x00000L;
69
70 transform.xy = 0x0366AL;
71 transform.yy = 0x10000L;
72
74 }
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
Definition: ftoutln.c:706
GLuint GLenum GLenum transform
Definition: glext.h:9407
Definition: mesh.c:5330

Referenced by IntGetRealGlyph().