~ubuntu-branches/ubuntu/precise/cairo/precise-proposed

« back to all changes in this revision

Viewing changes to debian/patches/05_fix_glyph_advance.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-01-03 16:47:46 UTC
  • mfrom: (28.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110103164746-2arbsh0o4defgd8u
Tags: 1.10.2-1ubuntu1
* Resynchronize on Debian, the remaining delta for ubuntu is:
* debian/patches/server_side_gradients.patch:
  - don't use server side gradients, most drivers don't handle those and are
    really slow, should workaround performances issues for ati and nouveau
* debian/patches/cairo-lp-680628.patch: 
  - git backport to fix pdf printing speed issues (LP #680628).
* debian/libcairo2.symbols:
  Fix build failure with -flto (adding optional symbol).

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
8
 
@@ -69,8 +69,8 @@
9
 
        unsigned int font_id;
10
 
        char *base_font;
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;
16
 
 
17
 
        const char    *data;
18
 
        unsigned long  header_size;
19
 
@@ -146,12 +146,12 @@
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;
35
 
 
36
 
     if (face->family_name) {
37
 
        font->base.base_font = strdup (face->family_name);
38
 
@@ -566,7 +566,7 @@
39
 
            return CAIRO_INT_STATUS_UNSUPPORTED;
40
 
        }
41
 
 
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;
44
 
 
45
 
        error = FT_Get_Glyph_Name(font->face, i, buffer, sizeof buffer);
46
 
        if (error != FT_Err_Ok) {