mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Provides right fallback fonts for text layer
This commit is contained in:
parent
53c66f8a54
commit
ac7b6aeff4
4 changed files with 9 additions and 14 deletions
|
@ -596,8 +596,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
(fontObj.bold ? 'bold' : 'normal');
|
||||
|
||||
var italic = fontObj.italic ? 'italic' : 'normal';
|
||||
var serif = fontObj.isSerifFont ? 'serif' : 'sans-serif';
|
||||
var typeface = '"' + name + '", ' + serif;
|
||||
var typeface = '"' + name + '", ' + fontObj.fallbackName;
|
||||
|
||||
// Some font backends cannot handle fonts below certain size.
|
||||
// Keeping the font at minimal size and using the fontSizeScale to change
|
||||
|
@ -792,7 +791,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
}
|
||||
|
||||
if (textSelection)
|
||||
this.textLayer.appendText(text, font.loadedName, fontSize);
|
||||
this.textLayer.appendText(text, font.fallbackName, fontSize);
|
||||
|
||||
return text;
|
||||
},
|
||||
|
@ -856,7 +855,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
}
|
||||
|
||||
if (textSelection)
|
||||
this.textLayer.appendText(text, font.loadedName, fontSize);
|
||||
this.textLayer.appendText(text, font.fallbackName, fontSize);
|
||||
},
|
||||
nextLineShowText: function CanvasGraphics_nextLineShowText(text) {
|
||||
this.nextLine();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue