Avoid drawing text when the font size is zero (issue 4484)

This commit is contained in:
Jonas Jenwald 2014-03-30 13:36:21 +02:00
parent 7d5bf83ce8
commit 08eb9a960a

View File

@ -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();