mirror of
https://github.com/penpot/penpot.git
synced 2025-06-18 08:01:40 +02:00
🐛 Fix problem with font weight and style
This commit is contained in:
parent
a63ded1ba1
commit
762a883b39
1 changed files with 24 additions and 4 deletions
|
@ -175,7 +175,12 @@
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [font (fonts/get-font-data (obj/get self "fontId"))
|
(let [font (fonts/get-font-data (obj/get self "fontId"))
|
||||||
variant (fonts/find-variant font {:weight (dm/str value)})]
|
weight (dm/str value)
|
||||||
|
style (obj/get self "fontStyle")
|
||||||
|
variant
|
||||||
|
(or
|
||||||
|
(fonts/find-variant font {:style style :weight weight})
|
||||||
|
(fonts/find-variant font {:weight weight}))]
|
||||||
(cond
|
(cond
|
||||||
(nil? variant)
|
(nil? variant)
|
||||||
(u/display-not-valid :fontWeight (dm/str "Font weight '" value "' not supported for the current font"))
|
(u/display-not-valid :fontWeight (dm/str "Font weight '" value "' not supported for the current font"))
|
||||||
|
@ -193,7 +198,12 @@
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [font (fonts/get-font-data (obj/get self "fontId"))
|
(let [font (fonts/get-font-data (obj/get self "fontId"))
|
||||||
variant (fonts/find-variant font {:style (dm/str value)})]
|
style (dm/str value)
|
||||||
|
weight (obj/get self "fontWeight")
|
||||||
|
variant
|
||||||
|
(or
|
||||||
|
(fonts/find-variant font {:weight weight :style style})
|
||||||
|
(fonts/find-variant font {:style style}))]
|
||||||
(cond
|
(cond
|
||||||
(nil? variant)
|
(nil? variant)
|
||||||
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
||||||
|
@ -439,7 +449,12 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")
|
(let [id (obj/get self "$id")
|
||||||
font (fonts/get-font-data (obj/get self "fontId"))
|
font (fonts/get-font-data (obj/get self "fontId"))
|
||||||
variant (fonts/find-variant font {:weight (dm/str value)})]
|
weight (dm/str value)
|
||||||
|
style (obj/get self "fontStyle")
|
||||||
|
variant
|
||||||
|
(or
|
||||||
|
(fonts/find-variant font {:style style :weight weight})
|
||||||
|
(fonts/find-variant font {:weight weight}))]
|
||||||
(cond
|
(cond
|
||||||
(nil? variant)
|
(nil? variant)
|
||||||
(u/display-not-valid :fontWeight (dm/str "Font weight '" value "' not supported for the current font"))
|
(u/display-not-valid :fontWeight (dm/str "Font weight '" value "' not supported for the current font"))
|
||||||
|
@ -456,7 +471,12 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")
|
(let [id (obj/get self "$id")
|
||||||
font (fonts/get-font-data (obj/get self "fontId"))
|
font (fonts/get-font-data (obj/get self "fontId"))
|
||||||
variant (fonts/find-variant font {:style (dm/str value)})]
|
style (dm/str value)
|
||||||
|
weight (obj/get self "fontWeight")
|
||||||
|
variant
|
||||||
|
(or
|
||||||
|
(fonts/find-variant font {:weight weight :style style})
|
||||||
|
(fonts/find-variant font {:style style}))]
|
||||||
(cond
|
(cond
|
||||||
(nil? variant)
|
(nil? variant)
|
||||||
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
(u/display-not-valid :fontStyle (dm/str "Font style '" value "' not supported for the current font"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue