Mapping well-known chars to the similar equivalents in the normal characters range
This commit is contained in:
parent
10a0a60f8e
commit
5415fed14d
19
src/fonts.js
19
src/fonts.js
@ -418,6 +418,19 @@ var symbolsFonts = {
|
||||
'Dingbats': true, 'Symbol': true, 'ZapfDingbats': true
|
||||
};
|
||||
|
||||
// Some characters, e.g. copyrightserif, mapped to the private use area and
|
||||
// might not be displayed using standard fonts. Mapping/hacking well-known chars
|
||||
// to the similar equivalents in the normal characters range.
|
||||
function mapPrivateUseChars(code) {
|
||||
switch (code) {
|
||||
case 0xF8E9: // copyrightsans
|
||||
case 0xF6D9: // copyrightserif
|
||||
return 0x00A9; // copyright
|
||||
default:
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
var FontLoader = {
|
||||
listeningForFontLoad: false,
|
||||
|
||||
@ -2199,7 +2212,7 @@ var Font = (function FontClosure() {
|
||||
case 'CIDFontType0':
|
||||
if (this.noUnicodeAdaptation) {
|
||||
width = this.widths[this.unicodeToCID[charcode] || charcode];
|
||||
unicode = charcode;
|
||||
unicode = mapPrivateUseChars(charcode);
|
||||
break;
|
||||
}
|
||||
unicode = this.toUnicode[charcode] || charcode;
|
||||
@ -2207,7 +2220,7 @@ var Font = (function FontClosure() {
|
||||
case 'CIDFontType2':
|
||||
if (this.noUnicodeAdaptation) {
|
||||
width = this.widths[this.unicodeToCID[charcode] || charcode];
|
||||
unicode = charcode;
|
||||
unicode = mapPrivateUseChars(charcode);
|
||||
break;
|
||||
}
|
||||
unicode = this.toUnicode[charcode] || charcode;
|
||||
@ -2217,7 +2230,7 @@ var Font = (function FontClosure() {
|
||||
if (!isNum(width))
|
||||
width = this.widths[glyphName];
|
||||
if (this.noUnicodeAdaptation) {
|
||||
unicode = GlyphsUnicode[glyphName] || charcode;
|
||||
unicode = mapPrivateUseChars(GlyphsUnicode[glyphName] || charcode);
|
||||
break;
|
||||
}
|
||||
unicode = this.glyphNameMap[glyphName] ||
|
||||
|
Loading…
Reference in New Issue
Block a user