diff --git a/internal/c/parts/video/font/font.cpp b/internal/c/parts/video/font/font.cpp index 79e144d21..9c8496229 100644 --- a/internal/c/parts/video/font/font.cpp +++ b/internal/c/parts/video/font/font.cpp @@ -1388,7 +1388,7 @@ void sub__UPrintString(int32_t start_x, int32_t start_y, const qbs *text, int32_ /// @brief Calculate the starting pixel positions of each chancter to an array. First one being zero. /// This also calculates the pixel position of the last + 1 character. /// @param text Text for which the data needs to be calculated. This can be unicode encoded -/// @param arr A QB64 array. This should be codepoints + 1 long. If the array is shorter additional calculated data is ignored +/// @param arr A QB64 LONG array. This should be codepoints + 1 long. If the array is shorter additional calculated data is ignored /// @param utf_encoding The UTF encoding of the text (0 = ASCII, 8 = UTF-8, 16 - UTF-16, 32 = UTF-32) /// @param qb64_fh A QB64 font handle (this can be a builtin font as well) /// @param passed Optional arguments flag @@ -1458,8 +1458,8 @@ int32_t func__UCharPos(const qbs *text, void *arr, int32_t utf_encoding, int32_t if (!arr || !codepoints) return codepoints; - auto element = (uint16_t *)((byte_element_struct *)arr)->offset; - auto elements = ((byte_element_struct *)arr)->length / sizeof(uint16_t); + auto element = (uint32_t *)((byte_element_struct *)arr)->offset; + auto elements = ((byte_element_struct *)arr)->length / sizeof(uint32_t); FontManager::Font *fnt = nullptr; FT_Pos monospaceWidth; @@ -1509,7 +1509,7 @@ int32_t func__UCharPos(const qbs *text, void *arr, int32_t utf_encoding, int32_t } penX += glyph->advanceWidth; // add advance width - previousGlyph = glyph; // save the current glyph pointer for use later + previousGlyph = glyph; // save the current glyph pointer for use later } } diff --git a/source/qb64pe.bas b/source/qb64pe.bas index 0bf090a59..bda737ef1 100644 --- a/source/qb64pe.bas +++ b/source/qb64pe.bas @@ -16785,7 +16785,7 @@ FUNCTION evaluatefunc$ (a2$, args AS LONG, typ AS LONG) END IF ' Cannot be one of these - IF (sourcetyp AND ISSTRING) OR (sourcetyp AND ISFLOAT) OR (sourcetyp AND ISOFFSET) OR (sourcetyp AND ISUDT) OR (sourcetyp AND 511) <> 16 THEN + IF (sourcetyp AND ISSTRING) OR (sourcetyp AND ISFLOAT) OR (sourcetyp AND ISOFFSET) OR (sourcetyp AND ISUDT) OR (sourcetyp AND 511) <> 32 THEN Give_Error "Expected INTEGER array-name" EXIT FUNCTION END IF diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 5a212c077..d28b752ed 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -1481,10 +1481,10 @@ id.Dependency = DEPENDENCY_LOADFONT id.subfunc = 1 id.callname = "func__UCharPos" id.args = 4 -id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(-1) + MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) +id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(-1) + MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) ' arg 2 has special handling code in evaluatefunc() id.specialformat = "?[,[?][,[?][,?]]]" id.ret = LONGTYPE - ISPOINTER -id.hr_syntax = "_UCHARPOS&(text$[, posArray%()][, utfEncoding&][, fontHandle&])" +id.hr_syntax = "_UCHARPOS&(text$[, posArray&()][, utfEncoding&][, fontHandle&])" regid 'WORKING WITH COLORS