freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] proposal to split ftmac.c for MacOSX and for classic MacOS


From: mpsuzuki
Subject: [ft-devel] proposal to split ftmac.c for MacOSX and for classic MacOS
Date: Thu, 7 Dec 2006 09:10:18 +0900

Dear Sirs,

As I've ever posted a few posts about Mac-specific
functions in src/base/ftmac.c [1][2], I'm planning
of rewrite most part in ftmac.c by POSIX C, to
reduce explicit dependency with proprietary framework
(like Carbon framework). I don't think the current
location "src/base/ftmac.c" is appropriate to store
strongly system dependent source.

Unfortunately, the rewrite by POSIX won't work well
on classic Mac OS, because of the different method to
access resource fork.

For gradual migration, I propose to separate ftmac.c for
Mac OS X and classic Mac OS. ftmac.c for Mac OS X will
be located in src/base/ftmac.c and will be rewritten,
but ftmac.c for classic Mac OS will be located in
builds/mac/ftmac.c and be kept as it is now.

In fact, current ftmac.c is very complexed to support
all Mac OS by single file. You can find many cpp conditionals
like '#ifdef HAVE_FSSPEC...' in ftmac.c. It's difficult
for new developers (focuses Mac OS X only) to guess which
conditionals is true. By splitting ftmac.c for Mac OS X
and classic, the visibility of src/base/ftmac.c will be
much improved.

There might be a problem: the split store duplicated sources
into 2 directories (src/base/ftmac.c & builds/mac/ftmac.c).
But, I will merge src/base/ftmac.c into ftrfrk.c in future,
so there won't be the duplicated maintainance cost.

I attached a patch to split ftmac.c to do:

* Add cpp-macros to block (yes, blocking, not warning) deprecated functions.
* "src/base/ftmac.c" is simplified to support Mac OS X only.
* Move original 'wildcard' ftmac.c to "builds/mac/ftmac.c"
* MPW makefiles in builds/mac/ftmac.c are fixed to use "builds/mac/ftmac.c"
* configure.raw, ftconfig.in, ftmac.h are fixed to check framework
  availability correctly, to work with ppc64 architecture
  which Apple don't provide Carbon framework.

You can find src/base/ftmac.c in patched version is well
simplified.


Also I provide the tarball which is ready to "configure && make" at:
        http://www.gyve.org/mpsuzuki/freetype2-20061205a.tar.gz
        http://www.gyve.org/mpsuzuki/ft2demos-20061205a.tar.gz

Werner, how do you think of?

Regards,
mpsuzuki


References
----------

[1] "improve Carbon-free MacOS font support"
http://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00025.html

[2] "how to forbid to link public-but-unrecommended function in 
libfreetype.dylib?"
http://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00029.html


Attachment: freetype2-splitmacosx.patch
Description: Binary data

Attachment: ft2demos-splitmacosx.patch
Description: Binary data


reply via email to

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