ReactOS 0.4.15-dev-7953-g1f49173
ftsynth.h File Reference
#include <ft2build.h>
Include dependency graph for ftsynth.h:

Go to the source code of this file.

Functions

FT_BEGIN_HEADER FT_GlyphSlot_Embolden (FT_GlyphSlot slot)
 
 FT_GlyphSlot_Oblique (FT_GlyphSlot slot)
 

Function Documentation

◆ FT_GlyphSlot_Embolden()

FT_BEGIN_HEADER FT_GlyphSlot_Embolden ( FT_GlyphSlot  slot)

Definition at line 90 of file ftsynth.c.

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

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

Referenced by IntGetRealGlyph().