mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 05:16:10 +02:00
🐛 Fix font id serialization
This commit is contained in:
parent
219ddfabaf
commit
f8602810eb
2 changed files with 21 additions and 10 deletions
|
@ -145,12 +145,19 @@
|
||||||
|
|
||||||
(defn serialize-font-id
|
(defn serialize-font-id
|
||||||
[font-id]
|
[font-id]
|
||||||
(let [google-font? (str/starts-with? font-id "gfont-")]
|
(try
|
||||||
(if google-font?
|
(if (nil? font-id)
|
||||||
(uuid/get-u32 (google-font-id->uuid font-id))
|
(do
|
||||||
(let [no-prefix (subs font-id (inc (str/index-of font-id "-")))
|
[uuid/zero])
|
||||||
as-uuid (uuid/uuid no-prefix)]
|
(let [google-font? (str/starts-with? font-id "gfont-")]
|
||||||
(uuid/get-u32 as-uuid)))))
|
(if google-font?
|
||||||
|
(uuid/get-u32 (google-font-id->uuid font-id))
|
||||||
|
(let [no-prefix (subs font-id (inc (str/index-of font-id "-")))]
|
||||||
|
(if (or (nil? no-prefix) (not (string? no-prefix)) (str/blank? no-prefix))
|
||||||
|
[uuid/zero]
|
||||||
|
(uuid/get-u32 (uuid/uuid no-prefix)))))))
|
||||||
|
(catch :default _e
|
||||||
|
[uuid/zero])))
|
||||||
|
|
||||||
(defn serialize-font-weight
|
(defn serialize-font-weight
|
||||||
[font-weight]
|
[font-weight]
|
||||||
|
|
|
@ -46,10 +46,14 @@
|
||||||
|
|
||||||
(defn serialize-uuid
|
(defn serialize-uuid
|
||||||
[id]
|
[id]
|
||||||
(if (nil? id)
|
(try
|
||||||
[uuid/zero]
|
(if (nil? id)
|
||||||
(let [as-uuid (uuid/uuid id)]
|
(do
|
||||||
(uuid/get-u32 as-uuid))))
|
[uuid/zero])
|
||||||
|
(let [as-uuid (uuid/uuid id)]
|
||||||
|
(uuid/get-u32 as-uuid)))
|
||||||
|
(catch :default _e
|
||||||
|
[uuid/zero])))
|
||||||
|
|
||||||
(defn heapu32-set-u32
|
(defn heapu32-set-u32
|
||||||
[value heap offset]
|
[value heap offset]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue