1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Update HarfBuzz, ICU and FreeType

HarfBuzz: Update to version 7.3.0
ICU4C: Update to version 73.1
FreeType: Update to version 2.13.0
This commit is contained in:
bruvzg
2023-05-23 03:05:01 +03:00
parent d5c1b9f883
commit b64df2bf74
810 changed files with 32198 additions and 11081 deletions

View File

@@ -25,11 +25,11 @@ namespace {
*/
const int32_t ARG_NUM_LIMIT = 0x100;
/**
* Initial and maximum char/UChar value set for a text segment.
* Initial and maximum char/char16_t value set for a text segment.
* Segment length char values are from ARG_NUM_LIMIT+1 to this value here.
* Normally 0xffff, but can be as small as ARG_NUM_LIMIT+1 for testing.
*/
const UChar SEGMENT_LENGTH_PLACEHOLDER_CHAR = 0xffff;
const char16_t SEGMENT_LENGTH_PLACEHOLDER_CHAR = 0xffff;
/**
* Maximum length of a text segment. Longer segments are split into shorter ones.
*/
@@ -45,7 +45,7 @@ enum {
};
inline UBool isInvalidArray(const void *array, int32_t length) {
return (length < 0 || (array == NULL && length != 0));
return (length < 0 || (array == nullptr && length != 0));
}
} // namespace
@@ -70,15 +70,15 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
// Parse consistent with MessagePattern, but
// - support only simple numbered arguments
// - build a simple binary structure into the result string
const UChar *patternBuffer = pattern.getBuffer();
const char16_t *patternBuffer = pattern.getBuffer();
int32_t patternLength = pattern.length();
// Reserve the first char for the number of arguments.
compiledPattern.setTo((UChar)0);
compiledPattern.setTo((char16_t)0);
int32_t textLength = 0;
int32_t maxArg = -1;
UBool inQuote = false;
for (int32_t i = 0; i < patternLength;) {
UChar c = patternBuffer[i++];
char16_t c = patternBuffer[i++];
if (c == APOS) {
if (i < patternLength && (c = patternBuffer[i]) == APOS) {
// double apostrophe, skip the second one
@@ -98,7 +98,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
} else if (!inQuote && c == OPEN_BRACE) {
if (textLength > 0) {
compiledPattern.setCharAt(compiledPattern.length() - textLength - 1,
(UChar)(ARG_NUM_LIMIT + textLength));
(char16_t)(ARG_NUM_LIMIT + textLength));
textLength = 0;
}
int32_t argNumber;
@@ -129,7 +129,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
if (argNumber > maxArg) {
maxArg = argNumber;
}
compiledPattern.append((UChar)argNumber);
compiledPattern.append((char16_t)argNumber);
continue;
} // else: c is part of literal text
// Append c and track the literal-text segment length.
@@ -144,14 +144,14 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
}
if (textLength > 0) {
compiledPattern.setCharAt(compiledPattern.length() - textLength - 1,
(UChar)(ARG_NUM_LIMIT + textLength));
(char16_t)(ARG_NUM_LIMIT + textLength));
}
int32_t argCount = maxArg + 1;
if (argCount < min || max < argCount) {
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
return false;
}
compiledPattern.setCharAt(0, (UChar)argCount);
compiledPattern.setCharAt(0, (char16_t)argCount);
return true;
}
@@ -159,7 +159,7 @@ UnicodeString& SimpleFormatter::format(
const UnicodeString &value0,
UnicodeString &appendTo, UErrorCode &errorCode) const {
const UnicodeString *values[] = { &value0 };
return formatAndAppend(values, 1, appendTo, NULL, 0, errorCode);
return formatAndAppend(values, 1, appendTo, nullptr, 0, errorCode);
}
UnicodeString& SimpleFormatter::format(
@@ -167,7 +167,7 @@ UnicodeString& SimpleFormatter::format(
const UnicodeString &value1,
UnicodeString &appendTo, UErrorCode &errorCode) const {
const UnicodeString *values[] = { &value0, &value1 };
return formatAndAppend(values, 2, appendTo, NULL, 0, errorCode);
return formatAndAppend(values, 2, appendTo, nullptr, 0, errorCode);
}
UnicodeString& SimpleFormatter::format(
@@ -176,7 +176,7 @@ UnicodeString& SimpleFormatter::format(
const UnicodeString &value2,
UnicodeString &appendTo, UErrorCode &errorCode) const {
const UnicodeString *values[] = { &value0, &value1, &value2 };
return formatAndAppend(values, 3, appendTo, NULL, 0, errorCode);
return formatAndAppend(values, 3, appendTo, nullptr, 0, errorCode);
}
UnicodeString& SimpleFormatter::formatAndAppend(
@@ -192,7 +192,7 @@ UnicodeString& SimpleFormatter::formatAndAppend(
return appendTo;
}
return format(compiledPattern.getBuffer(), compiledPattern.length(), values,
appendTo, NULL, true,
appendTo, nullptr, true,
offsets, offsetsLength, errorCode);
}
@@ -207,7 +207,7 @@ UnicodeString &SimpleFormatter::formatAndReplace(
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
return result;
}
const UChar *cp = compiledPattern.getBuffer();
const char16_t *cp = compiledPattern.getBuffer();
int32_t cpLength = compiledPattern.length();
if (valuesLength < getArgumentLimit(cp, cpLength)) {
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
@@ -246,7 +246,7 @@ UnicodeString &SimpleFormatter::formatAndReplace(
}
UnicodeString SimpleFormatter::getTextWithNoArguments(
const UChar *compiledPattern,
const char16_t *compiledPattern,
int32_t compiledPatternLength,
int32_t* offsets,
int32_t offsetsLength) {
@@ -272,7 +272,7 @@ UnicodeString SimpleFormatter::getTextWithNoArguments(
}
UnicodeString &SimpleFormatter::format(
const UChar *compiledPattern, int32_t compiledPatternLength,
const char16_t *compiledPattern, int32_t compiledPatternLength,
const UnicodeString *const *values,
UnicodeString &result, const UnicodeString *resultCopy, UBool forbidResultAsValue,
int32_t *offsets, int32_t offsetsLength,
@@ -287,7 +287,7 @@ UnicodeString &SimpleFormatter::format(
int32_t n = compiledPattern[i++];
if (n < ARG_NUM_LIMIT) {
const UnicodeString *value = values[n];
if (value == NULL) {
if (value == nullptr) {
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
return result;
}