1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +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

@@ -179,21 +179,21 @@ constexpr int32_t DECODE_MAX_CHARS=2000;
// encode
U_CAPI int32_t
u_strToPunycode(const UChar *src, int32_t srcLength,
UChar *dest, int32_t destCapacity,
u_strToPunycode(const char16_t *src, int32_t srcLength,
char16_t *dest, int32_t destCapacity,
const UBool *caseFlags,
UErrorCode *pErrorCode) {
int32_t cpBuffer[ENCODE_MAX_CODE_UNITS];
int32_t n, delta, handledCPCount, basicLength, destLength, bias, j, m, q, k, t, srcCPCount;
UChar c, c2;
char16_t c, c2;
/* argument checking */
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) {
return 0;
}
if(src==NULL || srcLength<-1 || (dest==NULL && destCapacity!=0)) {
if(src==nullptr || srcLength<-1 || (dest==nullptr && destCapacity!=0)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
@@ -221,13 +221,13 @@ u_strToPunycode(const UChar *src, int32_t srcLength,
cpBuffer[srcCPCount++]=0;
if(destLength<destCapacity) {
dest[destLength]=
caseFlags!=NULL ?
caseFlags!=nullptr ?
asciiCaseMap((char)c, caseFlags[j]) :
(char)c;
}
++destLength;
} else {
n=(caseFlags!=NULL && caseFlags[j])<<31L;
n=(caseFlags!=nullptr && caseFlags[j])<<31L;
if(U16_IS_SINGLE(c)) {
n|=c;
} else if(U16_IS_LEAD(c) && U16_IS_TRAIL(c2=src[j+1])) {
@@ -249,13 +249,13 @@ u_strToPunycode(const UChar *src, int32_t srcLength,
cpBuffer[srcCPCount++]=0;
if(destLength<destCapacity) {
dest[destLength]=
caseFlags!=NULL ?
caseFlags!=nullptr ?
asciiCaseMap((char)c, caseFlags[j]) :
(char)c;
}
++destLength;
} else {
n=(caseFlags!=NULL && caseFlags[j])<<31L;
n=(caseFlags!=nullptr && caseFlags[j])<<31L;
if(U16_IS_SINGLE(c)) {
n|=c;
} else if(U16_IS_LEAD(c) && (j+1)<srcLength && U16_IS_TRAIL(c2=src[j+1])) {
@@ -371,20 +371,20 @@ u_strToPunycode(const UChar *src, int32_t srcLength,
// decode
U_CAPI int32_t
u_strFromPunycode(const UChar *src, int32_t srcLength,
UChar *dest, int32_t destCapacity,
u_strFromPunycode(const char16_t *src, int32_t srcLength,
char16_t *dest, int32_t destCapacity,
UBool *caseFlags,
UErrorCode *pErrorCode) {
int32_t n, destLength, i, bias, basicLength, j, in, oldi, w, k, digit, t,
destCPCount, firstSupplementaryIndex, cpLength;
UChar b;
char16_t b;
/* argument checking */
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) {
return 0;
}
if(src==NULL || srcLength<-1 || (dest==NULL && destCapacity!=0)) {
if(src==nullptr || srcLength<-1 || (dest==nullptr && destCapacity!=0)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
@@ -421,9 +421,9 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
}
if(j<destCapacity) {
dest[j]=(UChar)b;
dest[j]=(char16_t)b;
if(caseFlags!=NULL) {
if(caseFlags!=nullptr) {
caseFlags[j]=IS_BASIC_UPPERCASE(b);
}
}
@@ -525,7 +525,7 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
/* Insert n at position i of the output: */
cpLength=U16_LENGTH(n);
if(dest!=NULL && ((destLength+cpLength)<=destCapacity)) {
if(dest!=nullptr && ((destLength+cpLength)<=destCapacity)) {
int32_t codeUnitIndex;
/*
@@ -550,12 +550,12 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
U16_FWD_N(dest, codeUnitIndex, destLength, i-codeUnitIndex);
}
/* use the UChar index codeUnitIndex instead of the code point index i */
/* use the char16_t index codeUnitIndex instead of the code point index i */
if(codeUnitIndex<destLength) {
uprv_memmove(dest+codeUnitIndex+cpLength,
dest+codeUnitIndex,
(destLength-codeUnitIndex)*U_SIZEOF_UCHAR);
if(caseFlags!=NULL) {
if(caseFlags!=nullptr) {
uprv_memmove(caseFlags+codeUnitIndex+cpLength,
caseFlags+codeUnitIndex,
destLength-codeUnitIndex);
@@ -563,13 +563,13 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
}
if(cpLength==1) {
/* BMP, insert one code unit */
dest[codeUnitIndex]=(UChar)n;
dest[codeUnitIndex]=(char16_t)n;
} else {
/* supplementary character, insert two code units */
dest[codeUnitIndex]=U16_LEAD(n);
dest[codeUnitIndex+1]=U16_TRAIL(n);
}
if(caseFlags!=NULL) {
if(caseFlags!=nullptr) {
/* Case of last character determines uppercase flag: */
caseFlags[codeUnitIndex]=IS_BASIC_UPPERCASE(src[in-1]);
if(cpLength==2) {