mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Avoid drawing text when the font size is zero (issue 4484)
This commit is contained in:
parent
7d5bf83ce8
commit
08eb9a960a
1 changed files with 13 additions and 0 deletions
|
@ -1322,6 +1322,19 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
var vertical = font.vertical;
|
||||
var defaultVMetrics = font.defaultVMetrics;
|
||||
|
||||
if (fontSize === 0) {
|
||||
if (textSelection) {
|
||||
geom = this.createTextGeometry();
|
||||
geom.canvasWidth = canvasWidth;
|
||||
if (vertical) {
|
||||
var VERTICAL_TEXT_ROTATION = Math.PI / 2;
|
||||
geom.angle += VERTICAL_TEXT_ROTATION;
|
||||
}
|
||||
this.textLayer.appendText(geom);
|
||||
}
|
||||
return canvasWidth;
|
||||
}
|
||||
|
||||
// Type3 fonts - each glyph is a "mini-PDF"
|
||||
if (font.coded) {
|
||||
ctx.save();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue