Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have been sent a QuarkXPress document which contains a number of unusual fonts which were also sent to me. The fonts were in a folder named fonts and then it was all zipped up into a single archive containing the document and fonts folder. I believe this was done on a machine running Mac OS X.

I have unzipped the archive, but all of the files in the fonts folder have no size - i.e. they are 0 bytes files. However there is also a _MACOSX folder which has a fonts subfolder. In here I can see all the font files (prefixed with .) and they all have a size, i.e. are not 0 bytes. Presumably these are the actual font files I need but I cannot figure out how to install them on Windows.

I have tried renaming the files to have .ttf and .otf extensions and then installing them but that doesn't seem to work - I just get an "Invalid font file" message.

Any other ideas?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

For some Mac fonts, the font information is stored entirely in the resource fork of the file. On Mac OS X, such fonts look like normal files in Finder, but from tools like ls (and anything else that uses the POSIX layer) these look like zero byte files.

The __MACOSX/._* files from the Zip file are AppleDouble encoded versions of the combination of the resource fork and some extra Finder information from the original files. AppleDouble files are used by Mac OS X when storing files that have a resource fork or Finder info on filesystems that do not support resource forks and Finder info (here Zip is considered a filesystem).

I am not a Windows user and my searches did not turn on any pre-made tools for this. I did find a set of tools that might work. It would be best to run them on a Mac, but they might work on Windows, too.


If you have access to a Mac

  • extract your Zip archive on that Mac (double-click it, do not use the command-line unzip) and
  • use a tool like Fondu to extract the TTF (or whatever) from the resource fork
    • (I just found the fondu, I have never used it before; caveat emptor)

If you do not have access to a Mac, you may still be able to use fondu, but you will need to compile fondu yourself (it looks like it is possible to build it on Linux, so you might also be able to build it in (e.g.) Cygwin). The next problem is that fondu does not seem able to read AppleDouble files, so you will have to find something that can extract the bare resource fork from the AppleDouble encoded ._*file. I am not sure which Windows-specific tools might be able to decode AppleDouble, but the Mac::AppleSingleDouble Perl module can do it:

perl -MMac::AppleSingleDouble -e 'for(@ARGV) {
    $a = new Mac::AppleSingleDouble($_);
    if(open $f, ">", $_.".rsrc") {
        binmode $f;
        print $f $a->get_entry(2);
        close $f;
    }
}'__MACOSX/._Webdings
# now I have a __MACOSX/._Webdings.rsrc file from which fondu can extract Webdings.ttf

If you are familiar with building Unix-oid tools, building fondu should be easy. For the Perl bit, you should be able to use the cpan tool that comes with most installations of Perl (or, if you are familiar with the layout and installation of Perl modules, just download the AppleSingleDouble.pm file and put it in an appropriate place).

share|improve this answer
    
Thanks for your reply. I haven't been able to get to the fonts yet but I appreciate the response and it was most useful. I managed to use fondu to generate a load of .bdf files but then it turns out that these aren't windows compatible either so I'm now hunting down ttf to bdf convertors. Thanks again. Adam –  user23705 Feb 28 '10 at 19:30

The Perl module that Chris Johnsen mentions is excellent - as is his little command line script! I've needed this info myself.

In other news, the t1unmac command in the t1utils package does the exact same font "unmaccing" but has appledouble support built in!

share|improve this answer

The CrossFont utility worked for me. This creates a .otf or other double-click installable font file for Windows.

Include the font folder at the level of the __MACOSX__ folder to ensure the linked files are also included and it will read all the valid font files and list export options on a font by font basis.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.