diff options
Diffstat (limited to 'src/sfntfont.c')
| -rw-r--r-- | src/sfntfont.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/sfntfont.c b/src/sfntfont.c index b20a7c91115..04caf77e72a 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c | |||
| @@ -2115,9 +2115,8 @@ sfntfont_get_metrics (sfnt_glyph glyph, struct sfnt_glyph_metrics *metrics, | |||
| 2115 | struct sfntfont_get_glyph_outline_dcontext *tables; | 2115 | struct sfntfont_get_glyph_outline_dcontext *tables; |
| 2116 | 2116 | ||
| 2117 | tables = dcontext; | 2117 | tables = dcontext; |
| 2118 | return sfnt_lookup_glyph_metrics (glyph, -1, metrics, | 2118 | return sfnt_lookup_glyph_metrics (glyph, metrics, tables->hmtx, |
| 2119 | tables->hmtx, tables->hhea, | 2119 | tables->hhea, tables->maxp); |
| 2120 | NULL, tables->maxp); | ||
| 2121 | } | 2120 | } |
| 2122 | 2121 | ||
| 2123 | /* Dereference the outline OUTLINE. Free it once refcount reaches | 2122 | /* Dereference the outline OUTLINE. Free it once refcount reaches |
| @@ -2253,8 +2252,7 @@ sfntfont_get_glyph_outline (sfnt_glyph glyph_code, | |||
| 2253 | 2252 | ||
| 2254 | /* Now load the glyph's unscaled metrics into TEMP. */ | 2253 | /* Now load the glyph's unscaled metrics into TEMP. */ |
| 2255 | 2254 | ||
| 2256 | if (sfnt_lookup_glyph_metrics (glyph_code, -1, &temp, hmtx, hhea, | 2255 | if (sfnt_lookup_glyph_metrics (glyph_code, &temp, hmtx, hhea, maxp)) |
| 2257 | head, maxp)) | ||
| 2258 | goto fail; | 2256 | goto fail; |
| 2259 | 2257 | ||
| 2260 | if (interpreter) | 2258 | if (interpreter) |
| @@ -2312,6 +2310,8 @@ sfntfont_get_glyph_outline (sfnt_glyph glyph_code, | |||
| 2312 | 2310 | ||
| 2313 | if (!outline) | 2311 | if (!outline) |
| 2314 | { | 2312 | { |
| 2313 | /* Build the outline. This will apply GX offsets within *GLYPH | ||
| 2314 | to TEMP. */ | ||
| 2315 | outline = sfnt_build_glyph_outline (glyph, scale, | 2315 | outline = sfnt_build_glyph_outline (glyph, scale, |
| 2316 | &temp, | 2316 | &temp, |
| 2317 | sfntfont_get_glyph, | 2317 | sfntfont_get_glyph, |
| @@ -2319,22 +2319,9 @@ sfntfont_get_glyph_outline (sfnt_glyph glyph_code, | |||
| 2319 | sfntfont_get_metrics, | 2319 | sfntfont_get_metrics, |
| 2320 | &dcontext); | 2320 | &dcontext); |
| 2321 | 2321 | ||
| 2322 | /* Add the advance width distortion, which is not applied to | ||
| 2323 | glyph metrics in advance of their being instructed, and thus | ||
| 2324 | has to be applied before the metrics are. */ | ||
| 2325 | temp.advance += distortion.advance; | ||
| 2326 | |||
| 2327 | /* At this point, the glyph metrics are unscaled. Scale them | 2322 | /* At this point, the glyph metrics are unscaled. Scale them |
| 2328 | up. If INTERPRETER is set, use the scale placed within. */ | 2323 | up. If INTERPRETER is set, use the scale placed within. */ |
| 2329 | sfnt_scale_metrics (&temp, scale); | 2324 | sfnt_scale_metrics (&temp, scale); |
| 2330 | |||
| 2331 | /* Finally, adjust the left side bearing of the glyph metrics by | ||
| 2332 | the origin point of the outline, should a transformation have | ||
| 2333 | been applied by either instruction code or glyph variation. | ||
| 2334 | The left side bearing is the distance from the origin point | ||
| 2335 | to the left most point on the X axis. */ | ||
| 2336 | if (index != -1) | ||
| 2337 | temp.lbearing = outline->xmin - outline->origin; | ||
| 2338 | } | 2325 | } |
| 2339 | 2326 | ||
| 2340 | fail: | 2327 | fail: |