Page 1 of 1

How to generate oolite-font.png?

Posted: Tue Nov 13, 2012 8:38 pm
by doctorfrog
I'm a bit surprised there isn't more than one font mod (tty.oxp), given how many texture mods there already are. The default font is nice n' readable, but has all the appeal of a new Microsoft Word document. No offense to anyone who prefers its no-nonsense simplicity.

Is there a simple way to go about replacing the font, or is it something you have to do very painfully in an image editor? I've already used tty.oxp, but I'd like to pick my own font.

Re: How to generate oolite-font.png?

Posted: Wed Nov 14, 2012 8:09 am
by JensAyton
Hey, now. Office doesn’t have the class to use Helvetica. ;-)

The font files (oolite-font.png and oolite-font.plist) are generated using a custom tool that’s Mac-only, and the font to use is hard-coded in the source. If you happen to have a Mac, you can get Xcode, check out the source and play around with it (tools/fonttexgen). Otherwise, there are many similar tools out there. Details to note:
  • The first two rows are special. Copy them as they are.
  • The remaining rows are characters 32 to 255 of Windows-1252 encoding, except that the Euro symbol is replaced with the Brazilian cruzeiro symbol, ₢.
  • All glyphs except the first two rows are moved down by 1/8th of a box. This is hard-coded in Oolite.
  • The “widths” list in oolite-font.plist specifies the advances of the glyphs in eighths of an em. If you use a third-party tool, you’ll probably have to scale the output. Don’t forget that the first 32 entries should be kept as-is.

Re: How to generate oolite-font.png?

Posted: Wed Nov 14, 2012 9:14 am
by doctorfrog
That's a lot of good info. The ultimate object may be beyond my ken, but at least I can figure out how it's done. Thanks.

Re: How to generate oolite-font.png?

Posted: Fri May 30, 2014 2:26 pm
by edgepixel
1. As a person interested in typography who wants to make a font for Oolite, I know what an em is, but "advances of the glyphs" sound a little bit nebulous. What does it measure exactly, point-A-to-point-B-style?
2. I guess the ₢ symbol be changed to something else, say a newly-designed icon, like the ones on the top two rows. Am I right?
3. I intend to change the top two icon rows, too. Could you share some info on how they work?
4. What is the purpose of moving the non-icon glyphs down one eighth of a box size?

Thanks.

Re: How to generate oolite-font.png?

Posted: Fri May 30, 2014 3:44 pm
by cim
1) Width of the printable part of the glyph, essentially. Compare the values for e.g. "i" and "W" in the default font.

2) Yes, you could.

3) These are characters 0 to 31 in the character set, which are normally mostly unprintable control characters in ASCII or compatible character sets. Many of them have been repurposed for Oolite-specific characters:
0..7: government icons (used on F6 screen and elsewhere)
8: filled star (used in Elite rank text)
9..15: unused. 9, 10 and 13 are printable characters (tab, line feed, carriage return) and should definitely remain unused.
16..23: economy icons (used on F6 screen and elsewhere)
24: hollow star (used in Deadly rank text)
25..30: unused
31: very narrow space (used to align text on some screens e.g. the contracts interfaces), must be all black.

4) I assume this is to leave a gap between rows to make the font texture easier to check visually without a descender on one character appearing to merge with the accent on another.

Re: How to generate oolite-font.png?

Posted: Fri May 30, 2014 8:06 pm
by JensAyton
4. The ascenders of the default font would extend outside the box widths otherwise. (We could have changed the Y extents of the rectangle used for each glyph instead, but the effect would be the same; or we could have used a smaller font size and got less detail for the memory use.)