[Pkg-javascript-commits] [pdf.js] 13/204: Workaround for TrueType fonts with exotic cmap tables (bug 1057544)

David Prévot taffit at moszumanska.debian.org
Sat Oct 25 18:50:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit cc8710acbf0f5f7d5648612a429cbb0c063fd51a
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sat Aug 23 00:03:13 2014 +0200

    Workaround for TrueType fonts with exotic cmap tables (bug 1057544)
---
 src/core/fonts.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/core/fonts.js b/src/core/fonts.js
index c30285f..7feab4d 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -4034,7 +4034,15 @@ var Font = (function FontClosure() {
         // where the the font is symbolic and it has an encoding.
         if (hasEncoding &&
             (cmapPlatformId === 3 && cmapEncodingId === 1 ||
-             cmapPlatformId === 1 && cmapEncodingId === 0)) {
+             cmapPlatformId === 1 && cmapEncodingId === 0) ||
+            (cmapPlatformId === -1 && cmapEncodingId === -1 && // Temporary hack
+             !!Encodings[properties.baseEncodingName])) {      // Temporary hack
+          // When no preferred cmap table was found and |baseEncodingName| is
+          // one of the predefined encodings, we seem to obtain a better
+          // |charCodeToGlyphId| map from the code below (fixes bug 1057544).
+          // TODO: Note that this is a hack which should be removed as soon as
+          //       we have proper support for more exotic cmap tables.
+
           var baseEncoding = [];
           if (properties.baseEncodingName === 'MacRomanEncoding' ||
               properties.baseEncodingName === 'WinAnsiEncoding') {

-- 
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