ReactOS 0.4.16-dev-2354-g16de117
ftgloadr.h File Reference
Include dependency graph for ftgloadr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FT_SubGlyphRec_
 
struct  FT_GlyphLoadRec_
 
struct  FT_GlyphLoaderRec_
 

Macros

#define FT_GLYPHLOADER_CHECK_P(_loader, _count)
 
#define FT_GLYPHLOADER_CHECK_C(_loader, _count)
 
#define FT_GLYPHLOADER_CHECK_POINTS(_loader, _points, _contours)
 

Typedefs

typedef FT_BEGIN_HEADER struct FT_SubGlyphRec_ FT_SubGlyphRec
 
typedef struct FT_GlyphLoadRec_ FT_GlyphLoadRec
 
typedef struct FT_GlyphLoadRec_FT_GlyphLoad
 
typedef struct FT_GlyphLoaderRec_ FT_GlyphLoaderRec
 
typedef struct FT_GlyphLoaderRec_FT_GlyphLoader
 

Functions

 FT_GlyphLoader_New (FT_Memory memory, FT_GlyphLoader *aloader)
 
 FT_GlyphLoader_CreateExtra (FT_GlyphLoader loader)
 
 FT_GlyphLoader_Done (FT_GlyphLoader loader)
 
 FT_GlyphLoader_Reset (FT_GlyphLoader loader)
 
 FT_GlyphLoader_Rewind (FT_GlyphLoader loader)
 
 FT_GlyphLoader_CheckPoints (FT_GlyphLoader loader, FT_UInt n_points, FT_UInt n_contours)
 
 FT_GlyphLoader_CheckSubGlyphs (FT_GlyphLoader loader, FT_UInt n_subs)
 
 FT_GlyphLoader_Prepare (FT_GlyphLoader loader)
 
 FT_GlyphLoader_Add (FT_GlyphLoader loader)
 

Macro Definition Documentation

◆ FT_GLYPHLOADER_CHECK_C

#define FT_GLYPHLOADER_CHECK_C (   _loader,
  _count 
)
Value:
( (_count) == 0 || \
( (FT_UInt)(_loader)->base.outline.n_contours + \
(FT_UInt)(_loader)->current.outline.n_contours + \
(FT_UInt)(_count) ) <= (_loader)->max_contours )
unsigned int FT_UInt
Definition: fttypes.h:231
struct task_struct * current
Definition: linux.c:32

Definition at line 111 of file ftgloadr.h.

◆ FT_GLYPHLOADER_CHECK_P

#define FT_GLYPHLOADER_CHECK_P (   _loader,
  _count 
)
Value:
( (_count) == 0 || \
( (FT_UInt)(_loader)->base.outline.n_points + \
(FT_UInt)(_loader)->current.outline.n_points + \
(FT_UInt)(_count) ) <= (_loader)->max_points )

Definition at line 105 of file ftgloadr.h.

◆ FT_GLYPHLOADER_CHECK_POINTS

#define FT_GLYPHLOADER_CHECK_POINTS (   _loader,
  _points,
  _contours 
)
Value:
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
? 0 \
(FT_UInt)(_points), \
(FT_UInt)(_contours) ) )
FT_GlyphLoader_CheckPoints(FT_GlyphLoader loader, FT_UInt n_points, FT_UInt n_contours)
Definition: ftgloadr.c:205
#define FT_GLYPHLOADER_CHECK_P(_loader, _count)
Definition: ftgloadr.h:105

Definition at line 117 of file ftgloadr.h.

Typedef Documentation

◆ FT_GlyphLoad

◆ FT_GlyphLoader

◆ FT_GlyphLoaderRec

◆ FT_GlyphLoadRec

◆ FT_SubGlyphRec

Function Documentation

◆ FT_GlyphLoader_Add()

FT_GlyphLoader_Add ( FT_GlyphLoader  loader)

Definition at line 340 of file ftgloadr.c.

341 {
344
345 FT_Int n_curr_contours;
346 FT_Int n_base_points;
347 FT_Int n;
348
349
350 if ( !loader )
351 return;
352
353 base = &loader->base;
354 current = &loader->current;
355
356 n_curr_contours = current->outline.n_contours;
357 n_base_points = base->outline.n_points;
358
359 base->outline.n_points =
360 (short)( base->outline.n_points + current->outline.n_points );
361 base->outline.n_contours =
362 (short)( base->outline.n_contours + current->outline.n_contours );
363
364 base->num_subglyphs += current->num_subglyphs;
365
366 /* adjust contours count in newest outline */
367 for ( n = 0; n < n_curr_contours; n++ )
368 current->outline.contours[n] =
369 (short)( current->outline.contours[n] + n_base_points );
370
371 /* prepare for another new glyph image */
372 FT_GlyphLoader_Prepare( loader );
373 }
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
FT_GlyphLoader_Prepare(FT_GlyphLoader loader)
Definition: ftgloadr.c:324
signed int FT_Int
Definition: fttypes.h:220
GLdouble n
Definition: glext.h:7729
FT_GlyphLoadRec current
Definition: ftgloadr.h:69
FT_GlyphLoadRec base
Definition: ftgloadr.h:68

