1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +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

@@ -253,7 +253,7 @@ class UnicodeStringAppendable; // unicode/appendable.h
* target object, e.g., calling str.append(str), an extra copy may take place
* to ensure safety.
* - If primitive string pointer values (e.g., const char16_t * or char *)
* for input strings are NULL, then those input string parameters are treated
* for input strings are nullptr, then those input string parameters are treated
* as if they pointed to an empty string.
* However, this is *not* the case for char * parameters for charset names
* or other IDs.
@@ -1542,7 +1542,7 @@ public:
*
* @param start offset of first character which will be copied
* @param startLength the number of characters to extract
* @param target the target buffer for extraction, can be NULL
* @param target the target buffer for extraction, can be nullptr
* if targetLength is 0
* @param targetCapacity the length of the target buffer
* @param inv Signature-distinguishing parameter, use US_INV.
@@ -1571,7 +1571,7 @@ public:
* @param startLength the number of characters to extract
* @param target the target buffer for extraction
* @param targetLength the length of the target buffer
* If `target` is NULL, then the number of bytes required for
* If `target` is nullptr, then the number of bytes required for
* `target` is returned.
* @return the output string length, not including the terminating NUL
* @stable ICU 2.0
@@ -1604,7 +1604,7 @@ public:
* If `codepage` is an empty string (`""`),
* then a simple conversion is performed on the codepage-invariant
* subset ("invariant characters") of the platform encoding. See utypes.h.
* If `target` is NULL, then the number of bytes required for
* If `target` is nullptr, then the number of bytes required for
* `target` is returned. It is assumed that the target is big enough
* to fit all of the characters.
* @return the output string length, not including the terminating NUL
@@ -1639,7 +1639,7 @@ public:
* If `codepage` is an empty string (`""`),
* then a simple conversion is performed on the codepage-invariant
* subset ("invariant characters") of the platform encoding. See utypes.h.
* If `target` is NULL, then the number of bytes required for
* If `target` is nullptr, then the number of bytes required for
* `target` is returned.
* @return the output string length, not including the terminating NUL
* @stable ICU 2.0
@@ -1657,10 +1657,10 @@ public:
* This function avoids the overhead of opening and closing a converter if
* multiple strings are extracted.
*
* @param dest destination string buffer, can be NULL if destCapacity==0
* @param dest destination string buffer, can be nullptr if destCapacity==0
* @param destCapacity the number of chars available at dest
* @param cnv the converter object to be used (ucnv_resetFromUnicode() will be called),
* or NULL for the default converter
* or nullptr for the default converter
* @param errorCode normal ICU error code
* @return the length of the output string, not counting the terminating NUL;
* if the length is greater than destCapacity, then the string will not fit
@@ -1737,7 +1737,7 @@ public:
* Unpaired surrogates are replaced with U+FFFD.
* Calls u_strToUTF32WithSub().
*
* @param utf32 destination string buffer, can be NULL if capacity==0
* @param utf32 destination string buffer, can be nullptr if capacity==0
* @param capacity the number of UChar32s available at utf32
* @param errorCode Standard ICU error code. Its input value must
* pass the U_SUCCESS() test, or else the function returns
@@ -1835,7 +1835,7 @@ public:
* A bogus string has no value. It is different from an empty string,
* although in both cases isEmpty() returns true and length() returns 0.
* setToBogus() and isBogus() can be used to indicate that no string value is available.
* For a bogus string, getBuffer() and getTerminatedBuffer() return NULL, and
* For a bogus string, getBuffer() and getTerminatedBuffer() return nullptr, and
* length() returns 0.
*
* @return true if the string is bogus/invalid, false otherwise
@@ -1906,14 +1906,14 @@ public:
* @return *this
* @stable ICU 56
*/
UnicodeString &operator=(UnicodeString &&src) U_NOEXCEPT;
UnicodeString &operator=(UnicodeString &&src) noexcept;
/**
* Swap strings.
* @param other other string
* @stable ICU 56
*/
void swap(UnicodeString &other) U_NOEXCEPT;
void swap(UnicodeString &other) noexcept;
/**
* Non-member UnicodeString swap function.
@@ -1922,7 +1922,7 @@ public:
* @stable ICU 56
*/
friend inline void U_EXPORT2
swap(UnicodeString &s1, UnicodeString &s2) U_NOEXCEPT {
swap(UnicodeString &s1, UnicodeString &s2) noexcept {
s1.swap(s2);
}
@@ -2072,7 +2072,7 @@ public:
*
* A bogus string has no value. It is different from an empty string.
* It can be used to indicate that no string value is available.
* getBuffer() and getTerminatedBuffer() return NULL, and
* getBuffer() and getTerminatedBuffer() return nullptr, and
* length() returns 0.
*
* This utility function is used throughout the UnicodeString
@@ -2978,7 +2978,7 @@ public:
* `-DUNISTR_FROM_STRING_EXPLICIT=explicit`
* on the compiler command line or similar.
* @param text The characters to place in the UnicodeString. `text`
* must be NULL (U+0000) terminated.
* must be NUL (U+0000) terminated.
* @stable ICU 2.0
*/
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char16_t *text);
@@ -3245,7 +3245,7 @@ public:
* @param src input codepage string
* @param srcLength length of the input string, can be -1 for NUL-terminated strings
* @param cnv converter object (ucnv_resetToUnicode() will be called),
* can be NULL for the default converter
* can be nullptr for the default converter
* @param errorCode normal ICU error code
* @stable ICU 2.0
*/
@@ -3306,7 +3306,7 @@ public:
* @param src source string
* @stable ICU 56
*/
UnicodeString(UnicodeString &&src) U_NOEXCEPT;
UnicodeString(UnicodeString &&src) noexcept;
/**
* 'Substring' constructor from tail of source string.
@@ -3329,7 +3329,7 @@ public:
* Clone this object, an instance of a subclass of Replaceable.
* Clones can be used concurrently in multiple threads.
* If a subclass does not implement clone(), or if an error occurs,
* then NULL is returned.
* then nullptr is returned.
* The caller must delete the clone.
*
* @return a clone of this object
@@ -3365,7 +3365,7 @@ public:
* Illegal input is replaced with U+FFFD. Otherwise, errors result in a bogus string.
* Calls u_strFromUTF32WithSub().
*
* @param utf32 UTF-32 input string. Must not be NULL.
* @param utf32 UTF-32 input string. Must not be nullptr.
* @param length Length of the input string, or -1 if NUL-terminated.
* @return A UnicodeString with equivalent UTF-16 contents.
* @see toUTF32
@@ -3489,6 +3489,19 @@ private:
*/
UBool doEquals(const UnicodeString &text, int32_t len) const;
inline UBool
doEqualsSubstring(int32_t start,
int32_t length,
const UnicodeString& srcText,
int32_t srcStart,
int32_t srcLength) const;
UBool doEqualsSubstring(int32_t start,
int32_t length,
const char16_t *srcChars,
int32_t srcStart,
int32_t srcLength) const;
inline int8_t
doCompare(int32_t start,
int32_t length,
@@ -3618,7 +3631,7 @@ private:
UnicodeString &copyFrom(const UnicodeString &src, UBool fastCopy=false);
// Copies just the fields without memory management.
void copyFieldsFrom(UnicodeString &src, UBool setSrcToBogus) U_NOEXCEPT;
void copyFieldsFrom(UnicodeString &src, UBool setSrcToBogus) noexcept;
// Pin start and limit to acceptable values.
inline void pinIndex(int32_t& start) const;
@@ -3706,7 +3719,7 @@ private:
kEmptyHashCode=1, // hash code for empty string
// bit flag values for fLengthAndFlags
kIsBogus=1, // this string is bogus, i.e., not valid or NULL
kIsBogus=1, // this string is bogus, i.e., not valid or nullptr
kUsingStackBuffer=2,// using fUnion.fStackFields instead of fUnion.fFields
kRefCounted=4, // there is a refCount field before the characters in fArray
kBufferIsReadonly=8,// do not write to this buffer
@@ -3946,6 +3959,21 @@ UnicodeString::doCompare(int32_t start,
}
}
inline UBool
UnicodeString::doEqualsSubstring(int32_t start,
int32_t thisLength,
const UnicodeString& srcText,
int32_t srcStart,
int32_t srcLength) const
{
if(srcText.isBogus()) {
return isBogus();
} else {
srcText.pinIndices(srcStart, srcLength);
return !isBogus() && doEqualsSubstring(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
}
}
inline bool
UnicodeString::operator== (const UnicodeString& text) const
{
@@ -4326,20 +4354,20 @@ UnicodeString::lastIndexOf(UChar32 c,
inline UBool
UnicodeString::startsWith(const UnicodeString& text) const
{ return compare(0, text.length(), text, 0, text.length()) == 0; }
{ return doEqualsSubstring(0, text.length(), text, 0, text.length()); }
inline UBool
UnicodeString::startsWith(const UnicodeString& srcText,
int32_t srcStart,
int32_t srcLength) const
{ return doCompare(0, srcLength, srcText, srcStart, srcLength) == 0; }
{ return doEqualsSubstring(0, srcLength, srcText, srcStart, srcLength); }
inline UBool
UnicodeString::startsWith(ConstChar16Ptr srcChars, int32_t srcLength) const {
if(srcLength < 0) {
srcLength = u_strlen(toUCharPtr(srcChars));
}
return doCompare(0, srcLength, srcChars, 0, srcLength) == 0;
return doEqualsSubstring(0, srcLength, srcChars, 0, srcLength);
}
inline UBool
@@ -4347,21 +4375,21 @@ UnicodeString::startsWith(const char16_t *srcChars, int32_t srcStart, int32_t sr
if(srcLength < 0) {
srcLength = u_strlen(toUCharPtr(srcChars));
}
return doCompare(0, srcLength, srcChars, srcStart, srcLength) == 0;
return doEqualsSubstring(0, srcLength, srcChars, srcStart, srcLength);
}
inline UBool
UnicodeString::endsWith(const UnicodeString& text) const
{ return doCompare(length() - text.length(), text.length(),
text, 0, text.length()) == 0; }
{ return doEqualsSubstring(length() - text.length(), text.length(),
text, 0, text.length()); }
inline UBool
UnicodeString::endsWith(const UnicodeString& srcText,
int32_t srcStart,
int32_t srcLength) const {
srcText.pinIndices(srcStart, srcLength);
return doCompare(length() - srcLength, srcLength,
srcText, srcStart, srcLength) == 0;
return doEqualsSubstring(length() - srcLength, srcLength,
srcText, srcStart, srcLength);
}
inline UBool
@@ -4370,8 +4398,7 @@ UnicodeString::endsWith(ConstChar16Ptr srcChars,
if(srcLength < 0) {
srcLength = u_strlen(toUCharPtr(srcChars));
}
return doCompare(length() - srcLength, srcLength,
srcChars, 0, srcLength) == 0;
return doEqualsSubstring(length() - srcLength, srcLength, srcChars, 0, srcLength);
}
inline UBool
@@ -4381,8 +4408,8 @@ UnicodeString::endsWith(const char16_t *srcChars,
if(srcLength < 0) {
srcLength = u_strlen(toUCharPtr(srcChars + srcStart));
}
return doCompare(length() - srcLength, srcLength,
srcChars, srcStart, srcLength) == 0;
return doEqualsSubstring(length() - srcLength, srcLength,
srcChars, srcStart, srcLength);
}
//========================================
@@ -4712,18 +4739,18 @@ UnicodeString::remove(int32_t start,
// remove(guaranteed everything) of a bogus string makes the string empty and non-bogus
return remove();
}
return doReplace(start, _length, NULL, 0, 0);
return doReplace(start, _length, nullptr, 0, 0);
}
inline UnicodeString&
UnicodeString::removeBetween(int32_t start,
int32_t limit)
{ return doReplace(start, limit - start, NULL, 0, 0); }
{ return doReplace(start, limit - start, nullptr, 0, 0); }
inline UnicodeString &
UnicodeString::retainBetween(int32_t start, int32_t limit) {
truncate(limit);
return doReplace(0, start, NULL, 0, 0);
return doReplace(0, start, nullptr, 0, 0);
}
inline UBool