~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/03-chinese-inkscape.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-25 15:51:35 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20081125155135-00rp1lxb6cx2ntvp
Tags: 0.46-3ubuntu1
* Merge from debian unstable, remaining changes:
  - 03-gtk-includes.dpatch as a workaround of GTK includes bug
  - debian/control:
    + Add Vcs-Browser, Vcs-Svn, and Homepage (needs-to-goto-debian)
    + Set python-lxml, python-numpy, python-uniconvertor as Recommends
    + Depend on libgnomevfs2-extra
    + Build-Depends on automake (>= 1.10), libboost1.35-dev
    + move pstoedit from Recommends to Suggests
  - debian/rules:
    + Handle parallel builds via -j 
    + Run intltool-update on build
    + Add translation domain to .desktop files
  - Added patch 100_uniconvertor_binary_name.dpatch as python-uniconvertor
    uses uniconvertor as binary name instead of uniconv.
    (LP: #200750, needs-to-goto-debian).
  - inkscape.bash: Add svgz,ai (needs-to-go-upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 03-chinese-inkscape.dpatch by Wolfram Quester <wolfi@sigxcpu.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: This is a patch by Luca Bruno to fix a segfault which
 
6
## DP: occurs in file handling wit locales like zh_CN.
 
7
## DP: (closes: #487623)
 
8
 
 
9
@DPATCH@
 
10
 
 
11
Index: src/libnrtype/FontFactory.cpp
 
12
===================================================================
 
13
--- src/libnrtype/FontFactory.cpp       (revisione 19753)
 
14
+++ ./src/libnrtype/FontFactory.cpp     (copia locale)
 
15
@@ -821,7 +821,8 @@
 
16
         res->Ref();
 
17
         AddInCache(res);
 
18
     }
 
19
-    res->InitTheFace();
 
20
+    if(res)
 
21
+       res->InitTheFace();
 
22
     return res;
 
23
 }
 
24
 
 
25
Index: src/libnrtype/Layout-TNG-Output.cpp
 
26
===================================================================
 
27
--- src/libnrtype/Layout-TNG-Output.cpp (revisione 19753)
 
28
+++ ./src/libnrtype/Layout-TNG-Output.cpp       (copia locale)
 
29
@@ -116,22 +116,24 @@
 
30
         _getGlyphTransformMatrix(glyph_index, &glyph_matrix);
 
31
         NR::Matrix total_transform = glyph_matrix;
 
32
         total_transform *= transform;
 
33
-        NR::Maybe<NR::Rect> glyph_rect = _glyphs[glyph_index].span(this).font->BBox(_glyphs[glyph_index].glyph);
 
34
-        if (glyph_rect) {
 
35
-            NR::Point bmi = glyph_rect->min(), bma = glyph_rect->max();
 
36
-            NR::Point tlp(bmi[0],bmi[1]), trp(bma[0],bmi[1]), blp(bmi[0],bma[1]), brp(bma[0],bma[1]);
 
37
-            tlp *= total_transform;
 
38
-            trp *= total_transform;
 
39
-            blp *= total_transform;
 
40
-            brp *= total_transform;
 
41
-            *glyph_rect = NR::Rect(tlp,trp);
 
42
-            glyph_rect->expandTo(blp);
 
43
-            glyph_rect->expandTo(brp);
 
44
-            if ( (glyph_rect->min())[0] < bounding_box->x0 ) bounding_box->x0=(glyph_rect->min())[0];
 
45
-            if ( (glyph_rect->max())[0] > bounding_box->x1 ) bounding_box->x1=(glyph_rect->max())[0];
 
46
-            if ( (glyph_rect->min())[1] < bounding_box->y0 ) bounding_box->y0=(glyph_rect->min())[1];
 
47
-            if ( (glyph_rect->max())[1] > bounding_box->y1 ) bounding_box->y1=(glyph_rect->max())[1];
 
48
-        }
 