Referenced by cf2_outline_close(), load_truetype_glyph(), and pfr_glyph_end().

◆ FT_GlyphLoader_CheckPoints()

FT_GlyphLoader_CheckPoints ( FT_GlyphLoader  loader,
FT_UInt  n_points,
FT_UInt  n_contours 
)

Definition at line 205 of file ftgloadr.c.

208 {
209 FT_Memory memory = loader->memory;
211 FT_Outline* base = &loader->base.outline;
212 FT_Outline* current = &loader->current.outline;
213 FT_Bool adjust = 0;
214
215 FT_UInt new_max, old_max;
216
217
219 if ( error )
220 return error;
221
222 /* check points & tags */
223 new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points +
224 n_points;
225 old_max = loader->max_points;
226
227 if ( new_max > old_max )
228 {
229 new_max = FT_PAD_CEIL( new_max, 8 );
230
231 if ( new_max > FT_OUTLINE_POINTS_MAX )
232 return FT_THROW( Array_Too_Large );
233
234 if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
235 FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
236 goto Exit;
237
238 if ( loader->use_extra )
239 {
240 if ( FT_RENEW_ARRAY( loader->base.extra_points,
241 old_max * 2, new_max * 2 ) )
242 goto Exit;
243
244 FT_ARRAY_MOVE( loader->base.extra_points + new_max,
245 loader->base.extra_points + old_max,
246 old_max );
247
248 loader->base.extra_points2 = loader->base.extra_points + new_max;
249 }
250
251 adjust = 1;
252 loader->max_points = new_max;
253 }
254
256 if ( error )
257 return error;
258
259 /* check contours */
260 old_max = loader->max_contours;
261 new_max = (FT_UInt)base->n_contours + (FT_UInt)current->n_contours +
262 n_contours;
263 if ( new_max > old_max )
264 {
265 new_max = FT_PAD_CEIL( new_max, 4 );
266
267 if ( new_max > FT_OUTLINE_CONTOURS_MAX )
268 return FT_THROW( Array_Too_Large );
269
270 if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
271 goto Exit;
272
273 adjust = 1;
274 loader->max_contours = new_max;
275 }
276
277 if ( adjust )
279
280 Exit:
281 if ( error )
282 FT_GlyphLoader_Reset( loader );
283
284 return error;
285 }
return FT_Err_Ok
Definition: ftbbox.c:526
#define FT_THROW(e)
Definition: ftdebug.h:243
FT_GlyphLoader_CreateExtra(FT_GlyphLoader loader)
Definition: ftgloadr.c:166
FT_GlyphLoader_Reset(FT_GlyphLoader loader)
Definition: ftgloadr.c:105
static void FT_GlyphLoader_Adjust_Points(FT_GlyphLoader loader)
Definition: ftgloadr.c:143
#define FT_OUTLINE_CONTOURS_MAX
Definition: ftimage.h:353
#define FT_OUTLINE_POINTS_MAX
Definition: ftimage.h:354
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
Definition: ftmemory.h:344
#define FT_ARRAY_MOVE(dest, source, count)
Definition: ftmemory.h:258
#define FT_PAD_CEIL(x, n)
Definition: ftobjs.h:89
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:64
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
int FT_Error
Definition: fttypes.h:299
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:122
static void Exit(void)
Definition: sock.c:1330
FT_Vector * extra_points2
Definition: ftgloadr.h:53
FT_Vector * extra_points
Definition: ftgloadr.h:52
FT_Outline outline
Definition: ftgloadr.h:51
FT_Bool use_extra
Definition: ftgloadr.h:66
FT_UInt max_points
Definition: ftgloadr.h:63
FT_UInt max_contours
Definition: ftgloadr.h:64
FT_Memory memory
Definition: ftgloadr.h:62

◆ FT_GlyphLoader_CheckSubGlyphs()

FT_GlyphLoader_CheckSubGlyphs ( FT_GlyphLoader  loader,
FT_UInt  n_subs 
)

Definition at line 293 of file ftgloadr.c.

