Skip to content

Commit

Permalink
Merge pull request mozilla#5233 from Snuffleupagus/bug-1057544
Browse files Browse the repository at this point in the history
Workaround for TrueType fonts with exotic cmap tables (bug 1057544)
  • Loading branch information
brendandahl committed Sep 15, 2014
2 parents 74d02c3 + cc8710a commit 403b7df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4063,7 +4063,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') {
Expand Down

0 comments on commit 403b7df

Please sign in to comment.