mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +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
|
||||
[font-id]
|
||||
(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 "-")))
|
||||
as-uuid (uuid/uuid no-prefix)]
|
||||
(uuid/get-u32 as-uuid)))))
|
||||
(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]
|
||||
(try
|
||||
(if (nil? id)
|
||||
[uuid/zero]
|
||||
(do
|
||||
[uuid/zero])
|
||||
(let [as-uuid (uuid/uuid id)]
|
||||
(uuid/get-u32 as-uuid))))
|
||||
(uuid/get-u32 as-uuid)))
|
||||
(catch :default _e
|
||||
[uuid/zero])))
|
||||
|
||||
(defn heapu32-set-u32
|
||||
[value heap offset]
|
||||
|
||||
Reference in New Issue
Block a user