1. Forum moved (you can use login and pass from old forum)
  2. Many discussions moved to the bugtracker

Work on the Ingame Fonts

Discussion in 'Translations' started by Kammerer, Mar 28, 2016.

  1. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    64/112

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    Hello, everyone!

    Since we get more and more translations (thanks to every participant in the translation project) I proceeded with the work I had started in summer. At the moment I managed to add a significant part of the extended Latin to the Bigfont. You can see a sketch in the attached archive. I had to make some changes to the original font in order to create new diacritic signs and inscribe all of the glyphs into the original tile proportions. Please take a look. The criticism is welcome.

    P. S. The next step with the Bigfont is adding missing punctuation marks and Greek letters a bit later. And, of course, I'll add the same letters and signs to all of the remaining fonts.
     
    makus likes this.
  2. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    181
    Likes Received:
    31
    Best Answers:
    0
    Thanks Kammerer - that looks great!

    Any chance you can write the metadata for this? So we can map the "string" to the correct font image?

    The current data is in xml (Utf-8 encoded), and looks something like this:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>                                          
    <openapoc>                                                                      
      <apocfont name="BIGFONT" path="xcom3/ufodata/bigfont.dat" height="24" width="14" spacewidth="6" palette="UI/UI_PALETTE.PNG">
        <glyph string="-" glyph="RAW:xcom3/ufodata/bigfont.dat:14:24:12"/>
    ... Lots more <glyph \> tags
        <glyph string="?" glyph="RAW:xcom3/ufodata/bigfont.dat:14:24:127"/>         
      </apocfont>                                                                   
    </openapoc> 
    where the "glyph" tag is "RAW:file.dat:width:height:index_in_file" for 'raw' files (which the original font .dat files are, just palette indices, so each 'index' is height * width bytes long, 14 * 24 = 336 bytes in bigfont.dat

    This format also allows a single 'font' xml to contain glyphs from different files, so you can put just the new glyphs in a 'bigfont_extra.dat' or something and don't need a copy in the new file.

    I'll also have to write a quick .png->.dat converter, as the fonts in apoc are paletted depending on where they are displayed (though I think BIGFONT specifically happens to use the same palette everywhere it's used, but will need to check), so let me know when you think this is near final and worth importing and I'll process it into something openapoc can use.

    --
    Jonny
     
  3. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    Jonny, thanks for your appreciation!

    Of course I'll make the XML with the metadata when I'll finish the work on the punctuation in the Bigfont. I think it would be better right now not to multiply the number of the font files but I'm trying to preserve the usual Unicode order of the symbols and I don't really want to recreate the XML after every change in the font file :). As for the copies of the simple Latin: I had to delete one line in every single glyph in order to get some space which I used to insert the diacritic signs. That's why they are not real copies but glyphs with some redesign :). And I don't think it would be a good idea to use glyphs with different heights.

    Right now I don't really know what to do with the font format conversion. The Bigfont is almost done already and I do think PNG is much more useful when working with bitmap graphics but right now I'm using a RAW file got from the original Bigfont.dat and my own 4-bit palette created with the help of skin36. Anyway, I think we should use PNG as the format for the release version of the game.
     
  4. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    181
    Likes Received:
    31
    Best Answers:
    0
    Cool, so it's not just an extension of the BIGFONT glyphs, but you've effectively made 'BIGFONT2' :)

    As for the .png format, the issue with that is some places in the game re-colour the text based on the palette used. If we use .png format files, we'll effectively need to 'reverse' the palette lookup to get the corresponding indices, and use those instead, or have a copy of each font .png for each colour we want, which sounds annoying.

    I do agree that .png is a much better format to work with, but maybe a simple tool to process the .pngs into the .dat files we already use would be the simplest approach - where it would do the 'reverse palette lookup' (and presumably warn you if you're trying to use a colour that doesn't match one in the palette) - so you don't have to run the whole game to spot any errors in the font.
     
  5. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    So, at least some work is done. In the attach you can find the bigfont and an XML with the metadata. The font contains a lot of empty spaces that I plan to fill with special symbols, Greek letters and extended Cyrillic. But at the moment this font needs a lot of testing. Right now I have absolutely no spare time and would be really grateful if someone could create a pseudo text file and test every glyph I added in the game. I only took a look today and can't say I'm very glad with the result but I need opinions, especially of the native-speakers.

    Thanks in advance for any feedback.

    P.S. I have to say I do not plan to add Eastern languages graphics since I don't even understand the principles of the writing in Arabic, Japanese, Chinese, Thai etc. I would be very glad if someone would take this part of work.
     
  6. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    So, at last Smalfont is done. The font, its demo in the PNG format and the XML file can be found in the attached archive. At the moment I'm satisfied with the result and do not plan to return to this font in the nearest future. Hope you'll also like the result.
     
  7. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    181
    Likes Received:
    31
    Best Answers:
    0
    That looks great, thanks!

    Now I need to actually write some code to get the kerning right, and we can include this in the data (And presumably make it the default for some, if not all, languages!)
     
  8. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    Wow! I thought you don't plan to implement the kerning. It'd be very cool.

    And I also have an offtopic question - why some articles in the UFOPaedia are still in English, regardless of the chosen language (I tested Russian, Czech, Portuguese and Polish)? The example of such an article is an annotation to the Organizations category.
     
  9. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    181
    Likes Received:
    31
    Best Answers:
    0
    That may be due to us changing the english source text (there were some typos, double-spaces and a tab character for some weird reason) - so I guess as that's used as a key they no longer match the translation replacements... I guess this was a known issue when that change was made, and the translation files need to be updated accordingly - I assume transifex has a way of 'renaming' a translation without having to re-write it?

    Hopefully, soonish we'll be adding translatable string annotation to the gamestate, then we can list all the source strings for everything, and hopefully spot/automatically re-generate the keys the translations use...
     
  10. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    Well, everything about Transifex and its internals is a question for skin36 or maybe SupSuper (as he was responsible for uploading the OXC resources to Transifex). skin36 stands behind everything that can be named as source. My knowledge of the Transifex interface unfortunately tends to zero.

    As for the annotation - it'd be very cool and convenient if you could make something similar to OXC with an auto-update of the translations in the building process. This way it'd be much easier to fit the strings to the lines in the game interface. At the moment we have to use POEdit which is not very useful.
     
  11. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    181
    Likes Received:
    31
    Best Answers:
    0
    You can already use xgettext to 'extract' all the callers of tr("string"), but that only shows the input translations in code, not the ones that might come from the xml (stuff like vehicle names/descriptions/research/ufopaedia won't show up there, for instance).

    As you said, with said annotation we can use xgettext in conjunction with the xml reader to generate the superset of translations from both sources as a build step. It's not been high priority for me at the minute though, as translations will likely chance in the future, and much more added as more of the game is implemented, it would probably take quite a bit of time trying to keep everything 100% up to date through those transient changes, instead of just fixing it up every now and then.
     
  12. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    OK, no problem with that. I understan why this feature is a low priority. At least the translators can now see the text in the conditions of a working game and get an idea how it should look in the final version.

    As for xgettext - I'll try to take look, didn't know about that utility, thanks!
     
  13. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    Finally I can say I finished the work on the Smallset. At least all of the glyphs I planned to implement are done. In this font I had to change the dimensions of the tiles in order to inscribe most of the glyphs, especially those using the diacritic marks. The font and the XML are in the attached archive.
     
  14. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    181
    Likes Received:
    31
    Best Answers:
    0
    Thanks Kammerer! I fixed up a couple of xml-weirdness (&amp; instead of a raw '&' etc.) and pulled into openapoc.

    Thanks once again for your work!
     
    makus likes this.
  15. Kammerer

    Kammerer Administrator Administrator Translator/Writer
    31/56

    Joined:
    Jun 12, 2015
    Messages:
    32
    Likes Received:
    6
    Best Answers:
    0
    Hello everyone,

    I was told no one could find the fonts. I took a look at this thread and realised with horror that all of the attachments had been lost during the migration to the new forum engine. I'm terribly sorry about that. Attached are the Bigfont and Smalfont files (both font and metadata files). Bigfont is still somewhat unfinished, but they allow to play the game.

    On a related topic - yesterday I tested the current version of OpenApoc, and it was a big surprise for me when I noticed that the game replaced the glyphs with diacritics by simple symbols (i.e. é and è by e, à by a, ç by c, etc.). Can we please return this behaviour back to the normal one and show diacritics how they should be displayed, at least for the symbols added by these font files?
     

    Attached Files:

    makus likes this.

Share This Page