mirror of
https://github.com/penpot/penpot.git
synced 2026-03-01 07:43:45 +00:00
🐛 Fix problem when exporting single text
This commit is contained in:
@@ -402,7 +402,7 @@
|
||||
:style {:-webkit-print-color-adjust :exact}
|
||||
:fill "none"}
|
||||
|
||||
(let [fonts (ff/frame->fonts object objects)]
|
||||
(let [fonts (ff/shape->fonts object objects)]
|
||||
[:& ff/fontfaces-style {:fonts fonts}])
|
||||
|
||||
(case (:type object)
|
||||
|
||||
@@ -73,12 +73,15 @@
|
||||
(when (d/not-empty? style)
|
||||
[:style style])))
|
||||
|
||||
(defn frame->fonts
|
||||
[frame objects]
|
||||
(->> (cph/get-children objects (:id frame))
|
||||
(filter cph/text-shape?)
|
||||
(map (comp fonts/get-content-fonts :content))
|
||||
(reduce set/union #{})))
|
||||
(defn shape->fonts
|
||||
[shape objects]
|
||||
(let [initial (cond-> #{}
|
||||
(cph/text-shape? shape)
|
||||
(into (fonts/get-content-fonts (:content shape))))]
|
||||
(->> (cph/get-children objects (:id shape))
|
||||
(filter cph/text-shape?)
|
||||
(map (comp fonts/get-content-fonts :content))
|
||||
(reduce set/union initial))))
|
||||
|
||||
(defn shapes->fonts
|
||||
[shapes]
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
thumbnail? (unchecked-get props "thumbnail?")
|
||||
objects (unchecked-get props "objects")
|
||||
|
||||
fonts (mf/use-memo (mf/deps shape objects) #(ff/frame->fonts shape objects))
|
||||
fonts (mf/use-memo (mf/deps shape objects) #(ff/shape->fonts shape objects))
|
||||
fonts (-> fonts (hooks/use-equal-memo))
|
||||
|
||||
force-render (mf/use-state false)
|
||||
|
||||
Reference in New Issue
Block a user