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 858703 Details for
Bug 1059758
Cannot display attached PDF properly
[?]
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]
filter returned fonts by type
font-filter.patch (text/plain), 6.36 KB, created by
Marek Kašík
on 2014-02-03 16:57:02 UTC
(
hide
)
Description:
filter returned fonts by type
Filename:
MIME Type:
Creator:
Marek Kašík
Created:
2014-02-03 16:57:02 UTC
Size:
6.36 KB
patch
obsolete
>diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc >index 01a3157..0ce3da7 100644 >--- a/poppler/GlobalParams.cc >+++ b/poppler/GlobalParams.cc >@@ -221,8 +221,9 @@ public: > GooString *pathA, SysFontType typeA, int fontNumA, GooString *substituteNameA); > ~SysFontInfo(); > GBool match(SysFontInfo *fi); >- GBool match(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA); >- GBool match(GooString *nameA, GBool boldA, GBool italicA); >+ GBool match(GooString *nameA, GfxFontType typeA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA); >+ GBool match(GooString *nameA, GfxFontType typeA, GBool boldA, GBool italicA); >+ GBool matchType(SysFontType typeA, GfxFontType typeB); > }; > > SysFontInfo::SysFontInfo(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA, >@@ -246,17 +247,30 @@ SysFontInfo::~SysFontInfo() { > > GBool SysFontInfo::match(SysFontInfo *fi) { > return !strcasecmp(name->getCString(), fi->name->getCString()) && >- bold == fi->bold && italic == fi->italic && oblique == fi->oblique && fixedWidth == fi->fixedWidth; >+ bold == fi->bold && italic == fi->italic && oblique == fi->oblique && fixedWidth == fi->fixedWidth && >+ type == fi->type; > } > >-GBool SysFontInfo::match(GooString *nameA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA) { >+GBool SysFontInfo::match(GooString *nameA, GfxFontType typeA, GBool boldA, GBool italicA, GBool obliqueA, GBool fixedWidthA) { > return !strcasecmp(name->getCString(), nameA->getCString()) && >- bold == boldA && italic == italicA && oblique == obliqueA && fixedWidth == fixedWidthA; >+ bold == boldA && italic == italicA && oblique == obliqueA && fixedWidth == fixedWidthA && >+ matchType (type, typeA); > } > >-GBool SysFontInfo::match(GooString *nameA, GBool boldA, GBool italicA) { >+GBool SysFontInfo::match(GooString *nameA, GfxFontType typeA, GBool boldA, GBool italicA) { > return !strcasecmp(name->getCString(), nameA->getCString()) && >- bold == boldA && italic == italicA; >+ bold == boldA && italic == italicA && >+ matchType (type, typeA); >+} >+ >+GBool SysFontInfo::matchType(SysFontType typeA, GfxFontType typeB) { >+ return ((typeA == sysFontPFA || typeA == sysFontPFB) && >+ (typeB == fontType1 || typeB == fontType1C || >+ typeB == fontType1COT || typeB == fontCIDType0 || >+ typeB == fontCIDType0C || typeB == fontCIDType0COT)) || >+ ((typeA == sysFontTTF || typeA == sysFontTTC) && >+ (typeB == fontTrueType || typeB == fontTrueTypeOT || >+ typeB == fontCIDType2 || typeB == fontCIDType2OT)); > } > > //------------------------------------------------------------------------ >@@ -268,7 +282,7 @@ public: > > SysFontList(); > ~SysFontList(); >- SysFontInfo *find(GooString *name, GBool isFixedWidth, GBool exact); >+ SysFontInfo *find(GooString *name, GfxFontType type, GBool isFixedWidth, GBool exact); > > #ifdef WIN32 > void scanWindowsFonts(GooString *winFontDir); >@@ -294,7 +308,7 @@ SysFontList::~SysFontList() { > deleteGooList(fonts, SysFontInfo); > } > >-SysFontInfo *SysFontList::find(GooString *name, GBool fixedWidth, GBool exact) { >+SysFontInfo *SysFontList::find(GooString *name, GfxFontType type, GBool fixedWidth, GBool exact) { > GooString *name2; > GBool bold, italic, oblique; > SysFontInfo *fi; >@@ -376,7 +390,7 @@ SysFontInfo *SysFontList::find(GooString *name, GBool fixedWidth, GBool exact) { > fi = NULL; > for (i = 0; i < fonts->getLength(); ++i) { > fi = (SysFontInfo *)fonts->get(i); >- if (fi->match(name2, bold, italic, oblique, fixedWidth)) { >+ if (fi->match(name2, type, bold, italic, oblique, fixedWidth)) { > break; > } > fi = NULL; >@@ -385,7 +399,7 @@ SysFontInfo *SysFontList::find(GooString *name, GBool fixedWidth, GBool exact) { > // try ignoring the bold flag > for (i = 0; i < fonts->getLength(); ++i) { > fi = (SysFontInfo *)fonts->get(i); >- if (fi->match(name2, gFalse, italic)) { >+ if (fi->match(name2, type, gFalse, italic)) { > break; > } > fi = NULL; >@@ -395,7 +409,7 @@ SysFontInfo *SysFontList::find(GooString *name, GBool fixedWidth, GBool exact) { > // try ignoring the bold and italic flags > for (i = 0; i < fonts->getLength(); ++i) { > fi = (SysFontInfo *)fonts->get(i); >- if (fi->match(name2, gFalse, gFalse)) { >+ if (fi->match(name2, type, gFalse, gFalse)) { > break; > } > fi = NULL; >@@ -1185,7 +1199,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font, > if (!fontName) return NULL; > lockGlobalParams; > >- if ((fi = sysFonts->find(fontName, font->isFixedWidth(), gTrue))) { >+ if ((fi = sysFonts->find(fontName, font->getType (), font->isFixedWidth(), gTrue))) { > path = fi->path->copy(); > *type = fi->type; > *fontNum = fi->fontNum; >@@ -1257,7 +1271,13 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font, > ext = strrchr((char*)s,'.'); > if (!ext) > continue; >- if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext, ".ttc", 4) || !strncasecmp(ext, ".otf", 4)) >+ if ((font->getType() == fontTrueType || >+ font->getType() == fontTrueTypeOT || >+ font->getType() == fontCIDType2 || >+ font->getType() == fontCIDType2OT) && >+ (!strncasecmp(ext,".ttf",4) || >+ !strncasecmp(ext, ".ttc", 4) || >+ !strncasecmp(ext, ".otf", 4))) > { > int weight, slant; > GBool bold = font->isBold(); >@@ -1282,7 +1302,14 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font, > sysFonts->addFcFont(fi); > path = new GooString((char*)s); > } >- else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4)) >+ else if ((font->getType() == fontType1 || >+ font->getType() == fontType1C || >+ font->getType() == fontType1COT || >+ font->getType() == fontCIDType0 || >+ font->getType() == fontCIDType0C || >+ font->getType() == fontCIDType0COT) && >+ (!strncasecmp(ext,".pfa",4) || >+ !strncasecmp(ext,".pfb",4))) > { > int weight, slant; > GBool bold = font->isBold(); >@@ -1321,7 +1348,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font, > } > FcFontSetDestroy(set); > } >- if (path == NULL && (fi = sysFonts->find(fontName, font->isFixedWidth(), gFalse))) { >+ if (path == NULL && (fi = sysFonts->find(fontName, font->getType(), font->isFixedWidth(), gFalse))) { > path = fi->path->copy(); > *type = fi->type; > *fontNum = fi->fontNum;
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 1059758
: 858703