mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Fix font id serialization
Some checks failed
Commit Message Check / Check Commit Message (push) Has been cancelled
Some checks failed
Commit Message Check / Check Commit Message (push) Has been cancelled
This commit is contained in:
committed by
Belén Albeza
parent
219ddfabaf
commit
f8602810eb
@@ -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]
|
||||||
|
|||||||
Reference in New Issue
Block a user