News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[Kubuntu r10420] Very confusing UX for choosing font and font size

Started by pineapple, July 01, 2022, 10:59:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pineapple

I have more or less solved my own problem, but I am a technically competent user and it required something like thirty minutes of troubleshooting. I would expect this to be a very significant barrier to entry for some players.

This issue is occurring with the zip download of Simutrans 123.0.1 (r10420 on 29-Jan-2022) on Kubuntu. I am new to Simutrans and I do not know whether this issue occurs on other platforms or versions.

No matter what default font I select, or what font size, the game's text is too small to be easily readable on my screen and given my lousy vision. None of the included BDF or FNT fonts are responsive to the font size setting. All of the included fonts are very small, and I did not find files for larger bitmap fonts available publicly on the internet.

I am aware of the Screen Scale option, but this is not especially helpful for improving readability because it makes the text blurry.

I tried placing TTF and OTF files in the game's font/ directory.

It was unclear and unpredictable for me whether a given font would appear in the settings list and be configurable. NimbusSans-Bold.otf, NotoSansCJK-Regular.ttc, Ubuntu-B.ttf, and UbuntuMono-B.ttf were the fonts I tried that were recognized by Simutrans. Lato-Medium.ttf, Ubuntu-M.ttf, URWGothic-Demi.otf, and URWGothic-DemiOblique.otf were the fonts I tried that were not recognized.

Because Simutrans does not render text with anti-aliasing or fractional pixel positions (as is normal for TTF and OTF glyph rendering), some TTF and OTF fonts are very difficult to read and all of them are unusual in appearance.



Here are screenshots to illustrate.

None of the built-in fonts change size despite adjusting the size setting:





Changing the screen scale option to 125% or 150% (appropriate size for my display) results in linearly-interpolated blurriness, in my case at least this is a recipe for eyestrain:



Some OTF or TTF fonts look terrible:





A result I finally reached, good enough that I think I'll be able to play the game, but still not ideal due to the rudimentary font rendering (and it would be nice if I could still increase the size by another point or two):




prissi

We put a lot of effort to find the system fonts even on Linux. Thus the package maintainer of Kbuntu should fix the path. The supplied bdf fonts are pixel fonts are rather for emergencies, and thus cannot scale at all by design.

However, in which directory(s) are the system fonts in Kbuntu? We could also add this path to the font search. FreeType can render fonts, but cannot find their system paths. If certain fonts are not rendered, then this is again a FreeType library problem, and we can, unfortunately, do nothing about it.

The Simutrans graphics engine uses 16 bit per pixel (and then even struggles with the 4k displays), and while in principle subpixel rendering is possible, it has to be programmed and will be quite slow.

The scaling is up to SDL2. Generally windows produces nicer scaling than on the virtual Linux, and Android scales again nicely. Generally, the smaller your screen, and the larger the distance, the less problems ... Still scaling on desktops is a last resort for 17" 4k dislay (or my 11" 2k lapto screen).

Especially on smartphones, which are computabilty wise slow processors, but with gigantic pixel counts to wrangle, a program like Simutrans that draws all pixels for each update, must use scaling or ends up with frame rate of 2-3 per second. Interestingly, most graphic intensive programs does this. The full pixels are mostly used for static displays like website ... Actually, a 1280x768 display for a smartphone would be a very sensible choice for any not superhighend processor.

Roboron

0. Welcome to the Simutrans International Forum! Thank you for your feedback.

1. Where is Ubuntu saving fonts? You should not have to copy fonts to the font directory, but the search path for Ubuntu may not have been added. Currently, we are looking here:
"~/.fonts/",
"~/.local/share/fonts/",
"/usr/share/fonts/",
"/usr/X11R6/lib/X11/fonts/",
"/usr/local/share/fonts/",

2. I agree that the font size button not changing the font size is confusing. I have done two things to make it more clear for the final user: Make it explicit in the label text that only .ttf and .otf files can change the font size, and actually disabling the button when a bitmap font is selected.

In r10675. Hopefully this ends any confusion  :)
sim.pngsim2.png 

3. I use myself the Terminus BDF font. It's a clean font that come in various sizes (14,16,18... more than 20 however does not look good on Simutrans). I use the bold version because the normal one is too thin. It is under the Open Font License and you can get it here:

=> http://terminus-font.sourceforge.net/

4. I'm afraid I can't do anything more about the rest of issues.

Matthew

Welcome, pineapple!

Quote from: prissi on July 01, 2022, 03:14:46 PMHowever, in which directory(s) are the system fonts in Kbuntu?
Quote from: Roboron on July 01, 2022, 03:51:27 PMWhere is Ubuntu saving fonts?

In Kubuntu 22.04, they are in /usr/share/fonts/opentype/ and /usr/share/fonts/truetype/ .

I am guessing, but could the issue be that they are organized in subdirectories? For example, the Ubuntu Regular font is/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf .

Quote from: prissi on July 01, 2022, 03:14:46 PMThe supplied bdf fonts are pixel fonts are rather for emergencies, and thus cannot scale at all by design.

Could you perhaps add a tooltip on the "font size" setting to warn players about this? It can be frustrating to change a setting and then nothing happens.

Roboron fixed this while I was typing. Thank you, Roboron!

Quote from: Roboron on July 01, 2022, 03:51:27 PMI use myself the Terminus BDF font. ... It is under the Open Font License

So it could be distributed with Simutrans, right? Would that be a good thing to do?
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

prissi

It is very likely the issue of founts in subdirectories. It is a super annoying that freeType can load and displaz fonts, but has no mechanism to actually find them.

pineapple

Quote from: Matthew on July 01, 2022, 03:57:59 PMIn Kubuntu 22.04, they are in /usr/share/fonts/opentype/ and /usr/share/fonts/truetype/ .

I am guessing, but could the issue be that they are organized in subdirectories? For example, the Ubuntu Regular font is/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf .

I can confirm that this is the case on my system.

Quote from: Roboron on July 01, 2022, 03:51:27 PMI have done two things to make it more clear for the final user: Make it explicit in the label text that only .ttf and .otf files can change the font size, and actually disabling the button when a bitmap font is selected.

I think that this is a positive change!

Quote from: prissi on July 01, 2022, 03:14:46 PMThe Simutrans graphics engine uses 16 bit per pixel (and then even struggles with the 4k displays), and while in principle subpixel rendering is possible, it has to be programmed and will be quite slow.

I hope that it can be considered as an option? Although I would suggest making subpixel rendering a separate option from anti-aliasing and better hinting, including fractional pixel offsets (not the same thing as subpixels), for glyphs. Seeing as the benefits of subpixel rendering are very display-dependent, while the latter improvements should benefit the appearance of text on all displays.

I believe the FreeType API includes support for this sort of thing. (Although perhaps it is complicated by rendering to 16-bit color targets?) For example:

https://freetype.org/freetype2/docs/reference/ft2-lcd_rendering.html

https://freetype.org/freetype2/docs/hinting/text-rendering-general.html

https://www.gamedev.net/forums/topic/446204-freetype2--disable-anti-aliasing-effect/

prissi

Due to the underlying engine, the graphs are rendered into boxes (currently 2 bit) and then copied to the buffer using own routines since the buffer uses 16 rgb, not the common 24 bit or large screen updates would be even slower. So clearly no subpixel rendering ever, but maybe some aliasing.

Roboron

Quote from: Matthew on July 01, 2022, 03:57:59 PMSo it could be distributed with Simutrans, right? Would that be a good thing to do?

If you and others like it, of course. There's no support for Asian glyphs, however, so it is not suited for everyone.

Quote from: prissi on July 02, 2022, 07:16:34 AMIt is a super annoying that freeType can load and displaz fonts, but has no mechanism to actually find them.

I believe fontconfig fills that role https://www.freedesktop.org/wiki/Software/fontconfig/

Roboron

Quote from: Matthew on July 01, 2022, 03:57:59 PMIn Kubuntu 22.04, they are in /usr/share/fonts/opentype/ and /usr/share/fonts/truetype/ .

I modified the search in r10677 so that it search for subdirectories recursively. Up to 5 levels in this case, hopefully that's enough for Ubuntu and others.

recursive_search.png


prissi

Seems I can close this one (irnoring the problem of one font per directory ...)