1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #9230 from Snuffleupagus/issue-9195

Add basic support for non-embedded Calibri fonts (issue 9195)
This commit is contained in:
Brendan Dahl 2017-12-08 10:15:43 -08:00 committed by GitHub
commit af1d80d45e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 1 deletions

View file

@ -28,7 +28,7 @@ import {
} from './encodings';
import {
getGlyphMapForStandardFonts, getNonStdFontMap, getStdFontMap,
getSupplementalGlyphMapForArialBlack
getSupplementalGlyphMapForArialBlack, getSupplementalGlyphMapForCalibri
} from './standard_fonts';
import {
getUnicodeForGlyph, getUnicodeRangeFor, mapSpecialUnicodeValues
@ -1244,7 +1244,14 @@ var Font = (function FontClosure() {
for (charCode in SupplementalGlyphMapForArialBlack) {
map[+charCode] = SupplementalGlyphMapForArialBlack[charCode];
}
} else if (/Calibri/i.test(name)) {
let SupplementalGlyphMapForCalibri =
getSupplementalGlyphMapForCalibri();
for (charCode in SupplementalGlyphMapForCalibri) {
map[+charCode] = SupplementalGlyphMapForCalibri[charCode];
}
}
var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap;
if (!isIdentityUnicode) {
this.toUnicode.forEach(function(charCode, unicodeCharCode) {