5
5
/* Type 1 Glyph Loader (body). */
7
/* Copyright 1996-2001, 2002, 2003, 2004 by */
7
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
8
8
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10
10
/* This file is part of the FreeType project, and may only be used, */
198
/*************************************************************************/
199
/*************************************************************************/
200
/*************************************************************************/
201
/********** *********/
202
/********** UNHINTED GLYPH LOADER *********/
203
/********** *********/
204
/********** The following code is in charge of loading a *********/
205
/********** single outline. It completely ignores hinting *********/
206
/********** and is used when FT_LOAD_NO_HINTING is set. *********/
207
/********** *********/
208
/********** The Type 1 hinter is located in `t1hint.c' *********/
209
/********** *********/
210
/*************************************************************************/
211
/*************************************************************************/
212
/*************************************************************************/
215
198
FT_LOCAL_DEF( FT_Error )
216
199
T1_Load_Glyph( T1_GlyphSlot glyph,
315
298
glyph->root.linearHoriAdvance = decoder.builder.advance.x;
316
299
glyph->root.internal->glyph_transformed = 0;
318
/* make up vertical metrics */
319
metrics->vertBearingX = 0;
320
metrics->vertBearingY = 0;
321
metrics->vertAdvance = 0;
323
glyph->root.linearVertAdvance = 0;
301
/* make up vertical ones */
302
metrics->vertAdvance = ( face->type1.font_bbox.yMax -
303
face->type1.font_bbox.yMin ) >> 16;
304
glyph->root.linearVertAdvance = metrics->vertAdvance;
325
306
glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
358
339
/* First of all, scale the points, if we are not hinting */
340
if ( !hinting || ! decoder.builder.hints_funcs )
360
341
for ( n = cur->n_points; n > 0; n--, vec++ )
362
343
vec->x = FT_MulFix( vec->x, x_scale );
363
344
vec->y = FT_MulFix( vec->y, y_scale );
366
FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
368
347
/* Then scale the metrics */
369
348
metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );
370
349
metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );
372
metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale );
373
metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale );
377
metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
378
metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
380
metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
381
metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
385
352
/* compute the other metrics */
386
353
FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
388
/* grid fit the bounding box if necessary */
391
cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
392
cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
393
cbox.xMax = FT_PIX_CEIL( cbox.xMax );
394
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
397
355
metrics->width = cbox.xMax - cbox.xMin;
398
356
metrics->height = cbox.yMax - cbox.yMin;
400
358
metrics->horiBearingX = cbox.xMin;
401
359
metrics->horiBearingY = cbox.yMax;
361
/* make up vertical ones */
362
ft_synthesize_vertical_metrics( metrics,
363
metrics->vertAdvance );
404
366
/* Set control data to the glyph charstrings. Note that this is */