0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Fix issues related to font family names with spaces.

This commit is contained in:
Andrey Antukh 2021-05-17 12:16:15 +02:00 committed by Alonso Torres
parent 2ea200be78
commit 9c99ec3410
2 changed files with 9 additions and 9 deletions

View file

@ -27,7 +27,8 @@
### :bug: Bugs fixed ### :bug: Bugs fixed
- Remove interactions when the destination artboard is deleted [Taiga #1656](https://tree.taiga.io/project/penpot/issue/1656) - Remove interactions when the destination artboard is deleted [Taiga #1656](https://tree.taiga.io/project/penpot/issue/1656).
- Fix problem with fonts that ends with numbers [#940](https://github.com/penpot/penpot/issues/940).
### :arrow_up: Deps updates ### :arrow_up: Deps updates

View file

@ -65,9 +65,7 @@
font-id (:font-id data (:font-id txt/default-text-attrs)) font-id (:font-id data (:font-id txt/default-text-attrs))
font-variant-id (:font-variant-id data) font-variant-id (:font-variant-id data)
font-family (:font-family data)
font-size (:font-size data) font-size (:font-size data)
fill-color (:fill-color data) fill-color (:fill-color data)
fill-opacity (:fill-opacity data) fill-opacity (:fill-opacity data)
@ -106,14 +104,15 @@
(pos? (alength font-id))) (pos? (alength font-id)))
(fonts/ensure-loaded! font-id) (fonts/ensure-loaded! font-id)
(let [font (get fontsdb font-id)] (let [font (get fontsdb font-id)]
(let [font-family (or (:family font) (let [font-family (str/quote
(obj/get data "fontFamily")) (or (:family font)
(:font-family data)))
font-variant (d/seek #(= font-variant-id (:id %)) font-variant (d/seek #(= font-variant-id (:id %))
(:variants font)) (:variants font))
font-style (or (:style font-variant) font-style (or (:style font-variant)
(obj/get data "fontStyle")) (:font-style data))
font-weight (or (:weight font-variant) font-weight (or (:weight font-variant)
(obj/get data "fontWeight"))] (:font-weight data))]
(obj/set! base "fontFamily" font-family) (obj/set! base "fontFamily" font-family)
(obj/set! base "fontStyle" font-style) (obj/set! base "fontStyle" font-style)
(obj/set! base "fontWeight" font-weight)))) (obj/set! base "fontWeight" font-weight))))