|
|
|
@ -191,7 +191,7 @@ function getFontType(type, subtype) {
@@ -191,7 +191,7 @@ function getFontType(type, subtype) {
|
|
|
|
|
|
|
|
|
|
var Glyph = (function GlyphClosure() { |
|
|
|
|
function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, |
|
|
|
|
isSpace) { |
|
|
|
|
isSpace, isInFont) { |
|
|
|
|
this.fontChar = fontChar; |
|
|
|
|
this.unicode = unicode; |
|
|
|
|
this.accent = accent; |
|
|
|
@ -199,17 +199,20 @@ var Glyph = (function GlyphClosure() {
@@ -199,17 +199,20 @@ var Glyph = (function GlyphClosure() {
|
|
|
|
|
this.vmetric = vmetric; |
|
|
|
|
this.operatorListId = operatorListId; |
|
|
|
|
this.isSpace = isSpace; |
|
|
|
|
this.isInFont = isInFont; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, |
|
|
|
|
vmetric, operatorListId, isSpace) { |
|
|
|
|
vmetric, operatorListId, isSpace, |
|
|
|
|
isInFont) { |
|
|
|
|
return this.fontChar === fontChar && |
|
|
|
|
this.unicode === unicode && |
|
|
|
|
this.accent === accent && |
|
|
|
|
this.width === width && |
|
|
|
|
this.vmetric === vmetric && |
|
|
|
|
this.operatorListId === operatorListId && |
|
|
|
|
this.isSpace === isSpace; |
|
|
|
|
this.isSpace === isSpace && |
|
|
|
|
this.isInFont === isInFont; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return Glyph; |
|
|
|
@ -468,6 +471,7 @@ var Font = (function FontClosure() {
@@ -468,6 +471,7 @@ var Font = (function FontClosure() {
|
|
|
|
|
this.loadedName = properties.loadedName; |
|
|
|
|
this.isType3Font = properties.isType3Font; |
|
|
|
|
this.sizes = []; |
|
|
|
|
this.missingFile = false; |
|
|
|
|
|
|
|
|
|
this.glyphCache = Object.create(null); |
|
|
|
|
|
|
|
|
@ -2810,6 +2814,7 @@ var Font = (function FontClosure() {
@@ -2810,6 +2814,7 @@ var Font = (function FontClosure() {
|
|
|
|
|
unicode = String.fromCharCode(unicode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var isInFont = charcode in this.toFontChar; |
|
|
|
|
// First try the toFontChar map, if it's not there then try falling
|
|
|
|
|
// back to the char code.
|
|
|
|
|
fontCharCode = this.toFontChar[charcode] || charcode; |
|
|
|
@ -2824,6 +2829,7 @@ var Font = (function FontClosure() {
@@ -2824,6 +2829,7 @@ var Font = (function FontClosure() {
|
|
|
|
|
|
|
|
|
|
var accent = null; |
|
|
|
|
if (this.seacMap && this.seacMap[charcode]) { |
|
|
|
|
isInFont = true; |
|
|
|
|
var seac = this.seacMap[charcode]; |
|
|
|
|
fontCharCode = seac.baseFontCharCode; |
|
|
|
|
accent = { |
|
|
|
@ -2837,9 +2843,9 @@ var Font = (function FontClosure() {
@@ -2837,9 +2843,9 @@ var Font = (function FontClosure() {
|
|
|
|
|
var glyph = this.glyphCache[charcode]; |
|
|
|
|
if (!glyph || |
|
|
|
|
!glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, |
|
|
|
|
operatorListId, isSpace)) { |
|
|
|
|
operatorListId, isSpace, isInFont)) { |
|
|
|
|
glyph = new Glyph(fontChar, unicode, accent, width, vmetric, |
|
|
|
|
operatorListId, isSpace); |
|
|
|
|
operatorListId, isSpace, isInFont); |
|
|
|
|
this.glyphCache[charcode] = glyph; |
|
|
|
|
} |
|
|
|
|
return glyph; |
|
|
|
|