123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|623|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> Linux and Windows, same font, different format?

Sat, 16 Jul 2011, 13:55
HoboBen
Taking the first 64 bytes of "arial.ttf" on both Windows and Linux, it appears that they're very different.

The Windows version seems (by eye, I haven't checked) to match the OpenType/TrueType spec, but the Linux one is odd.

In both cases, four-byte table tags are in the same place, e.g. DSIG, GSUB, JSTF appear on both. But the numbers following these tags are completely different.

Here's the output. The wrapping of the hex output in both cases is the same (so the last column on the first corresponds to the last column on the second).

Look particularly at the last two bytes on the first row.



This is also the case with other fonts that I've looked at (including non-microsoft ones).

I have no clue why the hell they're different. Because, as TrueType files, they bloody shouldn't be different - they should follow the spec! Any ideas why the Linux files don't?

-=-=-
blog | work | code | more code
Sat, 16 Jul 2011, 14:04
HoboBen
Actually, I'm just an idiot. I didn't read in the big-endian encoding properly.

-=-=-
blog | work | code | more code
Tue, 19 Jul 2011, 02:17
Afr0
Yup, that'll get ya every time.
Windows uses little endian, Lunix and Mac uses big endian.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Tue, 19 Jul 2011, 03:23
Sticky
Linux uses little on the majority of common processors.
Mac uses little on everything that isn't PowerPC.
Windows always uses little.

Relevant list on wikipedia

-=-=-
last.fm
Tue, 19 Jul 2011, 06:23
JL235
Wikipedia also says x86 only supports little-endian, both there and on the x86 page (although obviously it could be simulated on top using software).

So the Linux font mystery continues.
Tue, 19 Jul 2011, 12:44
HoboBen
I think the files are just different (one was installed with Windows XP (a ten years old OS)) and one was downloaded a few weeks ago. I would guess this explains the difference. Both actually work now.

The TTF format, as in the actual file, uses big-endian shorts and integers. This is because TTF was originally specified by Apple back when Macs were big-endian (which they no longer are).


-=-=-
blog | work | code | more code