mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #4535 from Snuffleupagus/issue-4484
Avoid drawing text when the font size is zero (issue 4484)
This commit is contained in:
commit
dc0e60d103
1 changed files with 13 additions and 0 deletions
|
@ -1329,6 +1329,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