widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #00910
Re: Fonts in Widelands
(Sorry, somehow Holgers mail never reached me - no mail in spam folder
and my mailing list subscription was fine, so no idea, waht went
wrong... :-( )
I general agree with you, Holger, and I never wanted to put you under
pressure to fix the FreeFont problems. For me it's okay, if we take the
way you suggested.
Only point I see different is:
> Chinese is well below 10% translated and arabic is even below. So I
do not see such a big problem here.
You are right, but the question is, why are those translations that
unfinished until now. I already had a discussion with a translator from
Israel,when I was Elder of translation some years ago and what he
pointed out, was renewed from other translators several times until than:
There is no fun in translating something if you can not use the
translation inside the program afterwards, thus people stop translating...
See https://bugs.launchpad.net/widelands/+bug/590874 as well
So right to left writing should definitely be implemented.
By the way, from what I read in the internet the top to bottom alignment
of texts seems to be less needed (at least concerning chinese and
japanese). I read at several places, that modern books, magazins and
thus surely computer programs as well often use left to right alignment
for chinese and japanese.
Cheers
Peter
==============================
Original Mail:
==============================
Aaah, I was expecting this discussion to come up :). So here is my line
of reasoning for DejaVu:
FreeSerif and FreeSans (the new versions) looked strange when used with
ptsize < 14. The characters were jumping up and down in a single line.
Granted, I did not invest much time to bug fix this issue. I could see
that this is a bug in our ascent calculation (the old font renderer
which is still in use in most places ignores the ascent informations
from the font files as they are wrong in the fonts we currently ship).
But I found other people in the internet having the same trouble with
free*.ttf, so I decided to instead switch to DejaVu.
>
> Some years ago Widelands delivered fonts, which licenses were
incompatible to the GPL. Because of that we had a discussion on our
mailing list and finally I took the task to search for a replacement for
those fonts. In general there were three points I had to think about:
> * the license of the font
> * how many supported glyphs it has (does it provide glyphs for
arabic, japanese, etc.? - if we have translations, they should be
useable in game - there is still a problem with languages with right to
left text, but that's another topic)
> * and of course the style of the font
>
> So coming back to todays situation: SirVer merged an awesome new text
render system two days ago :). Following this merge, he is now improving
the texts in game and did replace the FreeSerif font with the DejaVu
fonts. As far as I understand his commit messages, his point is about
"style" - the look of the font. But I fear it's not that easy.
>
> Let's compare the fonts for the three points mentioned above:
>
> 1. The FreeSerif and FreeSans fonts from the freefont project at
http://savannah.gnu.org/projects/freefont/ ae the ones we used in the
last years. However the ones we deliver are an already quite old release
and it seems SirVer did not like their look ;). Positive side is: the
ones we deliver are still licensed GPL v2.
DejaVu ships with Wesnoth and we do not have to show the license to the
end user, we just need to ship it with the font files (done already in
trunk), so from a legal point of view we are save and can still release
under GPL (wesnoth does the exact same thing and have been doing for
years, AFAIK not even the debian people have been grabbing their
pitchforks yet). Of course this is my interpretation and I am not a lawyer.
> 2. The current release version of the FreeSerif and FreeSans fonts
are even more complete than the ones we currently deliver. As far as I
found out in the internet, it is still by far the most complete GPL
compatible font. This means, no other font can provide us with support
for that many different glyphs (and thus languages). Further it's look
was improved. Negative side: it is now licensed GPLv3 or higher - to use
them in a Widelands software bundle (e.g. installer for Windows), we
would have to license the whole bundle and so Widelands GPLv3 as well or
show different licenses for different parts of the bundle.
DejaVu has a lot of glyphs and as it stands now, Widelands can not
handle left to right or top to bottom rendering. So you can basically
not play it with non-latin fonts anyway.
>
> 3. The DejaVu fonts that SirVer included in Widelands because of
their style are released under a free license (Bitstream Vera Font
Copyright and Arev Font Copyright -
http://dejavu-fonts.org/wiki/License). However all discussions on the
internet I found in a 5 minutes search only pointed out, that those
fonts are used in open source projects (under GPL) and thus seem to be
GPL compatible ;) ... Following those dicussions I guess we are save to
use it, but to be strict, it's license is not GPL, so if we include the
DejaVu fonts in a software bundle, we would have to show the GPL as well
as the DejaVu license.
As mentioned, I do not think this is true. You only have to bundle the
license with the fonts (in the same directory I think.
> BIG NEGATIVE point of DejaVu fonts is the number of glyphs they
provide. They only provide Latin, Greek, Cyrilic, Armenian and Georgian
Glyphs (see http://dejavu-fonts.org/wiki/Main_Page), some more glyph
sets are incomplete, like arabic, some are not at all provided like
japanese, chinese, etc.
As mentioned, I do not see this as a real problem. Having a quick look
at the current translation status on launchpad shows that the only
critical languages might be greek and russian. My understanding is that
DejaVu has glyphs for this languages though my limited knowledge of the
languages does not allow me to check. Chinese is well below 10%
translated and arabic is even below. So I do not see such a big problem
here.
>
> I see different possibilitys to handle this:
>
> 1. Go by one font that provides glyphs for almost all languages, so a
"select used font option" is not needed. the freefont project fonts are
not 100% complete (concering the unicode standard), but by far more
complete than the DejaVu fonts, so if we take this way, they would be
our choice.
I am not emotionally attached to DejaVu. The new text renderer does use
"proper" fonts for bold and italic though, so whatever font we ship, we
must also include "*Bold.ttf", "*BoldItalic.ttf" "*Italic.ttf", this is
really the only requirement I have. If someone figures out the layouting
problems with the new Free* fonts, I can totally live with them.
>
> 2. Widelands already supports an option to select a font for the main
menu - if that option is improved to be usable for the whole game, it
could be used for selecting a "font set", that defines different fonts
and styles (heading, buttons, texts, etc.). That way we could use
different fonts and users could change the font for the whole game, if
their glyph set is not supported. This could maybe be improved that far,
that cmake includes an automated script that searches for fonts it knows
and generates new font sets. (To explain the idea behind that option: If
you install libreoffice on Mageia linux and select to install the
japanese translation for libreoffice, the needed fonts are installed as
well. If japanese is not installed, the fonts are not needed as well…)
The problem here is that a lot of layouting in Widelands is done by
assuming pixel sizes, so switching out a font breaks a lot of layouts
throughout the game. So while I believe it would be good to make the
fonts replacable on a per language basis, I would not allow the user to
do so, but do it on a per language level (so we could use another font
for chinese glyphs for example) and keep the number of supported fonts
low and ship them with the game.
> My question: what do you think is the way to go?
>
> Personally I prefare to go with option 1 (only one font set) for now
and update the freefonts to their new version. This opinion is simply
based on the idea, that option 2 might be quite a lot of work and would
only be usable, if right to left text is usable in Widelands as well.
I believe right to left text is very far off as is top to bottom. I
invested a lot of time in investigating the current possibility (pango
and harfbuzz mainly) for better text layouting and they all where let
downs. The new text renderer could be adapted to work for left to right
rather easily if text rendering where available. Top to bottom is nearly
impossible to achieve as horizontal layouts are everywhere in Widelands.
So from my point of view, I prefer the solutions in the following order:
1) stick with DejaVu and calling things done until someone complains
convincingly that this choice makes it impossible to play Widelands in
his language now though it was possible before. I think it unlikely that
this ever happens.
2) roll back my commits and keep using Free* fonts. Someone (not me)
would need to figure out how to fix the weird rendering and I would want
more choices in the font styles (for example having a condensed form for
the numbers in warelists displays makes the menu nicer to look at).
Cheers,
Holger
Follow ups