Browse Source

Merge pull request #5233 from Snuffleupagus/bug-1057544

Workaround for TrueType fonts with exotic cmap tables (bug 1057544)
Brendan Dahl 11 years ago
parent
commit
403b7df6e7
  1. 10
      src/core/fonts.js

10
src/core/fonts.js

@ -4063,7 +4063,15 @@ var Font = (function FontClosure() {
// where the the font is symbolic and it has an encoding. // where the the font is symbolic and it has an encoding.
if (hasEncoding && if (hasEncoding &&
(cmapPlatformId === 3 && cmapEncodingId === 1 || (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 = []; var baseEncoding = [];
if (properties.baseEncodingName === 'MacRomanEncoding' || if (properties.baseEncodingName === 'MacRomanEncoding' ||
properties.baseEncodingName === 'WinAnsiEncoding') { properties.baseEncodingName === 'WinAnsiEncoding') {

Loading…
Cancel
Save