[Pkg-javascript-commits] [pdf.js] 32/157: Add a supplemental glyph map for non-embedded ArialBlack fonts (issue 5801)
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 06:46:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit d0477302bea07868e0d7a1d360ae5efee39f5b0a
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Wed Jul 1 22:16:52 2015 +0200
Add a supplemental glyph map for non-embedded ArialBlack fonts (issue 5801)
This should, hopefully, finally fix 5801.
---
src/core/fonts.js | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/core/fonts.js b/src/core/fonts.js
index 996dbf9..59aa7dd 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -508,6 +508,13 @@ var GlyphMapForStandardFonts = {
'3316': 578, '3379': 42785, '3393': 1159, '3416': 8377
};
+// The glyph map for ArialBlack differs slightly from the glyph map used for
+// other well-known standard fonts. Hence we use this (incomplete) CID to GID
+// mapping to adjust the glyph map for non-embedded ArialBlack fonts.
+var SupplementalGlyphMapForArialBlack = {
+ '227': 322, '264': 261, '291': 346,
+};
+
// Some characters, e.g. copyrightserif, are mapped to the private use area and
// might not be displayed using standard fonts. Mapping/hacking well-known chars
// to the similar equivalents in the normal characters range.
@@ -2490,8 +2497,13 @@ var Font = (function FontClosure() {
// Standard fonts might be embedded as CID font without glyph mapping.
// Building one based on GlyphMapForStandardFonts.
var map = [];
- for (var code in GlyphMapForStandardFonts) {
- map[+code] = GlyphMapForStandardFonts[code];
+ for (charCode in GlyphMapForStandardFonts) {
+ map[+charCode] = GlyphMapForStandardFonts[charCode];
+ }
+ if (/ArialBlack/i.test(name)) {
+ for (charCode in SupplementalGlyphMapForArialBlack) {
+ map[+charCode] = SupplementalGlyphMapForArialBlack[charCode];
+ }
}
var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap;
if (!isIdentityUnicode) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list