From 684e2b695035d364b0f04d64d00a56d73594b3f1 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 13 Feb 2026 11:51:04 +0100 Subject: [PATCH] :bug: Fix non existent google font --- frontend/src/app/render_wasm/api/fonts.cljs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/render_wasm/api/fonts.cljs b/frontend/src/app/render_wasm/api/fonts.cljs index 09a0adfac2..8c73f85e2d 100644 --- a/frontend/src/app/render_wasm/api/fonts.cljs +++ b/frontend/src/app/render_wasm/api/fonts.cljs @@ -31,9 +31,17 @@ (def ^:private default-letter-spacing 0.0) (defn- google-font-id->uuid + "Returns the UUID for a Google Font ID. Uses uuid/zero as fallback when the + font is not found in fontsdb. uuid/zero maps to the default font (Source + Sans Pro) in WASM. + A font id may not exist for different reasons: + - the gfonts.json catalog was updated and fonts were renamed or removed, + - the file was imported from another Penpot instance with different fonts, + ..." [font-id] - (let [font (fonts/get-font-data font-id)] - (:uuid font))) + (let [font (fonts/get-font-data font-id) + result (:uuid font)] + (or result uuid/zero))) (defn- custom-font-id->uuid [font-id]