[Pythonmac-SIG] font file resources

Robin Becker robin at reportlab.com
Tue Dec 16 14:50:14 EST 2003


In article <20031216190213.GG74281 at uiuc.edu>, Nicholas Riley
<njriley at uiuc.edu> writes
>On Tue, Dec 16, 2003 at 06:22:21PM +0000, Robin Becker wrote:
>> A darwin client wishes to pass a TTF file from an embedding application
>> into our python extension. I have made an interface which allows for us
>> to copy the memory image if it is presented correctly. He mentioned that
>> he thinks he will actually get a pointer to something called a resource
>> fork that contains the font. If that is the case can I detect this case
>> from the memory and do the copy from the right place etc?
>

thanks for the pointer. I think the intention is to carry this out in
memory as the application already loads these resources. It might be
possible to use an external program automatically on the development
machine, but the final app will not always be able to write out the
files etc. It might be ok if fondu can be made to write into a stream of
some kind.

>Try using fondu to convert to TTF from a Mac-format resource-fork
>TrueType font:
>
>       <http://fondu.sourceforge.net/>
>
>It's not perfect but it does a reasonably good job.  Resource forks
>are structured binary data and typically accessed by the Mac Resource
>Manager APIs; while it would be possible (and it's been done many
>times before) to parse the resource data directly, it's likely not
>worth your time.  Of course if you're running on a Mac, there are lots
>of Python modules to make your life easier when dealing with
>resources.
>
>The author of fondu also wrote PfaEdit, which has a scriptable mode
>that can be used if the font is one fondu can't handle.
>

-- 
Robin Becker



More information about the Pythonmac-SIG mailing list