freetype
[Top][All Lists]
Advanced

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

Re: [ft] freetype+gd with mac fonts?


From: mpsuzuki
Subject: Re: [ft] freetype+gd with mac fonts?
Date: Fri, 4 Jul 2008 23:18:09 +0900

Hi,

# I thank Ryan for giving good guidance.

If you're unfamiliar with font file formats on Mac OS,
please note that FreeType2 does not support some very
very legacy bitmap-only fonts designed for MacOS.

If the font you want to use looks like zero-sized and
you can find some "pairing" data, it might be a suitcase
font which all font data is stored in its resource fork
(something like a metadata stream accessed by xattr()).
So, you have to copy its resource fork to another file
with appropriate pathname. Masatake Yamato had ever
implemented a fallback mechanism to lookup a file including
the contents of resource fork.

On non-Macintosh platform, when a file "XXX" exists but cannot
be opened as normal font file, next FreeType2 tries:

        1. open "XXX" as AppleDouble (including both of data/resource)
        2. open "XXX" as AppleSingle (including both of data/resource)
        3. open "._XXX" (UFS syntax on Mac OS X)
        4. open "XXX/..namedfork/rsrc" (new HFS+ syntax on Mac OS X)
        5. open "XXX/rsrc" (legacy HFS syntax on Mac OS X)
        6. open "resource.frk/XXX" (VFAT syntax of Mac OS)
        7. open ".resource/XXX" (CAP syntax to mount AppleShare volume)
        8. open "%XXX" (Linux syntax to mount HFS volume)
        9. open ".AppleDouble/XXX" (netatalk syntax to mount AppleShare volume)

Maybe, copying the contents of resource fork with the 3rd syntax
(._XXX) would be most easiest way.

Regards,
mpsuzuki

On Fri, 04 Jul 2008 08:40:17 -0400
Aaron Winborn <address@hidden> wrote:

>That probably explains a lot. I'm running this on a linux web server. Is 
>there anything I can do to merge the files into something that can be 
>read by PHP in linux?
>
>Thanks,
>Aaron
>
>Ryan Schmidt wrote:
>>
>> On Jul 3, 2008, at 14:32, Aaron Winborn wrote:
>>
>>> i am attempting to create an image in php with gd, using freetype for 
>>> fonts. i can get it working with a .ttf font, but have the mac 
>>> version of another font that i want to use, and it doesn't load. i 
>>> saw the warning at http://us.php.net/imagettftext about .ttf being 
>>> automatically appended, but i'm prepending the font with a /path/ 
>>> anyway, so it shouldn't matter. just to make sure, i tried the 
>>> putenv('GDFONTPATH=' . realpath('.')); trick and also tried manually 
>>> renaming the font with a .ttf extension, both to no avail.
>>>
>>> i don't know mac's file standards, but i did notice there was a font 
>>> GothBla in one folder, and ._GothBla in Gotham/__MACOSX, so i've 
>>> tried all of this using both files.
>>>
>>> any ideas of what to try next?
>>
>> Are you doing this on a Macintosh or something else? I assume you need 
>> a Mac to do this.
>>
>> Mac files can have two forks -- data and resource. Most every other OS 
>> considers a file to be just data. Old Mac fonts are in the resource 
>> fork however. On filesystems that don't support multiple forks, the 
>> two forks are broken out into two files -- GothBla is the data fork 
>> (probably empty?) and ._GothBla is the resource fork. I assume you 
>> need to combine these together so that you have a proper Mac resource 
>> file.
>>
>>
>>
>>
>> _______________________________________________
>> Freetype mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/freetype
>
>
>
>_______________________________________________
>Freetype mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/freetype




reply via email to

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