You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Prefer family name in fonts' names table
This commit is contained in:
@@ -2110,12 +2110,12 @@ CharString String::utf8() const {
|
||||
|
||||
String String::utf16(const char16_t *p_utf16, int p_len) {
|
||||
String ret;
|
||||
ret.parse_utf16(p_utf16, p_len);
|
||||
ret.parse_utf16(p_utf16, p_len, true);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Error String::parse_utf16(const char16_t *p_utf16, int p_len) {
|
||||
Error String::parse_utf16(const char16_t *p_utf16, int p_len, bool p_default_little_endian) {
|
||||
if (!p_utf16) {
|
||||
return ERR_INVALID_DATA;
|
||||
}
|
||||
@@ -2125,8 +2125,12 @@ Error String::parse_utf16(const char16_t *p_utf16, int p_len) {
|
||||
int cstr_size = 0;
|
||||
int str_size = 0;
|
||||
|
||||
#ifdef BIG_ENDIAN_ENABLED
|
||||
bool byteswap = p_default_little_endian;
|
||||
#else
|
||||
bool byteswap = !p_default_little_endian;
|
||||
#endif
|
||||
/* HANDLE BOM (Byte Order Mark) */
|
||||
bool byteswap = false; // assume correct endianness if no BOM found
|
||||
if (p_len < 0 || p_len >= 1) {
|
||||
bool has_bom = false;
|
||||
if (uint16_t(p_utf16[0]) == 0xfeff) { // correct BOM, read as is
|
||||
|
||||
Reference in New Issue
Block a user