|
|
@ -2409,6 +2409,10 @@ var Font = (function FontClosure() { |
|
|
|
// Repair the TrueType file. It is can be damaged in the point of
|
|
|
|
// Repair the TrueType file. It is can be damaged in the point of
|
|
|
|
// view of the sanitizer
|
|
|
|
// view of the sanitizer
|
|
|
|
data = this.checkAndRepair(name, file, properties); |
|
|
|
data = this.checkAndRepair(name, file, properties); |
|
|
|
|
|
|
|
if (!data) { |
|
|
|
|
|
|
|
// TrueType data is not found, e.g. when the font is an OpenType font
|
|
|
|
|
|
|
|
warn('Font is not a TrueType font'); |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
@ -3696,6 +3700,8 @@ var Font = (function FontClosure() { |
|
|
|
prep = table; |
|
|
|
prep = table; |
|
|
|
else if (table.tag == 'cvt ') |
|
|
|
else if (table.tag == 'cvt ') |
|
|
|
cvt = table; |
|
|
|
cvt = table; |
|
|
|
|
|
|
|
else if (table.tag == 'CFF ') |
|
|
|
|
|
|
|
return null; // XXX: OpenType font is found, stopping
|
|
|
|
else // skipping table if it's not a required or optional table
|
|
|
|
else // skipping table if it's not a required or optional table
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -5257,6 +5263,7 @@ Type1Font.prototype = { |
|
|
|
getOrderedCharStrings: function Type1Font_getOrderedCharStrings(glyphs, |
|
|
|
getOrderedCharStrings: function Type1Font_getOrderedCharStrings(glyphs, |
|
|
|
properties) { |
|
|
|
properties) { |
|
|
|
var charstrings = []; |
|
|
|
var charstrings = []; |
|
|
|
|
|
|
|
var usedUnicodes = []; |
|
|
|
var i, length, glyphName; |
|
|
|
var i, length, glyphName; |
|
|
|
var unusedUnicode = CMAP_GLYPH_OFFSET; |
|
|
|
var unusedUnicode = CMAP_GLYPH_OFFSET; |
|
|
|
for (i = 0, length = glyphs.length; i < length; i++) { |
|
|
|
for (i = 0, length = glyphs.length; i < length; i++) { |
|
|
@ -5264,6 +5271,10 @@ Type1Font.prototype = { |
|
|
|
var glyphName = item.glyph; |
|
|
|
var glyphName = item.glyph; |
|
|
|
var unicode = glyphName in GlyphsUnicode ? |
|
|
|
var unicode = glyphName in GlyphsUnicode ? |
|
|
|
GlyphsUnicode[glyphName] : unusedUnicode++; |
|
|
|
GlyphsUnicode[glyphName] : unusedUnicode++; |
|
|
|
|
|
|
|
while (usedUnicodes[unicode]) { |
|
|
|
|
|
|
|
unicode = unusedUnicode++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
usedUnicodes[unicode] = true; |
|
|
|
charstrings.push({ |
|
|
|
charstrings.push({ |
|
|
|
glyph: glyphName, |
|
|
|
glyph: glyphName, |
|
|
|
unicode: unicode, |
|
|
|
unicode: unicode, |
|
|
|