49
+        if(_glyphs[glyph_index].span(this).font) {
 
50
+           NR::Maybe<NR::Rect> glyph_rect = _glyphs[glyph_index].span(this).font->BBox(_glyphs[glyph_index].glyph);
 
51
+            if (glyph_rect) {
 
52
+               NR::Point bmi = glyph_rect->min(), bma = glyph_rect->max();
 
53
+               NR::Point tlp(bmi[0],bmi[1]), trp(bma[0],bmi[1]), blp(bmi[0],bma[1]), brp(bma[0],bma[1]);
 
54
+                tlp *= total_transform;
 
55
+                trp *= total_transform;
 
56
+                blp *= total_transform;
 
57
+                brp *= total_transform;
 
58
+                *glyph_rect = NR::Rect(tlp,trp);
 
59
+                glyph_rect->expandTo(blp);
 
60
+                glyph_rect->expandTo(brp);
 
61
+                if ( (glyph_rect->min())[0] < bounding_box->x0 ) bounding_box->x0=(glyph_rect->min())[0];
 
62
+                if ( (glyph_rect->max())[0] > bounding_box->x1 ) bounding_box->x1=(glyph_rect->max())[0];
 
63
+                if ( (glyph_rect->min())[1] < bounding_box->y0 ) bounding_box->y0=(glyph_rect->min())[1];
 
64
+                if ( (glyph_rect->max())[1] > bounding_box->y1 ) bounding_box->y1=(glyph_rect->max())[1];
 
65
+            }
 
66
+       }
 
67
     }
 
68
 }
 
69
 
 
70
Index: src/libnrtype/Layout-TNG-Compute.cpp
 
71
===================================================================
 
72
--- src/libnrtype/Layout-TNG-Compute.cpp        (revisione 19753)
 
73
+++ ./src/libnrtype/Layout-TNG-Compute.cpp      (copia locale)
 
74
@@ -478,9 +478,9 @@
 
75
                 new_span.in_input_stream_item = unbroken_span.input_index;
 
76
                 new_span.baseline_shift = _y_offset;
 
77
                 new_span.block_progression = _block_progression;
 
78
-                if (_flow._input_stream[unbroken_span.input_index]->Type() == TEXT_SOURCE) {
 
79
-                    new_span.font = para.pango_items[unbroken_span.pango_item_index].font;
 
80
-                    new_span.font->Ref();
 
81
+                if ((_flow._input_stream[unbroken_span.input_index]->Type() == TEXT_SOURCE) && (new_span.font = para.pango_items[unbroken_span.pango_item_index].font))
 
82
+                    {
 
83
+                   new_span.font->Ref();
 
84
                     new_span.font_size = unbroken_span.font_size;
 
85
                     new_span.direction = para.pango_items[unbroken_span.pango_item_index].item->analysis.level & 1 ? RIGHT_TO_LEFT : LEFT_TO_RIGHT;
 
86
                     new_span.input_stream_first_character = Glib::ustring::const_iterator(unbroken_span.input_stream_first_character.base() + it_span->start.char_byte);
 
87
@@ -565,7 +565,7 @@
 
88
                             new_glyph.x = x + unbroken_span.glyph_string->glyphs[glyph_index].geometry.x_offset * font_size_multiplier;
 
89
                             new_glyph.y = _y_offset + unbroken_span.glyph_string->glyphs[glyph_index].geometry.y_offset * font_size_multiplier;
 
90
                             new_glyph.width = unbroken_span.glyph_string->glyphs[glyph_index].geometry.width * font_size_multiplier;
 
91
-                            if (new_glyph.width == 0)
 
92
+                            if ((new_glyph.width == 0) && (para.pango_items[unbroken_span.pango_item_index].font))
 
93
                                 new_glyph.width = new_span.font_size * para.pango_items[unbroken_span.pango_item_index].font->Advance(unbroken_span.glyph_string->glyphs[glyph_index].glyph, false);
 
94
                                 // for some reason pango returns zero width for invalid glyph characters (those empty boxes), so go to freetype for the info
 
95
                         }
 
96
@@ -906,7 +906,8 @@
 
97
         line_height->setZero();
 
98
         *line_height_multiplier = 1.0;
 
99
     }
 
100
-    font->FontMetrics(line_height->ascent, line_height->descent, line_height->leading);
 
101
+    else
 
102
+       font->FontMetrics(line_height->ascent, line_height->descent, line_height->leading);
 
103
     *line_height *= font_size;
 
104
 
 
105
     // yet another borked SPStyle member that we're going to have to fix ourselves