WARNING: error loading font file Fonts/FortuneCity.ttf

Feedback and support for the PC version of Osmos
gagern
Posts: 9
Joined: Mon Oct 11, 2010 11:18 pm
Contact:

WARNING: error loading font file Fonts/FortuneCity.ttf

Postby gagern » Tue Oct 12, 2010 12:38 am

Osmos 1.6.0 for Linux (both demo and full version) won't load the font with freetype 2.4.3, resulting in an application basically lacking all text. Freetype 2.4.2 used to work for me, which led me to file a bug with my distro. The Gentoo developer Ryan Hill has pointed out, though, that the font itself seems to be broken.

Code: Select all

$ ftlint 10 Fonts/FortuneCity.ttf
Fonts/FortuneCity.ttf: glyph  106: 0x0014
1 fail.


With trace output enabled, I could obtain more detailed error information:

Code: Select all

FT2_DEBUG=any:1 ftlint 10 Fonts/FortuneCity.ttf
Init_Context: new object at 0x0x17b0350
FT_Stream_Open: opened `/home/mvg/Osmos/Fonts/FortuneCity.ttf' (40303 bytes) successfully
tt_face_get_location: too large offset=0x00005450 found for gid=0x006b, truncate at the end of glyf table (0x00005394)
/home/mvg/Osmos/Fonts/FortuneCity.ttf: glyph  106: 0x0014
tt_face_get_location: too large offset=0x00005450 found for gid=0x006b, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005450 found for gid=0x006c, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005450 found for gid=0x006d, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005450 found for gid=0x006e, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000056a2 found for gid=0x006f, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000056a2 found for gid=0x0070, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005775 found for gid=0x0071, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005775 found for gid=0x0072, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005775 found for gid=0x0073, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000057e6 found for gid=0x0074, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000058ae found for gid=0x0075, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005954 found for gid=0x0076, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005954 found for gid=0x0077, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005954 found for gid=0x0078, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005a1e found for gid=0x0079, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005a1e found for gid=0x007a, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005a1e found for gid=0x007b, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005a1e found for gid=0x007c, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005a1e found for gid=0x007d, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005b3e found for gid=0x007e, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005b56 found for gid=0x007f, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005b6e found for gid=0x0080, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005b86 found for gid=0x0081, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005b9e found for gid=0x0082, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005bb6 found for gid=0x0083, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005bce found for gid=0x0084, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005bce found for gid=0x0085, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005bea found for gid=0x0086, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c02 found for gid=0x0087, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c1a found for gid=0x0088, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c32 found for gid=0x0089, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c4a found for gid=0x008a, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c62 found for gid=0x008b, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c7a found for gid=0x008c, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005c92 found for gid=0x008d, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005caa found for gid=0x008e, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005dc4 found for gid=0x008f, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005ddc found for gid=0x0090, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005df4 found for gid=0x0091, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005e0c found for gid=0x0092, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005e24 found for gid=0x0093, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005e3c found for gid=0x0094, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005e54 found for gid=0x0095, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005ee3 found for gid=0x0096, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005ee3 found for gid=0x0097, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005efb found for gid=0x0098, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005f13 found for gid=0x0099, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005f2b found for gid=0x009a, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005f43 found for gid=0x009b, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00005f5b found for gid=0x009c, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006040 found for gid=0x009d, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006244 found for gid=0x009e, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000625c found for gid=0x009f, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006274 found for gid=0x00a0, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000628c found for gid=0x00a1, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000062a4 found for gid=0x00a2, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000062bc found for gid=0x00a3, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000062d4 found for gid=0x00a4, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000062d4 found for gid=0x00a5, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000062e8 found for gid=0x00a6, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006300 found for gid=0x00a7, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006318 found for gid=0x00a8, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006330 found for gid=0x00a9, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006348 found for gid=0x00aa, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006360 found for gid=0x00ab, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006378 found for gid=0x00ac, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006438 found for gid=0x00ad, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000064eb found for gid=0x00ae, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000064eb found for gid=0x00af, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006503 found for gid=0x00b0, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000651b found for gid=0x00b1, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006533 found for gid=0x00b2, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000654b found for gid=0x00b3, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006563 found for gid=0x00b4, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000657b found for gid=0x00b5, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006628 found for gid=0x00b6, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006628 found for gid=0x00b7, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006640 found for gid=0x00b8, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006658 found for gid=0x00b9, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006670 found for gid=0x00ba, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006688 found for gid=0x00bb, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000066a0 found for gid=0x00bc, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000678e found for gid=0x00bd, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000067a6 found for gid=0x00be, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006805 found for gid=0x00bf, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006805 found for gid=0x00c0, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006805 found for gid=0x00c1, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000681d found for gid=0x00c2, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006835 found for gid=0x00c3, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000684d found for gid=0x00c4, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000684d found for gid=0x00c5, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x000068e0 found for gid=0x00c6, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000699c found for gid=0x00c7, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x0000699c found for gid=0x00c8, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006a65 found for gid=0x00c9, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006b56 found for gid=0x00ca, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006b56 found for gid=0x00cb, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006b56 found for gid=0x00cc, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006bd3 found for gid=0x00cd, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006c50 found for gid=0x00ce, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006ccd found for gid=0x00cf, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006d94 found for gid=0x00d0, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006e5b found for gid=0x00d1, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006f22 found for gid=0x00d2, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006f22 found for gid=0x00d3, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006f22 found for gid=0x00d4, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006f22 found for gid=0x00d5, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00006fcb found for gid=0x00d6, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00007248 found for gid=0x00d7, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00007248 found for gid=0x00d8, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00007248 found for gid=0x00d9, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00007248 found for gid=0x00da, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00db, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00dc, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00dd, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00de, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00df, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e0, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e1, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e2, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e3, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e4, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e5, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e6, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e7, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e8, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00e9, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00ea, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00eb, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00ec, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00ed, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00ee, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00ef, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00f0, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00f1, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00f2, exceeding the end of glyf table (0x00005394)
tt_face_get_location: too large offset=0x00008017 found for gid=0x00f3, exceeding the end of glyf table (0x00005394)
1 fail.


The error code 0x14 stands for "invalid outline" according to freetype/fterrdef.h. The error message cannot be reproduced with freetype 2.4.2 either. After doing a git bisect I isolated one commit as the one causing this error message for FortuneCity.ttf. That commit adds a new check that hasn't been present before. It's exactly the one leading to the trace messages.

I don't know much about the internal format of a TTF file, but I'll assume that the freetype devs knew what they were doing and that the font is indeed broken in this respect. I suggest you try obtain a fixed font somehow, or explaining why the font is correct and the check in freetype is in error.

As using the game menu becomes almost impossible without text, and as novice users in particular might not know of a safe way to exit a full screen app they can't control properly, I would also suggest you abort starting the game if the fonts won't load, instead of just issuing a warning and continuing as if nothing happened.

Cape
Posts: 1
Joined: Sun Oct 17, 2010 3:15 am

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby Cape » Sun Oct 17, 2010 3:25 am

Wow! Nice bug squashing job mate ;) . Anyway, one dirty hack to fix this issue:
- Go to your /usr/share/fonts/TTF/ directory and choose a font you like (remeber the name)
- In a terminal:
# mv /opt/Osmos/Fonts/FortuneCity.ttf /opt/Osmos/Fonts/FortuneCity.ttf.bakcup
# cp /usr/share/fonts/<fontyoulike.ttf> /opt/Osmos/Fonts/FortuneCity.ttf

gagern
Posts: 9
Joined: Mon Oct 11, 2010 11:18 pm
Contact:

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby gagern » Sun Oct 17, 2010 5:48 am

OK, I had a look at a two TTF specs (one from Apple, the other from Microsoft) and compated that with FortuneCity.ttf in a hex editor. I have to agree that the font is in fact in violation to the specification:

  • The glyf table starts at 0x7f8 and has length 0x5394 according to the table directory.
  • The glyf table cannot reasonably be any longer, because it's immediately followed by the OS/2 table at 0x5b8c.
  • According to the maxp table, the font has 244=0xf4 glyphs.
  • That matches the 4*(244+1)=0x3d4 bytes length of the loca table.
  • The loca table is located from 0x886f to 0x8c43.
  • The loca table seems to contain an increasing sequence of 32bit integers as required.
  • Many of these integers are larger than 0x5394, the last one is 0x8077.
  • No entry in the loca table seems to actually match the length of the glyf table.

So the font does indeed give locations for glyph specifications that lie outside the corresponding table. How that happened I cannot guess. Adjusting the font to only contain the correct glyphs would require recalculation of checksums, so that would be a bit more work.

gagern
Posts: 9
Joined: Mon Oct 11, 2010 11:18 pm
Contact:

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby gagern » Sun Oct 17, 2010 10:37 am

gagern wrote:
  • The glyf table cannot reasonably be any longer, because it's immediately followed by the OS/2 table at 0x5b8c.


I got that wrong, dont't know how. The table length of the glyf table in the header seems to be incorrect, but there is no overlap. So take a hex editor and change these bytes in order to fix the font:

Code: Select all

Change bytes at address 0x80 through 0x8b
from FD C6 55 01 00 00 07 F8 00 00 53 94
to   5D 19 C3 5C 00 00 07 F8 00 00 80 77


That adjusts the length of the glyf table to match the size implied by the last entry of the loca table, which is 0x8077. That makes 0x886e the last byte of the table, which is the last byte preceding the following table (the loca table at 0x886f). So there are two indications that this should be the correct table length. Current freetype libraries accept the modified font all right.

The change adjusts the checksum for the glyf table to match the new range. It doesn't adjust the overall file checksum, as stored in the checkSumAdjustment field of the head table. Calculating that value for a file whose size isn't a multiple of 4 isn't properly defined, and for the most likely definition, a padding with zeroes, the value doesn't verify for the font before the change. freetype doesn't seem to care about that value.

On the whole, the file doesn't honour the alignment requirements expressed in the specs, which require tables to start at four byte boundaries, and to be padded with zeroes to a multiple of four bytes, although the length in the header should reflect the unpadded length. The tables in this font immediately follow one another, with no padding, and as a result of this, the checksum for one table might take the first few bytes of the following table into account as well. At the end of the file, the checksum for the complete file might take arbitrary bytes into account if the corresponding buffer wasn't zeroed prior to calculation. This might result to arbitrary checksums for the whole file.

gagern
Posts: 9
Joined: Mon Oct 11, 2010 11:18 pm
Contact:

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby gagern » Sun Oct 17, 2010 11:24 pm

Perhaps you want to be even more compliant with the TTF spec, and therefore want to fix those alignment problems and the overall file checksum as well. To do so, you can pas the font through the following Python script after making the adjustment outlined above. This will increase the font size by one byte, but might improve portability. Don't know of any font system that actually requires this, though.

Code: Select all

#!/usr/bin/python

import struct
import sys

if len(sys.argv) == 2:
    inFile = sys.argv[1]
    outFile = sys.argv[1]
elif len(sys.argv) == 3:
    inFile = sys.argv[1]
    outFile = sys.argv[2]
else:
    print "Usage: %s input.ttf [output.ttf]" % sys.argv[0]
    exit

with open(inFile, 'rb') as f:
    data = f.read()

(sfntVersion, numTables, searchRange, entrySelector, rangeShift) = \
    struct.unpack('>I4H', data[:12])
if sfntVersion != 0x10000:
    print "Unknown sfnt version"
    exit

checkSumAdjustIndex = -1
result = list(struct.unpack('>%dI' % (3 + numTables*4),
                            data[:12 + numTables*16]))
tables = []
for i in range(numTables):
    (tag, checkSum, offset, length) = result[3 + i*4 : 7 + i*4]
    dwords = (length + 3)/4
    tableData = data[offset : offset + length]
    tableData += '\0'*(4*dwords - length)
    tableData = list(struct.unpack('>%dI' % dwords, tableData))
    tables.append((offset, length, i, tableData))
for offset, length, i, tableData in sorted(tables):
    if data[12 + i*16 : 16 + i*16] == 'head':
        tableData[2] = 0
        checkSumAdjustIndex = len(result) + 2
    result[4 + i*4] = sum(tableData) & 0xffffffff
    result[5 + i*4] = 4*len(result)
    result.extend(tableData)
if checkSumAdjustIndex != -1:
    result[checkSumAdjustIndex] = (0xb1b0afba - sum(result)) & 0xffffffff
result = struct.pack('>%dI' % len(result), *result)

with open(outFile, 'wb') as f:
    f.write(result)

gagern
Posts: 9
Joined: Mon Oct 11, 2010 11:18 pm
Contact:

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby gagern » Mon Oct 18, 2010 10:43 pm

Or if you prefer a hex editor over a python interpreter, and your hex editor can insert bytes (at 0x886f):

Code: Select all

   00000000  00 01 00 00 00 11 01 00  00 04 00 10 4c 54 53 48  |............LTSH|
  -00000010  7a 91 64 25 00 00 8c 43  00 00 00 f8 4f 53 2f 32  |z.d%...C....OS/2|
  +00000010  7a 91 64 25 00 00 8c 44  00 00 00 f8 4f 53 2f 32  |z.d%...D....OS/2|
   00000020  92 80 89 9f 00 00 01 1c  00 00 00 60 50 43 4c 54  |...........`PCLT|
  -00000030  7f 1d 29 dc 00 00 93 67  00 00 00 36 56 44 4d 58  |..)....g...6VDMX|
  -00000040  6b 9b 73 23 00 00 93 9f  00 00 05 e0 63 6d 61 70  |k.s#........cmap|
  -00000050  eb 9a 82 f7 00 00 9b 37  00 00 02 36 63 76 74 20  |.......7...6cvt |
  +00000030  7f 1d 29 dc 00 00 93 68  00 00 00 36 56 44 4d 58  |..)....h...6VDMX|
  +00000040  6b 9b 73 23 00 00 93 a0  00 00 05 e0 63 6d 61 70  |k.s#........cmap|
  +00000050  eb 9a 82 f7 00 00 9b 38  00 00 02 36 63 76 74 20  |.......8...6cvt |
   00000060  62 9a 67 b6 00 00 07 90  00 00 00 24 66 70 67 6d  |b.g........$fpgm|
   00000070  b5 33 cc 1c 00 00 04 68  00 00 02 d8 67 6c 79 66  |.3.....h....glyf|
  -00000080  fd c6 55 01 00 00 07 f8  00 00 53 94 68 65 61 64  |..U.......S.head|
  -00000090  e1 ee 36 31 00 00 8d 3b  00 00 00 36 68 68 65 61  |..61...;...6hhea|
  +00000080  5d 19 c3 5c 00 00 07 f8  00 00 80 77 68 65 61 64  |]..\.......whead|
  +00000090  e1 ee 36 31 00 00 8d 3c  00 00 00 36 68 68 65 61  |..61...<...6hhea|
   000000a0  0e b5 08 1d 00 00 07 b4  00 00 00 24 68 6d 74 78  |...........$hmtx|
  -000000b0  b4 48 16 88 00 00 8d 73  00 00 03 d0 6b 65 72 6e  |.H.....s....kern|
  -000000c0  00 02 fe 63 00 00 91 43  00 00 02 22 6c 6f 63 61  |...c...C..."loca|
  -000000d0  00 48 ed 6c 00 00 88 6f  00 00 03 d4 6d 61 78 70  |.H.l...o....maxp|
  +000000b0  b4 48 16 88 00 00 8d 74  00 00 03 d0 6b 65 72 6e  |.H.....t....kern|
  +000000c0  00 02 fe 63 00 00 91 44  00 00 02 22 6c 6f 63 61  |...c...D..."loca|
  +000000d0  00 48 ed 6c 00 00 88 70  00 00 03 d4 6d 61 78 70  |.H.l...p....maxp|
   000000e0  03 31 05 e8 00 00 07 d8  00 00 00 20 6e 61 6d 65  |.1......... name|
  -000000f0  1c 99 ef ab 00 00 99 7f  00 00 01 b6 70 6f 73 74  |............post|
  +000000f0  1c 99 ef ab 00 00 99 80  00 00 01 b6 70 6f 73 74  |............post|
   00000100  2c b8 d7 83 00 00 01 7c  00 00 02 eb 70 72 65 70  |,......|....prep|
  ...
   00008850  58 38 11 37 b9 00 04 ff  c0 38 59 01 01 01 01 00  |X8.7.....8Y.....|
  -00008860  b9 00 00 00 cd 00 00 02  6b 00 cd 00 00 ff 33     |........k.....3|
  +00008860  b9 00 00 00 cd 00 00 02  6b 00 cd 00 00 ff 33 00  |........k.....3.|
   00008870  00 00 00 00 00 00 00 90  00 00 00 90 00 00 00 90  |................|
  ...
   00008d30  01 01 01 01 01 01 01 01  01 01 01 18 00 01 00 00  |................|
  -00008d40  00 01 00 00 c5 67 29 e2  5f 0f 3c f5 00 32 08 f0  |.....g)._.<..2..|
  +00008d40  00 01 00 00 06 c0 20 40  5f 0f 3c f5 00 32 08 f0  |...... @_.<..2..|
   00008d50  00 00 00 00 b4 e8 26 e7  00 00 00 00 c7 31 c3 91  |......&......1..|

