From 8d036faf403fb71fd106f7f605251268feb6a658 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 12 Jul 2016 14:27:45 -0700 Subject: [PATCH] Move symbolic font glyphs to private use area if they don't have unicode mappings. --- src/core/fonts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/fonts.js b/src/core/fonts.js index 84a39f6a9e462..20ddf7fb7a85a 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -922,7 +922,9 @@ var Font = (function FontClosure() { var fontCharCode = originalCharCode; // First try to map the value to a unicode position if a non identity map // was created. + var hasUnicodeValue = false; if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { + hasUnicodeValue = true; var unicode = toUnicode.get(fontCharCode); // TODO: Try to map ligatures to the correct spot. if (unicode.length === 1) { @@ -937,7 +939,7 @@ var Font = (function FontClosure() { // with firefox and thuluthfont). if ((usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || - (isSymbolic && isIdentityUnicode)) && + (isSymbolic && (isIdentityUnicode || !hasUnicodeValue))) && nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left. // Loop to try and find a free spot in the private use area. do {