295 {
296 FT_Memory memory = loader->memory;
298 FT_UInt new_max, old_max;
299
300 FT_GlyphLoad base = &loader->base;
301 FT_GlyphLoad current = &loader->current;
302
303
304 new_max = base->num_subglyphs + current->num_subglyphs + n_subs;
305 old_max = loader->max_subglyphs;
306 if ( new_max > old_max )
307 {
308 new_max = FT_PAD_CEIL( new_max, 2 );
309 if ( FT_RENEW_ARRAY( base->subglyphs, old_max, new_max ) )
310 goto Exit;
311
312 loader->max_subglyphs = new_max;
313
315 }
316
317 Exit:
318 return error;
319 }
static void FT_GlyphLoader_Adjust_Subglyphs(FT_GlyphLoader loader)
Definition: ftgloadr.c:190
FT_UInt max_subglyphs
Definition: ftgloadr.h:65

Referenced by cf2_interpT2CharString(), and TT_Load_Composite_Glyph().

◆ FT_GlyphLoader_CreateExtra()

FT_GlyphLoader_CreateExtra ( FT_GlyphLoader  loader)

Definition at line 166 of file ftgloadr.c.

167 {
169 FT_Memory memory = loader->memory;
170
171
172 if ( loader->max_points == 0 ||
173 loader->base.extra_points != NULL )
174 return FT_Err_Ok;
175
176 if ( !FT_NEW_ARRAY( loader->base.extra_points, 2 * loader->max_points ) )
177 {
178 loader->use_extra = 1;
179 loader->base.extra_points2 = loader->base.extra_points +
180 loader->max_points;
181
183 }
184 return error;
185 }
#define NULL
Definition: types.h:112
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:341

Referenced by FT_GlyphLoader_CheckPoints(), and tt_slot_init().

◆ FT_GlyphLoader_Done()

FT_GlyphLoader_Done ( FT_GlyphLoader  loader)

Definition at line 128 of file ftgloadr.c.

129 {
130 if ( loader )
131 {
132 FT_Memory memory = loader->memory;
133
134
135 FT_GlyphLoader_Reset( loader );
136 FT_FREE( loader );
137 }
138 }
#define FT_FREE(ptr)
Definition: ftmemory.h:337

Referenced by ft_glyphslot_done().

◆ FT_GlyphLoader_New()

FT_GlyphLoader_New ( FT_Memory  memory,
FT_GlyphLoader aloader 
)

Definition at line 69 of file ftgloadr.c.

71 {
72 FT_GlyphLoader loader = NULL;
74
75
76 if ( !FT_NEW( loader ) )
77 {
78 loader->memory = memory;
79 *aloader = loader;
80 }
81 return error;
82 }
#define FT_NEW(ptr)
Definition: ftmemory.h:339

Referenced by ft_glyphslot_init().

◆ FT_GlyphLoader_Prepare()

FT_GlyphLoader_Prepare ( FT_GlyphLoader  loader)

Definition at line 324 of file ftgloadr.c.

325 {
326 FT_GlyphLoad current = &loader->current;
327
328
329 current->outline.n_points = 0;
330 current->outline.n_contours = 0;
331 current->num_subglyphs = 0;
332
335 }

Referenced by cf2_interpT2CharString(), and FT_GlyphLoader_Add().

◆ FT_GlyphLoader_Reset()

FT_GlyphLoader_Reset ( FT_GlyphLoader  loader)

Definition at line 105 of file ftgloadr.c.

106 {
107 FT_Memory memory = loader->memory;
108
109
110 FT_FREE( loader->base.outline.points );
111 FT_FREE( loader->base.outline.tags );
112 FT_FREE( loader->base.outline.contours );
113 FT_FREE( loader->base.extra_points );
114 FT_FREE( loader->base.subglyphs );
115
116 loader->base.extra_points2 = NULL;
117
118 loader->max_points = 0;
119 loader->max_contours = 0;
120 loader->max_subglyphs = 0;
121
122 FT_GlyphLoader_Rewind( loader );
123 }
FT_GlyphLoader_Rewind(FT_GlyphLoader loader)
Definition: ftgloadr.c:87
FT_SubGlyph subglyphs
Definition: ftgloadr.h:55
short * contours
Definition: ftimage.h:343
FT_Vector * points
Definition: ftimage.h:341
char * tags
Definition: ftimage.h:342

Referenced by FT_GlyphLoader_CheckPoints(), and FT_GlyphLoader_Done().

◆ FT_GlyphLoader_Rewind()

FT_GlyphLoader_Rewind ( FT_GlyphLoader  loader)

Definition at line 87 of file ftgloadr.c.

88 {
89 FT_GlyphLoad base = &loader->base;
90 FT_GlyphLoad current = &loader->current;
91
92
93 base->outline.n_points = 0;
94 base->outline.n_contours = 0;
95 base->outline.flags = 0;
96 base->num_subglyphs = 0;
97
98 *current = *base;
99 }

Referenced by cf2_outline_reset(), cff_builder_init(), FT_GlyphLoader_Reset(), pfr_glyph_init(), pfr_glyph_load(), t1_builder_init(), and tt_loader_init().