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 - TTF_FontHeight() doesn't report the correct height in bold-font and style underline
Summary: TTF_FontHeight() doesn't report the correct height in bold-font and style und...
Status: RESOLVED FIXED
Alias: None
Product: SDL_ttf
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-30 12:54 UTC by Sylvain
Modified: 2018-10-30 14:29 UTC (History)
0 users

See Also:


Attachments
patch (2.15 KB, patch)
2018-10-30 12:58 UTC, Sylvain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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