Skip to content

[rtext] Fix stb_truetype composite glyph scaling logic#4811

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
AshishBhattarai:master
Mar 4, 2025
Merged

[rtext] Fix stb_truetype composite glyph scaling logic#4811
raysan5 merged 1 commit into
raysan5:masterfrom
AshishBhattarai:master

Conversation

@AshishBhattarai
Copy link
Copy Markdown
Contributor

@AshishBhattarai AshishBhattarai commented Mar 4, 2025

The logic for handling composite glyph scaling doesn't match the truetype specs, hence the results are different when a glyph in a ttf file defines composite glyh scales. I couldn't really find a ttf font with a glyph that has this exact issue, but the specs allows both uniform and non-uniform scaling for composite glyphs.

Part of the spec i am referring to
image

Synthetic tests (intentionally add scale to glyph component, spec allows it)
Left is FontForger, Right is raylib
image

With this fix applied
image

@raysan5 raysan5 added the external This issue depends on external lib label Mar 4, 2025
@raysan5 raysan5 changed the title Fix stb_truetype composite glyph scaling logic [rtext] Fix stb_truetype composite glyph scaling logic Mar 4, 2025
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Mar 4, 2025

@AshishBhattarai I'm afraid this change belongs to stb_truetype library, it should be patched in original repo instead of raylib side.

@AshishBhattarai
Copy link
Copy Markdown
Contributor Author

@AshishBhattarai I'm afraid this change belongs to stb_truetype library, it should be patched in original repo instead of raylib side.

just opened a pr on stb
nothings/stb#1756

@raysan5 raysan5 merged commit f1385f3 into raysan5:master Mar 4, 2025
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Mar 4, 2025

@AshishBhattarai thanks, just merging this change but note it can be overwritten on library update...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external This issue depends on external lib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants