freetype
[Top][All Lists]
Advanced

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

Re: [ft] Carbon-free fonts support for Mac OS X 10.5 (Leopard) compatibi


From: Dipsy Po
Subject: Re: [ft] Carbon-free fonts support for Mac OS X 10.5 (Leopard) compatibility
Date: Tue, 6 Nov 2007 02:48:09 -0800 (PST)

Hi, 


suzuki toshiya wrote:
> 
> The removal of QuickDraw and FSSpec API has been warned for
> a long time, Sean McBride and me were working on this issue.
> But I (at least) didn't expect that Carbon (I guess, you mean
> not only really-legacy Carbon APIs for QuickDraw and FSSpec
> but also ATS and FSRef etc etc, right?) itself is classified
> as dangerous API under forked process. Oops.
> 
> In fact, Masatake Yamato had ever written the initial code to
> support .dfont & suitcase font formats by POSIX functions only.
> You can find src/base/ftrfork.c and bits in src/base/ftobjs.c.
> But, the behaviour is not completely same with that by ftmac.c.
> Some APIs in ftmac.c are not covered.
> 
> Could you tell me which API in ftmac.c should be kept when
> Carbon dependency is removed, for your purpose?
> 

>From my testing, any code that uses Carbon (and in fact "CoreFoundation")
may fail in a forked process. I have tried the ATS and FSRef code in ftmac.c
as well, and they cause the same error "The process has forked and you
cannot use this CoreFoundation functionality safely."

I have tested with the dfont code in ftobjs.c, and it does work normally for
dfont fonts. (In my previous message, I mentioned it only loads the first
font in a dfont file. I found that it is caused by a bug in the winfnt
driver, because the winfnt driver intercepts the request before the dfont
code. Once I disable the winfnt driver, it works fine.)

The issues we have are:

(a) The POSIX code in ftobjs.c only handles "data fork suitcase fonts"
(.dfont), such as "Helvetica.dfont", but not the more important "resource
fork suitcase fonts", like Arial, Times New Roman, Courier New, etc.. 

I am not sure if it is possible to read "resource fork" with POSIX API at
all. It may need to use some lower level system calls to get the "resource
fork" of a file. If this is possible, then implementing "resource fork"
support can solve the problem.

(b) The ftmac.c currently has a function to map the "logical font name" to a
font file + face index. I believe there is no way to duplicate this feature
without using Carbon, as it requires access to the Mac OS Font Manager. But
I think giving up this feature is OK for forked applications, as this
feature (mapping logical font name to font file) does not exist on Windows
or any other OS as well.

So I think the only step that needs to do is to implement "resource fork
suitcase font" support in ftobjs.c. 

Regards
Dipsy Po
-- 
View this message in context: 
http://www.nabble.com/Carbon-free-fonts-support-for-Mac-OS-X-10.5-%28Leopard%29-compatibility-tf4749381.html#a13604292
Sent from the Freetype - User mailing list archive at Nabble.com.





reply via email to

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