Fonts

Fonts

Postby grrk-bzzt » 09 Jun 2014, 17:19

Hello,

After several discussions I had with samuncle, we repeatedly expressed how bad the STK font was and how it could be improved.
It seems that there's two major constraints that makes it incredibly difficult to just pick a new font.
1/ Apparently it is difficult to chnage the font in game because it has to be converted to bitmap first (I'm not sure if there's an automatic tool for that).
2/ Apparently the project leaders want a font that support all possible glyphs at all cost

In my humble opinion, I think reason 2 holds everything back and is a near-impossible constraint to get around since there's very few (none?) fonts that can do that.
Still, this is just my personnal opinion and I'm not here to discuss that.

I've been playing several kart video games to see what could fit the STK UI and Mario Kart Wii caught my attention for its use of a simple Sans font.
Image

It's nothing more than a Sans font with a black border.
So I try to render some words with the GNU FreeSans font in the same style.

I choosed FreeSans because, it is free and open-source, it aims at supporting the maximum glyphs possible and it looks very similar to the font used in this screenshot.
Image
Image
Image
Image
User avatar
grrk-bzzt
 
Posts: 23
Joined: 05 Feb 2014, 19:52

Re: Fonts

Postby hiker » 10 Jun 2014, 02:39

grrk-bzzt {l Wrote}:After several discussions I had with samuncle, we repeatedly expressed how bad the STK font was and how it could be improved.
It seems that there's two major constraints that makes it incredibly difficult to just pick a new font.
1/ Apparently it is difficult to chnage the font in game because it has to be converted to bitmap first (I'm not sure if there's an automatic tool for that).

With the stk sources we also include the fonttool, which is used to convert a system font into bitmaps (and to create an xml file describing the font). This is a somewhat extended version of irrlicht's fonttool (our version can be told not to create bitmaps of all characters, but only of the ones used in certain translations. We use this to reduce the size of the bitmaps for Asian fonts). Just specify -DFONT_TOOL=yes in cmake (or select the checkbox in the advanced section in the cmake gui to build this tool). In this tool select the font you want to use, the size (usually 24), size of the bitmap (for Asian fonts we use 512x512), png format and output filename. Then click on create, then save.

Then copy the created files into stk-code/data/fonts. To test a font as GUI font, just copy the created xml file to StkFont.xml, and start STK.


2/ Apparently the project leaders want a font that support all possible glyphs at all cost

In my humble opinion, I think reason 2 holds everything back and is a near-impossible constraint to get around since there's very few (none?) fonts that can do that.

This is indeed part of the problem. If STK would only come with English, many problems would be easier (e.g. cardinal letters: 1st, ...). We've also implemented a reasonable fallback system where we can pick characters from a different font if they are missing (not that this looks good though ;) ).

I would be happy to spent some more time on the font support, if we should get a better luck from it. One example could be to use a special font to display the rank in a race ('1st' etc. ) - a font with just 20 entries (which is the maximum number of karts). Each language could then supply its own way for those cardinal numbers, and as fallback we would just use "1." (or even just "1").

Suggestions welcome.

...

It's nothing more than a Sans font with a black border.
So I try to render some words with the GNU FreeSans font in the same style.

I choosed FreeSans because, it is free and open-source, it aims at supporting the maximum glyphs possible and it looks very similar to the font used in this screenshot.
Image
Image
Image
Image

You should be able to actually see the font in race with the above instructions, let me know if something doesn't work. That might help with the decision ;)

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Fonts

Postby Arthur » 18 Jun 2014, 22:23

Okay, I have done some digging around, gotten the font tool to work and present the first test case, SquareAntiqua. When I saw it in-game I didn't feel like it fit after all... looks a bit too square to me. But just wanted to keep others informed of my suggestions (even when they don't work out).
Attachments
SquareAntiqua.jpeg
Hey pal, I took an oath for justice! "In happy days or tightest tights..." or something like that.
User avatar
Arthur
 
Posts: 1073
Joined: 06 Dec 2009, 00:49

Re: Fonts

Postby Totoplus62 » 19 Jun 2014, 08:30

"Imagination is more important than knowledge." Features under CC-BY 3.0, CC-BY-SA 3.0 or equivalent GNU license
Image SuperTuxKart Popularity
User avatar
Totoplus62
 
