If you’re like me and have designers handing you wonderful looking designs to build, then you’ve probably encountered the situation where they’ve used an Apple font with no true type font available. I’ve scoured the internet looking for useful tools and methods to convert from one to the other. I’ve compiled the ones I use below.

You’ll need a linux box for most of these although you could try cygwin.

Convert Postscript Type 1 font to TTF

This is the first part of a two step procedure. T1unmac can convert postscript type 1 fonts to pfb files. If you’re scratching you’re head the PS1 fonts are usually name “._FontName” (they’re probably hidden so you’ll need to “show hidden files”). The command words like this

t1unmac --appledouble ._FontName > FontName.pfb

This will return a .pfb file that you can use in the next step.

The next step is to use FontForge to convert to .pfb file into a True Type Font. Save the code before as convert.pe I can’t take credit for the script I found it on the FontForge website.

#!/usr/local/bin/fontforge
i=1
format=".ttf"
while ( i<$argc )
  if ( $argv[i]=="-format" || $argv[i]=="--format" )
    i=i+1
    if ( i<$argc )
      format = $argv[i]
      if ( format!=".ttf" && format!=".otf" && \
	  format!=".pfb" && format!=".svg" )
	Error( "Expected one of '.ttf', '.otf', '.pfb' or '.svg' for format" )
      endif
    endif
  else
    Open($argv[i])
    if ( $order==2 && (format==".otf" || format==".pfb" ))
      SetFontOrder(3)
      SelectAll()
      Simplify(128+32+8,1.5)
      ScaleToEm(1000)
    elseif ( $order==3 && format==".ttf" )
      ScaleToEm(2048)
      RoundToInt()
    endif
    Generate($argv[i]:r + format)
  endif
  i = i+1
endloop

You use the script like this

convert.pe --format ".ttf" *.pfb

This will find all files that end .pfb and convert them to .ttf files. The script can also output .svg and .otf.

Split a .dfont file

Another type of Apple font archive you could've encountered is a dfont file. These files can be split into their components (usually .ttf files) using the command fondu. The command you use for this is.

fondu FontName.dfont

This will output the content into the current folder.

Filed under: Programming — Tags: , , , , , , , — admin @ 8:23 pm

About me

Jonathan Spicer

My CV

My curriculum vitae and a wealth of other facts about me.

Warhammer Quest tools

Flickering flame effect Flickering flame effect Flickering flame effect

Powered by WordPress