freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] FreeType 2.1.3 Mac Carbon **BUG** - Can't open .ttf file wi


From: Wenlin Institute
Subject: Re: [Devel] FreeType 2.1.3 Mac Carbon **BUG** - Can't open .ttf file with path separators
Date: Thu, 13 Feb 2003 09:22:31 -0800

It might be difficult and pointless to try to justify what either
Apple or Metrowerks have done. Evidently they handle path separators
differently. The current ftmac.c works for Apple's Project Builder
(which uses the GNU C Compiler). If it needs modification for
Metrowerks, again I suggest using "defined(__MWERKS__)" for
conditional compilation.

Tom Bishop

At 3:34 PM -0500 2/12/03, Steve Sexton wrote:
fyi, I just got a mail from Leonard on this.  The short version of
my  response, is I disagree that this is a "bug" in CodeWarrior.
Prior to  OS X, / as a path separator makes no sense, since it
depends on a  compatibility layer in the C run time being there.
Which hasn't been  there consistently on Mac compilers.  So for a
Carbon app using / seems  unnatural.  At any rate, and I hope
Leonard agrees with this, I would  suggest that a "good" long term
solution is probably to write code that  supports either : or / as a
path separator.  The current code only  works for /.

I haven't gotten around to trying Project Builder, but I'm a little
curious why it needs this change.  The old code is legal for Carbon,
as  far as I can tell.  Does it give deprecation warnings or
something?

On Wednesday, February 12, 2003, at 02:57  PM, Wenlin Institute wrote:

I suspect the problem Steve reports is an incompatibility between
CodeWarrior and Project Builder, but I haven't used CodeWarrior for
OS X. I do know that the particular #if TARGET_API_MAC_CARBON code he
mentions is necessary for OS X using Project Builder. I therefore
suggest changing it to

#if TARGET_API_MAC_CARBON && ! defined(__MWERKS__)

since __MWERKS__ is only defined for CodeWarrior. Leonard is probably
right that there's a bug in MSL.

Tom Bishop

At 1:50 PM -0500 2/12/03, Leonard Rosenthol wrote:
At 11:30 PM -0500 1/25/03, Steve Sexton wrote:
I just recently started trying to use FreeType 2.1.3, and on the
first test found a bug in the Mac OS Carbon version.  I have a
solution as well.  I'll try to keep this short and sweet:

        Let's see what you've got ;).

In src/base/ftmac.c, at line 90 in function file_spec_from_path:
        change #if TARGET_API_MAC_CARBON to #if 0.  Or better, just
delete the whole "Carbon" part of the #if.  IT DOESN'T WORK.

        That's surprising as it has been working fine for many folks
folks for the last year or so since I first added that code.   Now,
I admit that I haven't tried it with CW8 - but still...

There are three problems with this block of code:
1.  It isn't needed to compile under Carbon.  The #else block works
fine.  You lose support for paths > 255 characters, but that is
likely a necessary evil.

        I am unwilling to accept that as a "necessary evil".  The
code MUST work with ALL possible valid pathnames.

2.  The use of FSPathMakeRef function, per Apple's doc, means that
the library will not work on OS 8.6/9 only OS X, as this call isn't
implemented in OS 8.6/9 Carbon API's, only OS X Carbon API's.

        That is NOT what the headers say:

 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 or later

        Plus, this code HAS been tested on Mac OS 9.x by myself and others.

Note I haven't tried this myself to see if the doc is correct.
Please no flames about supporting OS 8.6/9.

        FT2 fully supports Mac OS 9...

3.  This is the doozy, and why it keeps you from opening a file
with path chars.  FSPathMakeRef requires using / (slash) as the
path separator.

        Correct.  It assumes a Posix path.

However, later on in the code an fopen() is done against the same
string.  fopen, at least with MSL, requires using the : (colon)
path separator.

        That's a bug in the MSL then, since it should (like fopen()
in the standard C lib shipped with Mac OS X) support BOTH as valid
path separators.  And it sounds like a new bug in the MSL, since
this used to work just fine with CWPro7.


Leonard
--
---------------------------------------------------------------------- -----
Leonard Rosenthol                            
<mailto:address@hidden>
                                             <http://www.lazerware.com>

_______________________________________________
Devel mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/devel


--

Wenlin Institute, Inc.        Software for Learning Chinese
E-mail: address@hidden     Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)


--

Wenlin Institute, Inc.        Software for Learning Chinese
E-mail: address@hidden     Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)



reply via email to

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