Fonts after gettextization
Moderator: Forum Moderators
Fonts after gettextization
How do I make Czech characters work? In .cfg files, East-European languages used to set
But po files have no such facility, and thus I see empty squares instead of some characters in BfW now, namely ů and ř. It uses Vera font.
Ideally, a suitable font would be selected by BfW, based on the language.
Code: Select all
font="Bepa-Roman.ttf"
Ideally, a suitable font would be selected by BfW, based on the language.
- Viliam
- Translator
- Posts: 1341
- Joined: January 30th, 2004, 11:07 am
- Location: Bratislava, Slovakia
- Contact:
Re: Fonts after gettextization
IMHO there is no substantial difference between CFG and PO files. Both are just a set of key - value pairs, only formatted differently.
CFG files used fake keys -- language, id, encoding and font -- which were not to be translated, but provided special values. We could use the similar system in PO files; except that encoding is no longer needed since we switched everything to UTF-8 format, and id is obvious from the file name. I am not sure about the language key; I do not know how difficult/slow it would be to open all PO files, just to get the names of languages for the "choose language" dialog.
We can continue to use a key "font" to mean font file used by the language. Or perhaps we could rename it to "$font" or something like that, to make clear that this is a special value, which is to be treated specially.
CFG files used fake keys -- language, id, encoding and font -- which were not to be translated, but provided special values. We could use the similar system in PO files; except that encoding is no longer needed since we switched everything to UTF-8 format, and id is obvious from the file name. I am not sure about the language key; I do not know how difficult/slow it would be to open all PO files, just to get the names of languages for the "choose language" dialog.
We can continue to use a key "font" to mean font file used by the language. Or perhaps we could rename it to "$font" or something like that, to make clear that this is a special value, which is to be treated specially.
Re: Fonts after gettextization
PO files are more or less key-value pairs. CFG files are WML, though I'm not sure what of it could be meaningfully used in translation files.Viliam wrote:IMHO there is no substantial difference between CFG and PO files.
We could, if there was a string in the sources specifying the font and marked as translatable, which isn't ATM.Viliam wrote:We can continue to use a key "font" to mean font file used by the language. Or perhaps we could rename it to "$font" or something like that, to make clear that this is a special value, which is to be treated specially.
Anyway, I would prefer if either (a) a font suitable for all languages was used by default -- or at least all languages using latin alphabet, this is IMHO not too much to ask (b) BfW chose a good font itself, as the set of character needed to display given language (+ original text for yet untranslated stuff) is known.
- Viliam
- Translator
- Posts: 1341
- Joined: January 30th, 2004, 11:07 am
- Location: Bratislava, Slovakia
- Contact:
Re: Fonts after gettextization
In theory, it is possible in CFG files to define constants, macros, etc. In practice, when I look into "data/translations" directory, no one has used this. The only used features of CFG files are key-value pairs and comments.yeti wrote:PO files are more or less key-value pairs. CFG files are WML, though I'm not sure what of it could be meaningfully used in translation files.
Do other CFG files qualify as sources too? Probably yes, otherwise it would not be possible to translate scenario dialogs. Then, we only need to define a file called "dummy.cfg", which will include special strings (perhaps also with some comment about what they mean).yeti wrote:We could, if there was a string in the sources specifying the font and marked as translatable, which isn't ATM.
Font for all languages (including those not added yet) is not possible - think about "tengwar" or other very special alphabets.yeti wrote:Anyway, I would prefer if either (a) a font suitable for all languages was used by default -- or at least all languages using latin alphabet, this is IMHO not too much to ask (b) BfW chose a good font itself, as the set of character needed to display given language (+ original text for yet untranslated stuff) is known.
All currently used languages are probably supported by font Bepa (which is an extension to original Vera).
Re: Fonts after gettextization
Viliam wrote:In theory, it is possible in CFG files to define constants, macros, etc. In practice, when I look into "data/translations" directory, no one has used this. The only used features of CFG files are key-value pairs and comments.
I use defines extensively, and am still unsure whether or not I need to change this manuallly.data/translations/swedish.cfg wrote:Code: Select all
... #define SWEDISH_BoW Striden om Wesnoth#enddef #define SWEDISH_CHAOTIC kaotisk#enddef #define SWEDISH_CHAOTIC_CAP Kaotisk#enddef #define SWEDISH_COMMANDER kommendör#enddef #define SWEDISH_COMMANDER_CAP ...

