|
299 | 299 | this.path = origPath;
|
300 | 300 | }
|
301 | 301 |
|
302 |
| - this.pdf.text(text, x, this._getBaseline(y), null, degs); |
| 302 | + var scale; |
| 303 | + if (this.pdf.hotfix && this.pdf.hotfix.scale_text) { |
| 304 | + scale = this._getTransform()[0]; |
| 305 | + } |
| 306 | + else { |
| 307 | + scale = 1; |
| 308 | + } |
| 309 | + if (scale === 1) { |
| 310 | + this.pdf.text(text, x, this._getBaseline(y), null, degs); |
| 311 | + } |
| 312 | + else { |
| 313 | + var oldSize = this.pdf.internal.getFontSize(); |
| 314 | + this.pdf.setFontSize(oldSize * scale); |
| 315 | + this.pdf.text(text, x, this._getBaseline(y), null, degs); |
| 316 | + this.pdf.setFontSize(oldSize); |
| 317 | + } |
303 | 318 |
|
304 | 319 | if (this.ctx._clip_path.length > 0) {
|
305 | 320 | lines.push('Q');
|
|
337 | 352 | this.path = origPath;
|
338 | 353 | }
|
339 | 354 |
|
340 |
| - this.pdf.text(text, x, this._getBaseline(y), { |
| 355 | + var scale; |
| 356 | + if (this.pdf.hotfix && this.pdf.hotfix.scale_text) { |
| 357 | + scale = this._getTransform()[0]; |
| 358 | + } |
| 359 | + else { |
| 360 | + scale = 1; |
| 361 | + } |
| 362 | + if (scale === 1) { |
| 363 | + this.pdf.text(text, x, this._getBaseline(y), { |
341 | 364 | stroke: true
|
342 | 365 | }, degs);
|
| 366 | + } |
| 367 | + else { |
| 368 | + var oldSize = this.pdf.internal.getFontSize(); |
| 369 | + this.pdf.setFontSize(oldSize * scale); |
| 370 | + this.pdf.text(text, x, this._getBaseline(y), { |
| 371 | + stroke: true |
| 372 | + }, degs); |
| 373 | + this.pdf.setFontSize(oldSize); |
| 374 | + } |
343 | 375 |
|
344 | 376 | if (this.ctx._clip_path.length > 0) {
|
345 | 377 | lines.push('Q');
|
|
1219 | 1251 | getWidth: function () {
|
1220 | 1252 | var fontSize = pdf.internal.getFontSize();
|
1221 | 1253 | var txtWidth = pdf.getStringUnitWidth(text) * fontSize / pdf.internal.scaleFactor;
|
| 1254 | + // Convert points to pixels |
| 1255 | + txtWidth *= 1.3333; |
1222 | 1256 | return txtWidth;
|
1223 | 1257 | },
|
1224 | 1258 |
|
|
0 commit comments