Skip to content

Commit fcdbf4a

Browse files
author
Christian Natis
committed
Fix font issues in Chrome
1 parent ee538b1 commit fcdbf4a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/dom-to-image.js

+6
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@
242242
if (source.cssText) target.cssText = source.cssText;
243243
else copyProperties(source, target);
244244

245+
// Chrome returns fontStretch from getComputedStyle in percent
246+
// but it does not accept a percent value when using the short hand
247+
// font = ....
248+
// Thus we have to reset fontStretch or we lose all our font styles
249+
target.fontStretch = 'normal';
250+
245251
function copyProperties(source, target) {
246252
util.asArray(source).forEach(function (name) {
247253
target.setProperty(

0 commit comments

Comments
 (0)