text-freetype2: Fix font index retrieval and increase texture buffer size; add support for Cyrillic characters in glyph caching#13290
Open
reyohoho wants to merge 3 commits intoobsproject:masterfrom
Conversation
Member
|
If these are distinct bug fixes, please split the commits. |
FcPatternGetInteger was called with value list index 1 instead of 0, requesting a non-existent second value. For TTC/OTC font collections where the matched face has a non-zero index, this caused the wrong face to be loaded — potentially one with incomplete character coverage, resulting in missing glyphs.
Increase the glyph texture atlas from 2048x2048 to 4096x4096. At larger font sizes the atlas overflows after caching standard Latin glyphs, causing cache_glyphs to break early with "Out of space". Uncached glyphs are then silently skipped in fill_vertex_buffer, producing missing characters.
Add Cyrillic uppercase and lowercase characters to cache_standard_glyphs alongside the existing ASCII Latin set, so they are available on first render without relying on on-demand caching.
7e9f2ca to
4d92dcf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix multiple issues in
text-freetype2that cause glyphs to be silently dropped on Linux:FC_INDEXretrieval in Fontconfig (find-font-unix.c):FcPatternGetIntegerwas called with value index1instead of0, requesting a non-existent second value. For TTC/OTC font collections, this caused the wrong face (with incomplete glyph coverage) to be loaded.text-freetype2.c): At larger font sizes (e.g. v2 default 256px), the atlas overflows after caching Latin glyphs.cache_glyphshitsbreakon "Out of space", andfill_vertex_bufferskips uncached glyphs — producing missing characters.cache_standard_glyphs(text-functionality.c): Only ASCII was pre-cached. Cyrillic letters are now included alongside Latin.Motivation and Context
Fixes #11819
On Linux,
text-freetype2renders strings with missing characters — especially Cyrillic. Windows is unaffected because it usestext-gdiplus, which has no fixed-size atlas.How Has This Been Tested?
text-freetype2.soon Arch Linux (GCC 15.2.1) against OBS 32.1.1 (Flatpak).SetInputSettings) renders completely."Out of space trying to render glyphs"warnings at font sizes up to 256px with mixed Latin/Cyrillic.Types of changes
Checklist: