Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 889286 Details for
Bug 1090975
Poppler embeds PFB fonts into PostScript files wrong
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix PFB font embedding
0001-Fix-PFB-font-embedding.patch (text/plain), 3.06 KB, created by
Marek Kašík
on 2014-04-24 13:58:33 UTC
(
hide
)
Description:
Fix PFB font embedding
Filename:
MIME Type:
Creator:
Marek Kašík
Created:
2014-04-24 13:58:33 UTC
Size:
3.06 KB
patch
obsolete
>From e2fe85137ecb59eb0d177682c552febc64cda643 Mon Sep 17 00:00:00 2001 >From: Adrian Johnson <ajohnson@redneon.com> >Date: Tue, 1 Oct 2013 19:15:08 +0200 >Subject: [PATCH] Fix PFB font embedding > >Bug #69717 >--- > poppler/PSOutputDev.cc | 52 ++++++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 46 insertions(+), 6 deletions(-) > >diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc >index 4fe5d7b..623251f 100644 >--- a/poppler/PSOutputDev.cc >+++ b/poppler/PSOutputDev.cc >@@ -25,7 +25,7 @@ > // Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org> > // Copyright (C) 2009, 2011, 2012 William Bader <williambader@hotmail.com> > // Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net> >-// Copyright (C) 2009-2011 Adrian Johnson <ajohnson@redneon.com> >+// Copyright (C) 2009-2011, 2013 Adrian Johnson <ajohnson@redneon.com> > // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it> > // Copyright (C) 2012 Lu Wang <coolwanglu@gmail.com> > // >@@ -1842,9 +1842,9 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) { > //~ add cases for external 16-bit fonts > switch (fontLoc->fontType) { > case fontType1: >- if (font->getName()) { >+ if (font->getEmbeddedFontName()) { > // this assumes that the PS font name matches the PDF font name >- psName = font->getName()->copy(); >+ psName = font->getEmbeddedFontName()->copy(); > } else { > //~ this won't work -- the PS font name won't match > psName = makePSFontName(font, font->getID()); >@@ -2140,9 +2140,8 @@ void PSOutputDev::setupEmbeddedType1Font(Ref *id, GooString *psName) { > strObj.free(); > } > >-//~ This doesn't handle .pfb files or binary eexec data (which only >-//~ happens in pfb files?). > void PSOutputDev::setupExternalType1Font(GooString *fileName, GooString *psName) { >+ static const char hexChar[17] = "0123456789abcdef"; > FILE *fontFile; > int c; > >@@ -2162,8 +2161,49 @@ void PSOutputDev::setupExternalType1Font(GooString *fileName, GooString *psName) > error(errIO, -1, "Couldn't open external font file"); > return; > } >- while ((c = fgetc(fontFile)) != EOF) { >+ >+ c = fgetc(fontFile); >+ if (c == 0x80) { >+ // PFB file >+ ungetc(c, fontFile); >+ while (!feof(fontFile)) { >+ fgetc(fontFile); // skip start of segment byte (0x80) >+ int segType = fgetc(fontFile); >+ long segLen = fgetc(fontFile) | >+ (fgetc(fontFile) << 8) | >+ (fgetc(fontFile) << 16) | >+ (fgetc(fontFile) << 24); >+ if (feof(fontFile)) >+ break; >+ >+ if (segType == 1) { >+ // ASCII segment >+ for (long i = 0; i < segLen; i++) { >+ c = fgetc(fontFile); >+ if (c == EOF) >+ break; >+ writePSChar(c); >+ } >+ } else if (segType == 2) { >+ // binary segment >+ for (long i = 0; i < segLen; i++) { >+ c = fgetc(fontFile); >+ if (c == EOF) >+ break; >+ writePSChar(hexChar[(c >> 4) & 0x0f]); >+ writePSChar(hexChar[c & 0x0f]); >+ if (i % 36 == 35) >+ writePSChar('\n'); >+ } >+ } else { >+ // end of file >+ break; >+ } >+ } >+ } else if (c != EOF) { > writePSChar(c); >+ while ((c = fgetc(fontFile)) != EOF) >+ writePSChar(c); > } > fclose(fontFile); > >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1090975
: 889286