Re: Fonts after gettextization
I don't really care if it's in .cpp sources, .cfg files, or whatever. The point I'm trying to make is that is not anywhere now and thus Czech is b0rken.Viliam wrote:Do other CFG files qualify as sources too? Probably yes, otherwise it would not be possible to translate scenario dialogs. Then, we only need to define a file called "dummy.cfg", which will include special strings (perhaps also with some comment about what they mean).
Something told me mentioning `all languages' would inevitably bring either tengwar or klingon... ;-)Viliam wrote:Font for all languages (including those not added yet) is not possible - think about "tengwar" or other very special alphabets.
Well, then why does BfW use normal Vera by default? If the solution is so simple, then this question should be probably asked elsewhere, as devs don't read this forum much...Viliam wrote:All currently used languages are probably supported by font Bepa (which is an extension to original Vera).
P.S.: I didn't realize Bepa is a really clever pun on Vera, until you put them side by side :-)
Re: Fonts after gettextization
Oops, I should have read http://www.wesnoth.org/forum/viewtopic.php?t=964 first. So is there any problem with replacing Vera with Bepa altogether?yeti wrote:Well, then why does BfW use normal Vera by default? If the solution is so simple, then this question should be probably asked elsewhere, as devs don't read this forum much...
- Viliam
- Translator
- Posts: 1341
- Joined: January 30th, 2004, 11:07 am
- Location: Bratislava, Slovakia
- Contact:
Re: Fonts after gettextization
Oops, my apologies, I missed that one translation. Bad news - I am afraid (though not 100% sure) that such use of macros is incompatible with gettext.sanna wrote:I use defines extensively, and am still unsure whether or not I need to change this manuallly.
Only to make the point clearer. I could have used Chinese probably as well. There are few nice free fonts. One if very lucky to find any supporting "central European" characters. I do not know what is the situation like with Chinese / Japanese / Korean free fonts. But I feel like searching for a nice free font supporting both CE and CJK characters would be too much of a miracle to happen before version 1.0 is ready.yeti wrote:Something told me mentioning `all languages' would inevitably bring either tengwar or klingon...
(So far I haven't seen any Chinese or Japanese translator here, but I believe that sooner or later they will come. Or maybe Hebrew or Arabic... simply, someone using characters outside Latin and Cyrilic groups.)
Personally, I do not see any problem. The only thing that prevents me from screaming "Replace all fonts with Bepa, NOW!" is looking at the fonts' file sizes. Vera has 6KB, Bepa 46KB... assuming that Bepa covers all Vera range, and a few characters more, it's kind of suspicious. If someone only could explain it to me, because I do not understand the TTF format...yeti wrote:So is there any problem with replacing Vera with Bepa altogether?
- Viliam
- Translator
- Posts: 1341
- Joined: January 30th, 2004, 11:07 am
- Location: Bratislava, Slovakia
- Contact:
Re: Fonts after gettextization
Viliam wrote:...Vera has 6KB, Bepa 46KB...

Re: Fonts after gettextization
Very bad news indeed, since the amount of texts to be translated is so large, it's almost inevitable that we'll end up with a lot of inconsistencies in the translation of 'special terms' if defines cannot be used.Viliam wrote:Oops, my apologies, I missed that one translation. Bad news - I am afraid (though not 100% sure) that such use of macros is incompatible with gettext.

Re: Fonts after gettextization
Maybe you could use M4 preprocessing, if you really like macros. At least privately, it might be overkill in BfW itself. Though this defeats the idea of having primary sources in CVS.sanna wrote:Very bad news indeed, since the amount of texts to be translated is so large, it's almost inevitable that we'll end up with a lot of inconsistencies in the translation of 'special terms' if defines cannot be used. :(
Or take it easy ... there are laguages (like mine) with declension and conjugation complex enough to prevent anyone from even thinking of macros.
Re: Fonts after gettextization
(deleted duplicate)
Re: Fonts after gettextization
I only started to use them because...yeti wrote:if you really like macros
I continued to use them primarily for translations that I was not altogether happy with, in order to easily be able to change them when a better translation presented itself.Wesnoth Translations WIKI ([url]http://wesnoth.slack.it/?WesnothTranslations[/url]) wrote:A good tip to all translators is to use defines to keep the skills and such constant during diffrent iterations of the game.
Yes, I know that there are many languages where using macros would be more complicated than 'manually' keeping the translations consistent.yeti wrote:Or take it easy ... there are laguages (like mine) with declension and conjugation complex enough to prevent anyone from even thinking of macros.
Well, at least I know now that I have to replace them.

So I'll just go and take a stab at replacing the defines with literal text!
"Languages that need a different font than the default ''Vera.ttf'' must declare it by translating the ''"Vera.ttf"''
string into the correct filename." -- http://wesnoth.slack.it/?GetText
- Miyo
string into the correct filename." -- http://wesnoth.slack.it/?GetText
- Miyo
Last edited by miyo on August 29th, 2004, 3:56 pm, edited 1 time in total.
Hm that should be http://wesnoth.slack.it/?GetText right? Nice to see that they've edited the WIKI to include this vital info.miyo wrote:"Languages that need a different font than the default ''Vera.ttf'' must declare it by translating the ''"Vera.ttf"''
string into the correct filename." -- http://wesnoth.slack.it/GetText
