From 0ca7c392e093783cc1f7e9abe25dadf9a92cb394 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 10 Mar 2025 01:45:37 +0000 Subject: [PATCH] Fix length for hl_hb_buffer_add_utf8 This function wants the utf8 length, but text->length does not give this. We can instead use -1 to tell harfbuzz to treat it as null- terminating, which is the case with all hashlink strings anyway. --- project/src/text/harfbuzz/HarfbuzzBindings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/text/harfbuzz/HarfbuzzBindings.cpp b/project/src/text/harfbuzz/HarfbuzzBindings.cpp index 0fa206124..cd5b5b892 100644 --- a/project/src/text/harfbuzz/HarfbuzzBindings.cpp +++ b/project/src/text/harfbuzz/HarfbuzzBindings.cpp @@ -271,7 +271,7 @@ namespace lime { HL_PRIM void HL_NAME(hl_hb_buffer_add_utf8) (HL_CFFIPointer* buffer, hl_vstring* text, int itemOffset, int itemLength) { - hb_buffer_add_utf8 ((hb_buffer_t*)buffer->ptr, text ? hl_to_utf8 (text->bytes) : NULL, text ? text->length : 0, itemOffset, itemLength); + hb_buffer_add_utf8 ((hb_buffer_t*)buffer->ptr, text ? hl_to_utf8 (text->bytes) : NULL, -1, itemOffset, itemLength); }