File tree Expand file tree Collapse file tree 2 files changed +9
-19
lines changed
Expand file tree Collapse file tree 2 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -809,6 +809,13 @@ def get_char_width(charcode):
809809 charprocDict ['Type' ] = Name ('XObject' )
810810 charprocDict ['Subtype' ] = Name ('Form' )
811811 charprocDict ['BBox' ] = bbox
812+ # Each glyph includes bounding box information,
813+ # but xpdf and ghostscript can't handle it in a
814+ # Form XObject (they segfault!!!), so we remove it
815+ # from the stream here. It's not needed anyway,
816+ # since the Form XObject includes it in its BBox
817+ # value.
818+ stream = stream [stream .find (b"d1" ) + 2 :]
812819 charprocObject = self .reserveObject ('charProc' )
813820 self .beginStream (charprocObject .id , None , charprocDict )
814821 self .currentstream .write (stream )
Original file line number Diff line number Diff line change @@ -179,27 +179,10 @@ class PythonDictionaryCallback : public TTDictionaryCallback
179179
180180 virtual void add_pair (const char * a, const char * b)
181181 {
182- const char *p;
183-
184- /* Each glyph includes bounding box information, but xpdf and
185- ghostscript can't handle it in a Form XObject (they
186- segfault!!!), so we remove it from the stream here. It's
187- not needed anyway, since the Form XObject includes it in
188- its BBox value. */
189- p = b;
190- for (p = b; *p != 0 ; ++p) {
191- if (*p == ' d' ) {
192- if (*(p + 1 ) == ' 1' ) {
193- p += 2 ;
194- break ;
195- }
196- }
197- }
198-
199182 #if PY3K
200- PyObject* value = PyBytes_FromString (p );
183+ PyObject* value = PyBytes_FromString (b );
201184 #else
202- PyObject* value = PyString_FromString (p );
185+ PyObject* value = PyString_FromString (b );
203186 #endif
204187 if (value)
205188 {
You can’t perform that action at this time.
0 commit comments