freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FT2 Mac support


From: Just van Rossum
Subject: FT2 Mac support
Date: Sat, 26 Feb 2000 12:09:39 +0100

FT2 now compiles and builds nicely with CodeWarrior under MacOS. I'm using
the config files in config/ansi, and that works, except I had to add the
line

FT_DRIVER(psnames_driver_interface)

to ansi/ftmodule.h.

(Doesn't it make more sense to call the driver setup file ftmodules.h? It
lists multiple driver modules after all.)

I've only tried ftlint.c so far, and finishes successfully with both .ttf
and .pfb files. Excellent!

Building was also relatively painless, except I my compiler complained
about truetype.c, but I'm not sure if that's a bug in FT, my mistake or
even a compiler bug... Using the individual source files worked great. Oh,
truetype.c *does* compile if I remove the line

#define FT_MAKE_OPTION_SINGLE_OBJECT

but I can't judge if that is crucial for other setups. Let me know if you
want me to look into this further. For now it seems to works, so I'm happy.

’
I'm now looking into adding some Mac support, which for now should just
consist of support for so called "suitcase" files. These are Mac resource
files which roughly work like this:

- A Mac suitcase file contains one or more FOND resources, one for each
font in the suitcase (this seems a nice analogy to .ttc files, so I think
the face_index argument of FT_New_Face() can be used for this!)

- This FOND resource (among many other things) indicates one of two situations:

1) there is an sfnt resource in the same file. This is a chunk of data
which is 100% equivalent to a .ttf file, so I think this needs to be
wrapped in a stream object and we're all set.

2) there is an accompanying Type 1 font file. The PS name of the font can
be found in the FOND, and a filename for the T1 font can be derived from
that. A Mac T1 font is also a resource file, and contains the T1 data in a
sequence of resources, similar to the chunks inside a .pfb file. So I think
this also just needs to be wrapped in a stream object, and we're all set.

(Actually, there's a third situation: there's no outline font available,
but one or more bitmap sizes. Although I *love* bitmap fonts, I'm not very
much interested in supporting them, though, since it seems quite an
effort...)

I'm not familiar enough with the driver and platform configuration
architecture to know where would be the correct place to implement these
things, so I'd like your advice on that. I guess it could go like this: I
put all supporting code in config/mac, and modify the tt and t1 drivers to
use that code if compiled for MacOS. Hm, I think I also need to patch
FT_New_Face(), since I need to do some checking *before* the stream is
created. Alternatively I could create a new function FT_New_Face_Mac(), but
I'd like to avoid that.

Another issue is kerning for T1. The FOND resource also contains kerning
information, and since AFM files are not used by any Mac app (except font
editors ;-) they are ususally not installed on the system. However, the
kerning info is available in the FOND resource, so I think it makes most
sense to try and fetch it from there by default, as if it's a 'kern' table
of a TT font. Does this make sense?

And now for an actual bug report ;-)

I think line 124 in src/type1/t1afm.c should read

    if ( ACCESS_Frame(stream->size) )
instead of
    if ( !ACCESS_Frame(stream->size) )

Even after that fix I ws unable to attach an afm file: the stream->read
method was NULL so I got an FT_Err_Invalid_Stream_Operation error within
FT_Access_Frame().

No idea how to fix that...

That's all for now,

Just





reply via email to

[Prev in Thread] Current Thread [Next in Thread]