From 44d68ad723c10a18cb5e137766a328153d7f7f6c Mon Sep 17 00:00:00 2001 From: Elena Torro Date: Thu, 24 Apr 2025 17:31:05 +0200 Subject: [PATCH] :bug: Calculate text-length in bytes correctly --- frontend/src/app/render_wasm/api/texts.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/render_wasm/api/texts.cljs b/frontend/src/app/render_wasm/api/texts.cljs index 7c90235546..69c790670f 100644 --- a/frontend/src/app/render_wasm/api/texts.cljs +++ b/frontend/src/app/render_wasm/api/texts.cljs @@ -72,7 +72,8 @@ font-id (f/serialize-font-id (:font-id leaf)) font-family (hash (:font-family leaf)) font-variant-id (sr/serialize-uuid (:font-variant-id leaf)) - text-length (count (:text leaf))] + text-buffer (utf8->buffer (:text leaf)) + text-length (.-byteLength text-buffer)] (.setUint8 dview offset font-style) (.setFloat32 dview (+ offset 4) font-size)