Skip to content

Commit 28afd16

Browse files
committed
fix non-numeric font weight (regression from variable font weight support)
1 parent 10910de commit 28afd16

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/styles/text/text_settings.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ const TextSettings = {
9898

9999
// clamp weight to 1-1000 (see https://drafts.csswg.org/css-fonts-4/#valdef-font-weight-number)
100100
style.weight = StyleParser.evalCachedProperty(draw.font.weight, context) || this.defaults.weight;
101-
style.weight = Math.min(Math.max(style.weight, 1), 1000);
101+
if (typeof style.weight === 'number') {
102+
style.weight = Math.min(Math.max(style.weight, 1), 1000);
103+
}
102104

103105
if (draw.font.family) {
104106
style.family = draw.font.family;

0 commit comments

Comments
 (0)