Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rtext] Fix stb_truetype composite glyph scaling logic #4811

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

AshishBhattarai
Copy link
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
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
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
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