We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4341

Summary: TTF_FontHeight() doesn't report the correct height in bold-font and style underline
Product: SDL_ttf Reporter: Sylvain <sylvain.becker>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86_64   
OS: Linux   
Attachments: patch

Description Sylvain 2018-10-30 12:54:15 UTC
This is somehow part of this commit https://hg.libsdl.org/SDL_ttf/rev/55157da58804

Vera font comes from http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/
ttf-bitstream-vera-1.10/VeraBd.ttf

It's a bold font (probably the issue stands with many other bold fonts). 
When you try to render it with underline style, the underline is thicker and then goes after the height. So we increase the height.

This new height is not reported by TTF_FontHeight(), because it's done at render time.
It seems better to do it at init time and when style changes.
Comment 1 Sylvain 2018-10-30 12:58:31 UTC
Created attachment 3415 [details]
patch

here's a patch.
Comment 2 Sam Lantinga 2018-10-30 14:29:56 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL_ttf/rev/ebf602881c55