Change: Support side-by-side fallback FontCaches instead of hierarchical. (#13303)

The text layouter system can now support using different fonts for different glyphs, including mixing scalable and sprite glyphs.
This commit is contained in:
Peter Nelson
2025-12-06 10:47:12 +00:00
committed by dP
parent a616855649
commit 5be16a658a
32 changed files with 784 additions and 481 deletions

View File

@@ -26,5 +26,24 @@ public:
static size_t AppendToBuffer(char32_t *buff, const char32_t *buffer_last, char32_t c);
};
/**
* Swap paired brackets for fallback RTL layouting.
* @param c Character to swap.
* @return Swapped character, or original character if it is not a paired bracket.
*/
inline char32_t SwapRtlPairedCharacters(char32_t c)
{
/* There are many more paired brackets, but for fallback purposes we only handle ASCII brackets. */
/* https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt */
switch (c) {
case U'(': return U')';
case U')': return U'(';
case U'[': return U']';
case U']': return U'[';
case U'{': return U'}';
case U'}': return U'{';
default: return c;
}
}
#endif /* GFX_LAYOUT_FALLBACK_H */