... |
... |
@@ -356,17 +356,13 @@ |
356
|
356
|
|
357
|
357
|
#ifdef FT_CONFIG_OPTION_SVG
|
358
|
358
|
/* check for OT-SVG */
|
359
|
|
- if ( ( load_flags & FT_LOAD_COLOR ) &&
|
360
|
|
- ( (TT_Face)glyph->root.face )->svg )
|
|
359
|
+ if ( ( load_flags & FT_LOAD_COLOR ) && face->svg )
|
361
|
360
|
{
|
362
|
361
|
/*
|
363
|
362
|
* We load the SVG document and try to grab the advances from the
|
364
|
363
|
* table. For the bearings we rely on the presetting hook to do that.
|
365
|
364
|
*/
|
366
|
365
|
|
367
|
|
- FT_Short dummy;
|
368
|
|
- FT_UShort advanceX;
|
369
|
|
- FT_UShort advanceY;
|
370
|
366
|
SFNT_Service sfnt;
|
371
|
367
|
|
372
|
368
|
|
... |
... |
@@ -379,10 +375,18 @@ |
379
|
375
|
|
380
|
376
|
FT_TRACE3(( "Trying to load SVG glyph\n" ));
|
381
|
377
|
|
382
|
|
- sfnt = (SFNT_Service)((TT_Face)glyph->root.face)->sfnt;
|
|
378
|
+ sfnt = (SFNT_Service)face->sfnt;
|
383
|
379
|
error = sfnt->load_svg_doc( (FT_GlyphSlot)glyph, glyph_index );
|
384
|
380
|
if ( !error )
|
385
|
381
|
{
|
|
382
|
+ FT_Fixed x_scale = size->root.metrics.x_scale;
|
|
383
|
+ FT_Fixed y_scale = size->root.metrics.y_scale;
|
|
384
|
+
|
|
385
|
+ FT_Short dummy;
|
|
386
|
+ FT_UShort advanceX;
|
|
387
|
+ FT_UShort advanceY;
|
|
388
|
+
|
|
389
|
+
|
386
|
390
|
FT_TRACE3(( "Successfully loaded SVG glyph\n" ));
|
387
|
391
|
|
388
|
392
|
glyph->root.format = FT_GLYPH_FORMAT_SVG;
|
... |
... |
@@ -407,17 +411,8 @@ |
407
|
411
|
glyph->root.linearHoriAdvance = advanceX;
|
408
|
412
|
glyph->root.linearVertAdvance = advanceY;
|
409
|
413
|
|
410
|
|
- advanceX =
|
411
|
|
- (FT_UShort)FT_MulDiv( advanceX,
|
412
|
|
- glyph->root.face->size->metrics.x_ppem,
|
413
|
|
- glyph->root.face->units_per_EM );
|
414
|
|
- advanceY =
|
415
|
|
- (FT_UShort)FT_MulDiv( advanceY,
|
416
|
|
- glyph->root.face->size->metrics.y_ppem,
|
417
|
|
- glyph->root.face->units_per_EM );
|
418
|
|
-
|
419
|
|
- glyph->root.metrics.horiAdvance = advanceX << 6;
|
420
|
|
- glyph->root.metrics.vertAdvance = advanceY << 6;
|
|
414
|
+ glyph->root.metrics.horiAdvance = FT_MulFix( advanceX, x_scale );
|
|
415
|
+ glyph->root.metrics.vertAdvance = FT_MulFix( advanceY, y_scale );
|
421
|
416
|
|
422
|
417
|
return error;
|
423
|
418
|
}
|