Skip to content

Commit 7e9de40

Browse files
committed
Move the ligature fix into html2canvas
1 parent 997186a commit 7e9de40

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

html2pdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function html2pdf_makeTemplate(source, optCanvas, info) {
6262
// Set the overlay and template to be invisible
6363
overlayCSS.overflow = 'hidden';
6464
// overlayCSS.fontVariantLigatures = 'no-common-ligatures';
65-
overlayCSS.fontFeatureSettings = '"liga" 0';
65+
// overlayCSS.fontFeatureSettings = '"liga" 0';
6666
overlayCSS.opacity = 0;
6767

6868
// 2016-08-30:

lib/html2canvas.ek.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2261,9 +2261,14 @@ NodeParser.prototype.paintFormValue = function(container) {
22612261
NodeParser.prototype.paintText = function(container) {
22622262
container.applyTextTransform();
22632263
var characters = punycode.ucs2.decode(container.node.data);
2264-
var textList = (!this.options.letterRendering || noLetterSpacing(container)) && !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character) {
2264+
// EK 2017-03-25: Ligature fix.
2265+
var wordRendering = (!this.options.letterRendering || noLetterSpacing(container)) && !hasUnicode(container.node.data);
2266+
var textList = wordRendering ? getWords(characters) : characters.map(function(character) {
22652267
return punycode.ucs2.encode([character]);
22662268
});
2269+
if (!wordRendering) {
2270+
container.parent.node.style.fontFeatureSettings = '"liga" 0';
2271+
}
22672272

22682273
var weight = container.parent.fontWeight();
22692274
var size = container.parent.css('fontSize');

0 commit comments

Comments
 (0)