summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2011-10-20 00:34:25 +0200
committerAlbert Astals Cid <aacid@kde.org>2011-10-20 00:34:25 +0200
commit39e83f32bbab6eb2cbacbd11b3688b64356f8b1f (patch)
treea9d52e70062c095b9f6fb3d78321bc46f76907a3
parent880a61e6bb27dd8f8cdbfdbeb3e0e4127cd88992 (diff)
xpdf303: StdFontMapEntry renaming
-rw-r--r--ALL_DIFF75
1 files changed, 1 insertions, 74 deletions
diff --git a/ALL_DIFF b/ALL_DIFF
index 41cb956..db49d8d 100644
--- a/ALL_DIFF
+++ b/ALL_DIFF
@@ -9176,28 +9176,6 @@ diff -ru xpdf-3.02/xpdf/GfxFont.cc xpdf-3.03/xpdf/GfxFont.cc
#include "FoFiType1.h"
#include "FoFiType1C.h"
#include "FoFiTrueType.h"
-@@ -32,17 +38,12 @@
-
- //------------------------------------------------------------------------
-
--struct StdFontMapEntry {
-- const char *altName;
-- const char *properName;
-+struct Base14FontMapEntry {
-+ const char *altName;
-+ const char *base14Name;
- };
-
--// Acrobat 4.0 and earlier substituted Base14-compatible fonts without
--// providing Widths and a FontDescriptor, so we munge the names into
--// the proper Base14 names. This table is from implementation note 44
--// in the PDF 1.4 spec, with some additions based on empirical
--// evidence.
--static StdFontMapEntry stdFontMap[] = {
-+static Base14FontMapEntry base14FontMap[] = {
- { "Arial", "Helvetica" },
- { "Arial,Bold", "Helvetica-Bold" },
- { "Arial,BoldItalic", "Helvetica-BoldOblique" },
@@ -54,9 +55,13 @@
{ "Arial-Italic", "Helvetica-Oblique" },
{ "Arial-ItalicMT", "Helvetica-Oblique" },
@@ -10019,45 +9997,10 @@ diff -ru xpdf-3.02/xpdf/GfxFont.cc xpdf-3.03/xpdf/GfxFont.cc
// do font name substitution for various aliases of the Base 14 font
// names
-+ base14 = NULL;
+ base14 = NULL;
if (name) {
name2 = name->copy();
i = 0;
-@@ -444,27 +872,27 @@
- }
- }
- a = 0;
-- b = sizeof(stdFontMap) / sizeof(StdFontMapEntry);
-- // invariant: stdFontMap[a].altName <= name2 < stdFontMap[b].altName
-+ b = sizeof(base14FontMap) / sizeof(Base14FontMapEntry);
-+ // invariant: base14FontMap[a].altName <= name2 < base14FontMap[b].altName
- while (b - a > 1) {
- m = (a + b) / 2;
-- if (name2->cmp(stdFontMap[m].altName) >= 0) {
-+ if (name2->cmp(base14FontMap[m].altName) >= 0) {
- a = m;
- } else {
- b = m;
- }
- }
-- if (!name2->cmp(stdFontMap[a].altName)) {
-- name = new GString(stdFontMap[a].properName);
-+ if (!name2->cmp(base14FontMap[a].altName)) {
-+ base14 = &base14FontMap[a];
- }
- delete name2;
- }
-
- // is it a built-in font?
- builtinFont = NULL;
-- if (name) {
-+ if (base14) {
- for (i = 0; i < nBuiltinFonts; ++i) {
-- if (!name->cmp(builtinFonts[i].name)) {
-+ if (!strcmp(base14->base14Name, builtinFonts[i].name)) {
- builtinFont = &builtinFonts[i];
- break;
- }
@@ -499,9 +927,6 @@
fontBBox[3] = 0.001 * builtinFont->bbox[3];
}
@@ -10475,14 +10418,6 @@ diff -ru xpdf-3.02/xpdf/GfxFont.cc xpdf-3.03/xpdf/GfxFont.cc
diff -ru xpdf-3.02/xpdf/GfxFont.h xpdf-3.03/xpdf/GfxFont.h
--- xpdf-3.02/xpdf/GfxFont.h 2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.03/xpdf/GfxFont.h 2011-08-15 23:08:53.000000000 +0200
-@@ -25,6 +25,7 @@
- class CharCodeToUnicode;
- class FoFiTrueType;
- struct GfxFontCIDWidths;
-+struct Base14FontMapEntry;
-
- //------------------------------------------------------------------------
- // GfxFontType
@@ -76,6 +77,41 @@
};
@@ -10613,14 +10548,6 @@ diff -ru xpdf-3.02/xpdf/GfxFont.h xpdf-3.03/xpdf/GfxFont.h
virtual ~Gfx8BitFont();
-@@ -238,6 +273,7 @@
-
- private:
-
-+ Base14FontMapEntry *base14; // for Base-14 fonts only; NULL otherwise
- char *enc[256]; // char code --> char name
- char encFree[256]; // boolean for each char name: if set,
- // the string is malloc'ed
@@ -247,6 +283,8 @@
double widths[256]; // character widths
Object charProcs; // Type 3 CharProcs dictionary