ReactOS 0.4.15-dev-7918-g2a2556c
ftadvanc.h File Reference
#include <ft2build.h>
Include dependency graph for ftadvanc.h:

Go to the source code of this file.

Macros

#define FT_ADVANCE_FLAG_FAST_ONLY   0x20000000L
 

Functions

 FT_Get_Advance (FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance)
 
 FT_Get_Advances (FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances)
 

Macro Definition Documentation

◆ FT_ADVANCE_FLAG_FAST_ONLY

#define FT_ADVANCE_FLAG_FAST_ONLY   0x20000000L

Definition at line 80 of file ftadvanc.h.

Function Documentation

◆ FT_Get_Advance()

FT_Get_Advance ( FT_Face  face,
FT_UInt  gindex,
FT_Int32  load_flags,
FT_Fixed padvance 
)

Definition at line 75 of file ftadvanc.c.

79 {
81
82
83 if ( !face )
84 return FT_THROW( Invalid_Face_Handle );
85
86 if ( !padvance )
87 return FT_THROW( Invalid_Argument );
88
89 if ( gindex >= (FT_UInt)face->num_glyphs )
90 return FT_THROW( Invalid_Glyph_Index );
91
92 func = face->driver->clazz->get_advances;
94 {
96
97
98 error = func( face, gindex, 1, flags, padvance );
99 if ( !error )
100 return _ft_face_scale_advances( face, padvance, 1, flags );
101
102 if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
103 return error;
104 }
105
106 return FT_Get_Advances( face, gindex, 1, flags, padvance );
107 }
FT_Get_Advances(FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 flags, FT_Fixed *padvances)
Definition: ftadvanc.c:113
static FT_Error _ft_face_scale_advances(FT_Face face, FT_Fixed *advances, FT_UInt count, FT_Int32 flags)
Definition: ftadvanc.c:27
#define LOAD_ADVANCE_FAST_CHECK(face, flags)
Definition: ftadvanc.c:67
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_Error(* FT_Face_GetAdvancesFunc)(FT_Face face, FT_UInt first, FT_UInt count, FT_Int32 flags, FT_Fixed *advances)
Definition: ftdrv.h:83
int FT_Error
Definition: fttypes.h:300
#define FT_ERR_NEQ(x, e)
Definition: fttypes.h:593
unsigned int FT_UInt
Definition: fttypes.h:231
GLenum func
Definition: glext.h:6028
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLbitfield flags
Definition: glext.h:7161
#define error(str)
Definition: mkdosfs.c:1605

Referenced by af_shaper_get_elem().

◆ FT_Get_Advances()

FT_Get_Advances ( FT_Face  face,
FT_UInt  start,
FT_UInt  count,
FT_Int32  load_flags,
FT_Fixed padvances 
)

Definition at line 113 of file ftadvanc.c.

118 {
120
122
123 FT_UInt num, end, nn;
125
126
127 if ( !face )
128 return FT_THROW( Invalid_Face_Handle );
129
130 if ( !padvances )
131 return FT_THROW( Invalid_Argument );
132
133 num = (FT_UInt)face->num_glyphs;
134 end = start + count;
135 if ( start >= num || end < start || end > num )
136 return FT_THROW( Invalid_Glyph_Index );
137
138 if ( count == 0 )
139 return FT_Err_Ok;
140
141 func = face->driver->clazz->get_advances;
143 {
144 error = func( face, start, count, flags, padvances );
145 if ( !error )
146 return _ft_face_scale_advances( face, padvances, count, flags );
147
148 if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
149 return error;
150 }
151
153
155 return FT_THROW( Unimplemented_Feature );
156
157 flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
158 factor = ( flags & FT_LOAD_NO_SCALE ) ? 1 : 1024;
159 for ( nn = 0; nn < count; nn++ )
160 {
161 error = FT_Load_Glyph( face, start + nn, flags );
162 if ( error )
163 break;
164
165 /* scale from 26.6 to 16.16, unless NO_SCALE was requested */
166 padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
167 ? face->glyph->advance.y * factor
168 : face->glyph->advance.x * factor;
169 }
170
171 return error;
172 }
FT_Load_Glyph(FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ftobjs.c:760
#define FT_LOAD_VERTICAL_LAYOUT
Definition: freetype.h:3013
#define FT_LOAD_NO_SCALE
Definition: freetype.h:3009
#define FT_LOAD_ADVANCE_ONLY
Definition: freetype.h:3031
#define FT_ADVANCE_FLAG_FAST_ONLY
Definition: ftadvanc.h:80
return FT_Err_Ok
Definition: ftbbox.c:511
signed int FT_Int
Definition: fttypes.h:220
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint num
Definition: glext.h:9618
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 factor
Definition: glfuncs.h:178
if(dx< 0)
Definition: linetemp.h:194

Referenced by FT_Get_Advance().