如果字母组合为 "fi",html2canvas 会错误地呈现字体系列

html2canvas renders the font family incorrectly if the letter combination is "fi"

我正在尝试使用 html2canvas 库生成 div 标签的图像,但它不起作用。如果文本包含字母 fi.

的组合,则字体无法正确呈现

请看一下这张截图来了解一下:

请检查我的Fiddle

我做了很多研究,但无法提出解决方案。

请帮帮我。

提前致谢。

我设法通过 this 线程自行修复了它。这是一个连字问题,这里是修复它的代码。

var el = document.getElementById('myElement');
el.style.fontFeatureSettings = '"liga" 0';
html2canvas(el, options);

这是工作 Fiddle