Posts: 584
Joined: 10 Nov 2012, 13:33
Location: France - Pas-de-Calais

Re: Fonts

Postby Funto » 19 Jun 2014, 20:48

I think it's important that a new font would have borders of a color different from the inside of the letter (as in the GNU FreeSans example in this topic).
This way it is visible in all possible backgrounds (e.g if the background is black, the white inner part of the letters is visible, if the background is white, the black border of the letters is visible).

On multiple languages support: maybe this can be done progressively, i.e start with English, which would use a different font, then French, where we add the missing glyphs, etc...
Funto
 
Posts: 459
Joined: 09 Dec 2009, 13:47
Location: Bordeaux, France

Re: Fonts

Postby vlj » 19 Jun 2014, 23:57

Arthur {l Wrote}:Okay, I have done some digging around, gotten the font tool to work and present the first test case, SquareAntiqua. When I saw it in-game I didn't feel like it fit after all... looks a bit too square to me. But just wanted to keep others informed of my suggestions (even when they don't work out).


Is it possible to ship several fonts ? While a "square" font may not look good everywhere, I'd like to have a font that scales better than ours. All our texts are big probably out of readability reasons and for instance, the debug menu is starting to fill a lot of space on screen.
vlj
 
Posts: 58
Joined: 27 Dec 2013, 04:22

Re: Fonts

Postby Arthur » 20 Jun 2014, 23:58

It's certainly possible, though scaling the current font a bit down where wanted via code might be just as good, if possible. Saves a little bit of overhead (not much though).

Funto: true about the colouring but this would need to be added somehow... hmm maybe just using some image manipulation tools would be enough, though that would not be a very flexible solution.

Thanks for the suggestion Totoplus62, here's how that font looks in-game. Opinions please!
Attachments
HandDrawnShapes.jpeg
Note: this is the bold version of the font
Hey pal, I took an oath for justice! "In happy days or tightest tights..." or something like that.
User avatar
Arthur
 
Posts: 1073
Joined: 06 Dec 2009, 00:49

Re: Fonts

Postby Totoplus62 » 21 Jun 2014, 00:32

Of course i like it :D This font is cartoony but not too much IMHO
"Imagination is more important than knowledge." Features under CC-BY 3.0, CC-BY-SA 3.0 or equivalent GNU license
Image SuperTuxKart Popularity
User avatar
Totoplus62
 
Posts: 584
Joined: 10 Nov 2012, 13:33
Location: France - Pas-de-Calais

Re: Fonts

Postby samuncle » 21 Jun 2014, 04:46

I agree this looks waaaay better than the current one.

For the border maybe we can tweak it in gimp.

I also noticed on the current font used for the rank during races has some strange artifacts.
Image
User avatar
samuncle
STK Moderator
 
Posts: 752
Joined: 16 Mar 2010, 21:28

Re: Fonts

Postby Auria » 21 Jun 2014, 23:58

For titles this may look good. For regular text, I would actually prefer something simpler, more plain. I think titles only would make it cartoonish enough, and the reste of the text should be easy on the eyes. My opinion only...
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Fonts

Postby hiker » 23 Jun 2014, 03:43

Auria {l Wrote}:For titles this may look good. For regular text, I would actually prefer something simpler, more plain. I think titles only would make it cartoonish enough, and the reste of the text should be easy on the eyes. My opinion only...

I'd agree with that: the news message just is too much, the single words look fine imho. If we agree on that, I can start to add support for one more font (text, small title, large title).

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Fonts

Postby Arthur » 23 Jun 2014, 05:27

Another candidate, which I think is quite decent, named Averia Sans.
Attachments
AveriaSans.jpeg
Hey pal, I took an oath for justice! "In happy days or tightest tights..." or something like that.
User avatar
Arthur
 
Posts: 1073
Joined: 06 Dec 2009, 00:49

Re: Fonts

Postby sj04736 » 24 Jun 2014, 02:43

Arthur {l Wrote}:Another candidate, which I think is quite decent, named Averia Sans.


The letters look ok, but the spacing looks really bad. We'd need to find a way to adjust that.
Stephen
Role: STK-Addons Developer

Image
User avatar
sj04736
 
Posts: 146
Joined: 07 Dec 2009, 02:56
Location: Western Canada

Who is online

Users browsing this forum: No registered users and 1 guest

cron