mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 20: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
|
||||
[font-id]
|
||||
(let [google-font? (str/starts-with? font-id "gfont-")]
|
||||
(if google-font?
|
||||
(uuid/get-u32 (google-font-id->uuid font-id))
|
||||
(let [no-prefix (subs font-id (inc (str/index-of font-id "-")))
|
||||
as-uuid (uuid/uuid no-prefix)]
|
||||
(uuid/get-u32 as-uuid)))))
|
||||
(try
|
||||
(if (nil? font-id)
|
||||
(do
|
||||
[uuid/zero])
|
||||
(let [google-font? (str/starts-with? font-id "gfont-")]
|
||||
(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
|
||||
[font-weight]
|
||||
|
|
|
@ -46,10 +46,14 @@
|
|||
|
||||
(defn serialize-uuid
|
||||
[id]
|
||||
(if (nil? id)
|
||||
[uuid/zero]
|
||||
(let [as-uuid (uuid/uuid id)]
|
||||
(uuid/get-u32 as-uuid))))
|
||||
(try
|
||||
(if (nil? id)
|
||||
(do
|
||||
[uuid/zero])
|
||||
(let [as-uuid (uuid/uuid id)]
|
||||
(uuid/get-u32 as-uuid)))
|
||||
(catch :default _e
|
||||
[uuid/zero])))
|
||||
|
||||
(defn heapu32-set-u32
|
||||
[value heap offset]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue