Author Topic: How to edit/draw OpenXcom *.fnt/*.geo files in Adobe Photoshop EASILY  (Read 7093 times)

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
I want to present you an easy way of editing *.geo files with Adobe Photoshop (i used CS5.1), since a correct editor for this does not exist! (I have experimented this method on my own)

1) Rename the Something.geo file to Something.raw (or Something.geo.raw  - this way you just have to remove the end of the name when renaming back)
2) Open Photoshop
3) Open Something.raw in Photoshop
4) On the opening options page use dimensions: Widht: 64 Height: 154 (channel count is 1, Depth is 8 Bits, Header size = 0)
5) In the menu: Image / Mode / Indexed Color
6) In the menu: Image / Mode / Color Table
7) In the combobox select "System (Mac OS)" (then click OK, of course)

Now, as you can see, the Geoscape panel is showed up in Photoshop. :)
(a little weird colors, i know, but it is visible, and drawable)

Edit what you want, but be careful to use only the colors (EXACTLY!!!) that are already used on the picture!
For using the existing colors i recommend you to use the Eyedropper Tool, and pick a pixel, which has the color you want to use. (before using eg. Pencil Tool)
Don't worry, in OpenXcom it will have correct colors, not this orange-gray something.
(and of course you can use select-tools, move tool, copy&paste, etc.  ...for easy editing ;) )

When you are done with the edit, just save it. (it seems "Save As" can be used only at this point)
When saving, DON'T FORGET to set the FORMAT to "Photoshop Raw (*.RAW)" !!

Ok, you now just have to rename the file you just saved, to the original name! (Something.geo)

Cheers ;)

(SupSuper, i recommend setting this topic to "sticky")
« Last Edit: September 27, 2012, 05:27:40 am by fenyo1 »

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
How to edit/draw OpenXcom fonts in Adobe Photoshop EASILY
« Reply #1 on: September 27, 2012, 05:25:54 am »
I want to present you an easy way of editing OpenXcom fonts with Adobe Photoshop (i used CS5.1), since a correct editor for this does not exist! (I have experimented this method on my own)

This description is very similar to the *.geo editing, i know, but i want a complete guide, so i don't shorten.

1) Rename the Big.fnt (or Small.fnt if you wish to edit the small-font) file to Big.raw (or Big.fnt.raw  - this way you just have to remove the end of the name when renaming back)
2) Open Photoshop
3) Open Big.raw in Photoshop
4) On the opening options page use dimensions:
      Widht: 16 (or 8 when editing Small.fnt)
      Height: Divide the file's size (in BYTES!!) by 16 (or 8 when editing Small.fnt), the result is the Height
      (channel count is 1, Depth is 8 Bits, Header size = 0)
5) Zoom in, at least to 100% (a good zoom range for editing fonts is around 400% .. 3200%)
6) In the menubar: Image / Mode / Indexed Color
7) In the menubar: Image / Mode / Color Table
8 ) Now press the "Load" button!
9) Select OpenXcom-FontColorTable.act which i attached to this post (in the zip), and load it!
10) Click OK in Color Table window (of course)

Now, as you can see, the font's characters are showed up in Photoshop. :)

Edit what you want, but be careful to use only the colors (EXACTLY!!!) that are already used on the picture!
For using the existing colors i recommend you to use the Eyedropper Tool, and pick a pixel, which has the color you want to use. (before using eg. Pencil Tool)
(and of course you can use select-tools, move tool, copy&paste, etc.  ...for easy editing ;) )

When you are done with the edit, just save it. (it seems "Save As" can be used only at this point)
When saving, DON'T FORGET to set the FORMAT to "Photoshop Raw (*.RAW)" !!

Ok, you now just have to rename the file you just saved, to the original name! (Big.fnt or Small.fnt)

Oh, and about Font.dat:
This file is just a list of the characters codes, every character's index is the index of its picture in the Big.fnt! (or Small.fnt)
Of course this file is in UTF-8, so special characters are stored in 2 (continous) Bytes!

So if you want to add a new character, append that character's code to the end of Font.dat! (use a Hexeditor, or a text editor which uses UTF-8)
The code you append to this file, you can use that character-code in the language file (*.lng) when typing in texts.
And the picture which is to be used in the game for that character is the one in the font which have the same index as the code's index in the Font.dat!
When adding a new character, you need to resize the image ("Canvas Size" in Photoshop), appending the new lines to the BOTTOM!
Append 16 lines (add 16 pixels to the height using "Canvas Size" in Photoshop) per every new character. (or 9 instead of 16 when editing Small.fnt)


Cheers ;)

(SupSuper, maybe you can set this topic to "sticky" also)
« Last Edit: September 27, 2012, 05:36:40 am by fenyo1 »