User avatar
Meal Worms
Posts: 624
Joined: Wed Apr 22, 2009 12:22 pm
Location: Toronto, Ontario, Canada
Contact:

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby Meal Worms » Thu Oct 21, 2010 6:34 am

Thanks for the great detective work on this gagern, fab stuff! We've got someone on it, hoping to have a nice cleanup to that font soon.

Cheers mate!
Dave

CCo
Posts: 1
Joined: Wed Dec 15, 2010 11:08 am

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby CCo » Wed Dec 15, 2010 11:12 am

Please bundle an uncorrupted font with the Humble Indie Bundle. I just bought it and the game is unplayable (for me and for all with a newer FreeType version) because of this bug. The above Hex-Hack works wonderfully.

tkmorris
Posts: 1
Joined: Thu Dec 16, 2010 5:25 pm

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby tkmorris » Thu Dec 16, 2010 5:28 pm

Dowloading this (http://www.searchfreefonts.com/free/fortunecity.htm) font fixed it for me.

Is this the same font (although a different version)?

gagern
Posts: 9
Joined: Mon Oct 11, 2010 11:18 pm
Contact:

Re: WARNING: error loading font file Fonts/FortuneCity.ttf

Postby gagern » Fri Dec 17, 2010 1:22 am

tkmorris wrote:Is this the same font (although a different version)?


Visually it looks the same. File size is much smaller, though, so I assume it might contain fewer glyphs.

For those unwilling to (install and) use a hex editor, I can suggest the following bash snippet:

Code: Select all

echo -n $'\x5d\x19\xc3\x5c' | dd of=FortuneCity.ttf bs=1 conv=notrunc seek=128
echo -n $'\x80\x77' | dd of=FortuneCity.ttf bs=1 conv=notrunc seek=138

This adjusts the size, but not the alignment. It should be enough to make freetype happy.


Return to “Osmos PC (Win/Mac/Linux)”

Who is online

Users browsing this forum: No registered users and 24 guests