mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 17:18:07 +02:00
Support TrueType Font
This commit is contained in:
parent
c166db13fd
commit
4d261759d9
2 changed files with 35 additions and 2 deletions
9
pdf.js
9
pdf.js
|
@ -2292,7 +2292,14 @@ var CanvasGraphics = (function() {
|
|||
break;
|
||||
|
||||
case "TrueType":
|
||||
TODO("implement TrueType support");
|
||||
var fontDescriptor = font.get("FontDescriptor");
|
||||
if (fontDescriptor.num) {
|
||||
var fontDescriptor = this.xref.fetchIfRef(fontDescriptor);
|
||||
var fontFile = this.xref.fetchIfRef(fontDescriptor.get("FontFile2"));
|
||||
fontName = fontDescriptor.get("FontName").name;
|
||||
fontName = fontName.replace("+", ""); // no + are allowed in the font name
|
||||
font = new TrueTypeFont(fontName, fontFile);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue