News:

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

Implementation of TrueType Font

Started by Green, October 22, 2021, 11:38:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Green

Simutrans has been using bitmap fonts as default for a long time, while OpenTTD has already adopted TrueType Fonts. I think that adoption of TrueType has many merits.

Under the circumstances readability of windows is not so good and font size is relatively very small, which cause difficulties. For example, help files and descriptions of many buildings are illegible.

Nowadays TrueTypes are widely used. So that it should be considered in the future.

Andarix

history.txt

Quote...
Release of 120.3 (r8503 on 15-June-2018):
...
   ADD: Support Truetype fonts on windows up to 19 pts. For MAC and Linux support there is a way needed to find the font path.
...

Green

Thank you, I found the above at history.txt inside archived zip file.

QuoteMost changes have been done internally, like scalable trutype font support (for those large displays) and easy server hosting even behing a (UPnP) NAT router.
https://sourceforge.net/p/simutrans/news/2018/06/release-of-simutrans-1203-r8500/

But I can not find a way how to use trutype font like "VLgothic". Simplly adding it to /usr/share/games/simutrans/font/ directory did not work. Therefore I specified the font path in the simuconftab as follows, but it also does not work. I am wondering what is wrong with it.

Quote
# You can use a system font. BUT you must specify the whole path to it!
# This can be only set in the user defined simuconf.tab
#fontname=C:\Windows\fonts\arial.ttf
fontname=/usr/share/games/simutrans/font/VL-Gothic-Regular.ttf

prissi

If the Simutrans is from Debian (and not from us) the font patch is the one of the simutrans directory. And there was also an error in that prevented of applying the name from simuconf.tab. The latter is fixed in r10190. I would recommend to use the personal simuconf.tab for this.

Green

Yes, just as you imagined, I am running simutrans on Debian Linux. Its version is an old stable 10 (buster). If this bug is fixed now, it is nice. I might report here when my main computer immigrated to Debian 11 (bullseyes), which adopts the version 121.0-1 for simutrans.

Thank you.

Roboron

Note you can also just use larger BDF fonts meanwhile. I personally like Terminus http://terminus-font.sourceforge.net/

prissi

Simutrans usually recognized the system font and saves them for the next restart. So you only have to set the font once.

Simutrans is not distributed with a TTF font, mostly due to not having a suitable full unicode TTF font, because the fonts either do not cover full chines etc or enforcing an incompatible license, or being 10 MB or larger and thus larger than the binary with the paks (or all of the three). Since there is a font for display on the machine, using it makes more sense. Unfortunately, finding that font is not easy across architectures.

Green

Thank you, prissi for your fix that has amended font problems.
I tested another computer with Fedora Linux 34 with simutrans v.122 from Simutrans-Germany universal.repo, which automatically detect default fonts of the system and selection of font size is availabel now.
I think it is working nicely.