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

Text being layed out wrong if sustituting sprite-based glyphs #5737

Closed
DorpsGek opened this issue Sep 6, 2013 · 1 comment
Closed

Text being layed out wrong if sustituting sprite-based glyphs #5737

DorpsGek opened this issue Sep 6, 2013 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Sep 6, 2013

adf88 opened the ticket and wrote:

How to reproduce: start new game with OpenGFX+BigGUI and open some window with a close box (see attached PNG). You can see that the "X" mark is trimmed.

OpenTTD has some special, sprite-based characters (black cross, train icon etc.). Bad things happen if we substitute them. OpenTTD caches text layout (string widths, heights, etc.). But the cache is not being cleared while loading new set of sprites. This cause GetStringBoundingBox return wrong (cached) value if some character of the string is a sprite-based glyph and it's sprite got larger or smaller.

Note that the "X" being trimmed horizontally (look at signal window for example) is separate problem. In OpenGFX+BigGUI, the "X" sprite is oversized in height. OpenTTD takes height ("leading" value) of the font when text is being lay out horizontally. This is expected. Basically this is BigGUI's problem that it defined oversized sprite. Perhaps WWT_CLOSEBOX should use an image, not a text...

Fix attached.

Attachments

Reported version: Version?
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5737
@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r25860. Thanks for the patch!


This comment was imported from FlySpray: https://bugs.openttd.org/task/5737

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant