THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

🐛 Fix bug in font embedding.

pull/850/head
Andrey Antukh 3 weeks ago
committed by Andrés Moya
parent
commit
dd92e5d773
  1. 2
      frontend/src/app/main/ui/shapes/text.cljs
  2. 11
      frontend/src/app/main/ui/shapes/text/embed.cljs

2
frontend/src/app/main/ui/shapes/text.cljs

@ -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

11
frontend/src/app/main/ui/shapes/text/embed.cljs

@ -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…
Cancel
Save