← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/fh1 into lp:widelands

 

> I see TTF handle bold/italic styles, so I wonder why it is handled in the code by using different fonts. This is not going to work if using the custom fonts. The bold faces processed by SDL_TTF do not look that bad imo.

What SDL_TTF is when rendering bold is to render the same text twice with an offset of a pixel - this looks good often enough, but not always. With some fonts it gets completely unreadable. The same for italic: it renders each character at an angle. It is a fragile system that we do not control. When you use bold/italic in your text processor, it will only work if there is a bold/italic ttf installed on your system - and imho that is a good thing. Reverting back to SDL_TTF rendering is a step backwards imho.

Frankly, letting the user choose a font is not a good idea. First: we have no control what characters are supported in the fonts the user chooses which sets us up for incompatibilities which we cannot fix ourselves. Second: Widelands does not deal well with different font sizes in different places, this can be fixed, but it is much easier if we commit ourselves to a fixed number of fonts that we will support and ship with Widelands.

This leads me to the following suggestion: Why not link language codes to fonts and ship them with Widelands? We then have complete control over how Widelands looks and renders, which chars it supports and we can get rid of this option. I could see that we then also change the <font> tag to only allow style changes as you are suggesting and not change the font that is used for rendering.

Just to manage expectations: I am in vacations for the next two weeks. I might have access to email, but I will not check them regularly, so you will not hear from me much till beginning of September.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1/+merge/177228
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/fh1.


References