mirror of
https://github.com/penpot/penpot.git
synced 2025-03-20 03:31:24 -05:00
🐛 Fix bug in font embedding.
This commit is contained in:
parent
2b35dce037
commit
dd92e5d773
2 changed files with 6 additions and 7 deletions
frontend/src/app/main/ui/shapes
|
@ -38,7 +38,7 @@
|
|||
{:style style
|
||||
:xmlns "http://www.w3.org/1999/xhtml"}
|
||||
(when embed?
|
||||
[ste/embed-fontfaces-style {:node node}])
|
||||
[:& ste/embed-fontfaces-style {:node node}])
|
||||
children]))
|
||||
|
||||
(mf/defc render-paragraph-set
|
||||
|
|
|
@ -89,17 +89,16 @@
|
|||
(with-cache {:key uris :max-age (dt/duration {:hours 4})}
|
||||
(->> (rx/from (seq uris))
|
||||
(rx/mapcat (fn [uri]
|
||||
(http/send! {:method :get
|
||||
:uri uri
|
||||
:response-type :blob})))
|
||||
(rx/map :body)))))
|
||||
(->> (http/send! {:method :get :uri uri :response-type :blob})
|
||||
(rx/map :body)
|
||||
(rx/mapcat wapi/read-file-as-data-url)
|
||||
(rx/map #(vector uri %)))))
|
||||
(rx/reduce conj [])))))
|
||||
|
||||
(defn get-font-data
|
||||
"Parses the CSS and retrieves the font data as DataURI."
|
||||
[^string css]
|
||||
(->> (fetch-font-data css)
|
||||
(rx/mapcat wapi/read-file-as-data-url)
|
||||
(rx/reduce conj [])
|
||||
(http/as-promise)))
|
||||
|
||||
(defn embed-font
|
||||
|
|
Loading…
Add table
Reference in a new issue