From 8f5f88743bb42da4433b050c7cd67da424bc50a6 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 7 Aug 2025 11:14:40 +0200 Subject: [PATCH] :sparkles: Normalize font variant naming for google fonts (#7083) --- CHANGES.md | 1 + frontend/src/app/main/fonts.clj | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0505904ce4..394294470c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ - Fix issue where multiple dropdown menus could be opened simultaneously on the dashboard page [Taiga #11500](https://tree.taiga.io/project/penpot/issue/11500) - Fix font size/variant not updated when editing a text [Taiga #11552](https://tree.taiga.io/project/penpot/issue/11552) - Fix issue where Alt + arrow keys shortcut interferes with letter-spacing when moving text layers [Taiga #11552](https://tree.taiga.io/project/penpot/issue/11771) +- Fix consistency issues on how font variants are visualized [Taiga #11499](https://tree.taiga.io/project/penpot/us/11499) ## 2.9.0 (Unreleased) diff --git a/frontend/src/app/main/fonts.clj b/frontend/src/app/main/fonts.clj index 80f4ca0a05..b0f5ba60a1 100644 --- a/frontend/src/app/main/fonts.clj +++ b/frontend/src/app/main/fonts.clj @@ -16,15 +16,15 @@ [variant files] (cond (= "regular" variant) - {:id "regular" :name "regular" :weight "400" :style "normal" :ttf-url (get files "regular")} + {:id "regular" :name "400" :weight "400" :style "normal" :ttf-url (get files "regular")} (= "italic" variant) - {:id "italic" :name "italic" :weight "400" :style "italic" :ttf-url (get files "italic")} + {:id "italic" :name "400 Italic" :weight "400" :style "italic" :ttf-url (get files "italic")} :else (when-let [[id weight style] (re-find #"^(\d+)(.*)$" variant)] {:id id - :name variant + :name (str/trim (str weight " " (str/capital style))) :weight weight :style (if (str/empty? style) "normal" style) :ttf-url (get files id)})))