1
## Description: Type 1 subset: Fix glyph advance
2
## Origin/Author: Upstream commit 43c93f2b101f534f8aa4213403af3281fcdc17fb and f47830dbbc34c7068ccdd8f7f9042e8734c9e408 (Adrian Johnson <ajohnson@redneon.com>
3
## Bug: https://bugs.freedesktop.org/show_bug.cgi?id=31062
4
Index: cairo.fix-667124/src/cairo-type1-subset.c
5
===================================================================
6
--- cairo.fix-667124.orig/src/cairo-type1-subset.c 2010-10-25 00:48:41.226430002 +0200
7
+++ cairo.fix-667124/src/cairo-type1-subset.c 2010-10-25 00:48:26.236429991 +0200
11
unsigned int num_glyphs;
12
- long x_min, y_min, x_max, y_max;
13
- long ascent, descent;
14
+ double x_min, y_min, x_max, y_max;
15
+ double ascent, descent;
18
unsigned long header_size;
20
memset (font, 0, sizeof (*font));
21
font->base.unscaled_font = _cairo_unscaled_font_reference (unscaled_font);
22
font->base.num_glyphs = face->num_glyphs;
23
- font->base.x_min = face->bbox.xMin;
24
- font->base.y_min = face->bbox.yMin;
25
- font->base.x_max = face->bbox.xMax;
26
- font->base.y_max = face->bbox.yMax;
27
- font->base.ascent = face->ascender;
28
- font->base.descent = face->descender;
29
+ font->base.x_min = face->bbox.xMin / (double)face->units_per_EM;
30
+ font->base.y_min = face->bbox.yMin / (double)face->units_per_EM;
31
+ font->base.x_max = face->bbox.xMax / (double)face->units_per_EM;
32
+ font->base.y_max = face->bbox.yMax / (double)face->units_per_EM;
33
+ font->base.ascent = face->ascender / (double)face->units_per_EM;
34
+ font->base.descent = face->descender / (double)face->units_per_EM;
36
if (face->family_name) {
37
font->base.base_font = strdup (face->family_name);
39
return CAIRO_INT_STATUS_UNSUPPORTED;
42
- font->glyphs[i].width = font->face->glyph->linearHoriAdvance / 65536.0; /* 16.16 format */
43
+ font->glyphs[i].width = font->face->glyph->metrics.horiAdvance / (double)font->face->units_per_EM;
45
error = FT_Get_Glyph_Name(font->face, i, buffer, sizeof buffer);
46
if (error != FT_Err_Ok) {