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

Several character overlaps in music box #8907

Open
Wuzzy2 opened this issue Mar 28, 2021 · 5 comments
Open

Several character overlaps in music box #8907

Wuzzy2 opened this issue Mar 28, 2021 · 5 comments
Labels
bug Something isn't working component: interface This is an interface issue

Comments

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Mar 28, 2021

Version of OpenTTD

1.9.3

Expected result

All texts in the music box fit neatly into the buttons and never overlap with other letters.

Actual result

image

I have marked in red several cases in which letters touch each other. Also, the “y” in the green song name in the left window is bleeding out of the black section.

Steps to reproduce

  1. Open the music box

Related issue

#8905

@nielsmh
Copy link
Contributor

nielsmh commented Mar 28, 2021

I'd very much say this is by design, the small font is designed to be small, so the line height is equal to the character height.

Also please use the file upload features Github has instead of hosting images on external sites.

@TrueBrain
Copy link
Member

Might be by design, but it looks like crap :P (excuse my language). What you didn't even mark is the ä under Musikbox, that is on the border :P

Guess the font makes good use of the full height :P

Using a custom font would solve most of this, I would guess. Fixing this font is properly very difficult, and adding more spacing between the lines most likely makes things look bad too. But I kinda agree we should do something with this, as this is just a bit silly :)

@TrueBrain TrueBrain added the bug Something isn't working label Apr 10, 2021
@2TallTyler
Copy link
Member

This is partially resolved now that we use a custom font by default (#11593):

jukebox

That said, it is still an issue if the player chooses to use the sprite font in the Options menu, with OpenGFX or OpenGFX2 as the base graphics set (TTD graphics use all upper-case smallfont which have no descenders).

OpenGFX2 sprite font:

sprite

@zephyris Any thoughts on if there's a way to resolve this in the font, or if the window just needs a bit more padding?

@2TallTyler 2TallTyler added the component: interface This is an interface issue label Mar 9, 2024
@PeterN
Copy link
Member

PeterN commented Mar 9, 2024

One solution is to (heresy!) change the interface: add scrollbars and switch to the normal size font instead.

@zephyris
Copy link
Contributor

There's a fundamental problem with the small font - it has a line height of 6px, an ascent of 5px and a descent of 0px. You can force that to work in the Latin alphabet without any accents by going all caps. But, for wider language support, many characters break it. Adding accents needs 1 to 2 px space - the capitals already get shortened by 1px to make some space, but the 1px line spacing still gets used up. Adding descenders, necessary for letters like C cedilla or various Cyrillic letters, has no space available, so gets pushed into the 1px line spacing below. Similarly adding lower case letters with descenders, like g and y, have to crash into the line below. etc. etc.

This makes the small font design a trade-off between fitting in the current 5px space and supporting more languages.

The reason OpenTTD Small kinda works, and I believe only under Windows, is because the TTF is essentially a 7px tall font coded as a 6px tall font. I believe on Windows the reported 6px line height gets ignored because of the dimensions of the characters.

There's a few solutions. The font could be changed to all-caps, which would solve the problem with descenders in the Latin alphabet, but there would still be problems with accents and other alphabets. Adding 1px extra to line spacing would work. Sort of equivalently, changing the default small font height to 7px and changing OpenTTD Small to be a true 7px tall font would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: interface This is an interface issue
Projects
None yet
Development

No branches or pull requests

6 participants