Merge branch 'develop' into 8.3.0-Dev

This commit is contained in:
Chris Speciale
2025-03-14 05:30:43 -04:00
4 changed files with 70 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
<files id="native-toolkit-mbedtls">
<compilerflag value="-std=c11" />
<compilerflag value="-std=c11" unless="isMsvc" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/mbedtls/include/" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/zlib/" />
<file name="${NATIVE_TOOLKIT_PATH}/mbedtls/library/aes.c" />

View File

@@ -1052,6 +1052,10 @@ namespace lime {
while (*characters != 0) {
character = readNextChar (characters);
if (character == -1)
break;
index = FT_Get_Char_Index ((FT_Face)face, character);
val_array_push (indices, alloc_int (index));
@@ -1064,22 +1068,30 @@ namespace lime {
unsigned long character;
int index;
int count = 0;
// TODO: Determine array size first
const char* characters_start = characters;
while (*characters != 0) {
character = readNextChar (characters);
if (character == -1)
break;
count++;
}
hl_varray* indices = (hl_varray*)hl_alloc_array (&hlt_i32, count);
int* indicesData = hl_aptr (indices, int);
characters = characters_start;
while (*characters != 0) {
character = readNextChar (characters);
if (character == -1)
break;
*indicesData++ = FT_Get_Char_Index ((FT_Face)face, character);
}

View File

@@ -280,14 +280,20 @@ namespace lime {
void lime_hb_buffer_add_utf8 (value buffer, HxString text, int itemOffset, int itemLength) {
hb_buffer_add_utf8 ((hb_buffer_t*)val_data (buffer), text.c_str (), text.length, itemOffset, itemLength);
int textLength = text.length;
if (hxs_encoding (text) == hx::StringUtf16) {
// hxs_utf8 doesn't give us the length, so treat it as null terminated
textLength = -1;
}
hb_buffer_add_utf8 ((hb_buffer_t*)val_data (buffer), hxs_utf8 (text, nullptr), textLength, itemOffset, itemLength);
}
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);
}