Skip to content

Commit

Permalink
Move symbolic font glyphs to private use area if they don't have unic…
Browse files Browse the repository at this point in the history
…ode mappings.
  • Loading branch information
brendandahl authored and Snuffleupagus committed Oct 26, 2016
1 parent 47a1c77 commit 8d036fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 8d036fa

Please sign in to comment.