Author Topic: Work on fonts  (Read 1347 times)

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Work on fonts
« on: March 28, 2016, 06:11:46 pm »
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.
« Last Edit: March 28, 2016, 07:35:53 pm by Kammerer »

Offline JonnyH

  • Official Developer
  • Full Member
  • *
  • Posts: 141
    • View Profile
Re: Work on fonts
« Reply #1 on: March 28, 2016, 08:37:06 pm »
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: [Select]
<?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

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #2 on: March 29, 2016, 10:08:16 am »
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.
« Last Edit: March 29, 2016, 11:44:37 am by Kammerer »

Offline JonnyH

  • Official Developer
  • Full Member
  • *
  • Posts: 141
    • View Profile
Re: Work on fonts
« Reply #3 on: March 29, 2016, 03:51:33 pm »
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.

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #4 on: April 03, 2016, 06:14:43 pm »
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.
« Last Edit: April 03, 2016, 06:27:52 pm by Kammerer »

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #5 on: May 02, 2016, 05:56:03 pm »
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.

Offline JonnyH

  • Official Developer
  • Full Member
  • *
  • Posts: 141
    • View Profile
Re: Work on fonts
« Reply #6 on: May 02, 2016, 07:17:36 pm »
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.

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!)

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #7 on: May 03, 2016, 07:48:33 am »
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.
« Last Edit: May 03, 2016, 07:50:31 am by Kammerer »

Offline JonnyH

  • Official Developer
  • Full Member
  • *
  • Posts: 141
    • View Profile
Re: Work on fonts
« Reply #8 on: May 03, 2016, 04:16:04 pm »
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...

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #9 on: May 03, 2016, 04:40:48 pm »
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.

Offline JonnyH

  • Official Developer
  • Full Member
  • *
  • Posts: 141
    • View Profile
Re: Work on fonts
« Reply #10 on: May 03, 2016, 06:21:34 pm »
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.

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #11 on: May 04, 2016, 06:40:57 am »
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!
« Last Edit: May 04, 2016, 06:46:50 am by Kammerer »

Offline Kammerer

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Work on fonts
« Reply #12 on: July 26, 2016, 07:20:12 pm »
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.
« Last Edit: July 26, 2016, 07:22:16 pm by Kammerer »

Offline JonnyH

  • Official Developer
  • Full Member
  • *
  • Posts: 141
    • View Profile
Re: Work on fonts
« Reply #13 on: July 28, 2016, 10:19:56 am »
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!

 

hogan outlet hogan outlet hogan outlet woolrich outlet hogan outlet woolrich outlet Nike Air Max Outlet Online replica ray ban outlet moncler outlet peuterey outlet giuseppe zanotti pas cher louboutin pas cher Zanotti Pas Cher nike air max pas cher Moncler Pas Cher cheap nike air max 90 louboutin outlet cheap nfl jerseys from china cheap jordans for sale louboutin pas cher air jordan pas cher lancel pas cher ralph lauren pas cher Sac Longchamp Pas cher ralph lauren pas cher