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

If you’re trying to include YouTube videos or Google maps, in fact anything that uses an IFRAME in your WordPress you’ve probably run into problems. The visual view in WordPress removes the IFRAME code. Well I have a solution for you, use javascript to insert the code. Below is the code I’m using. All you would need to do is change the address in the URI variable and alter the width and height attributes.


Here is the video.

Filed under: Programming — Tags: , , , — admin @ 7:51 pm

Questions

February 15, 2011

If I’ve learned anything from life it’s that though many questions should never be answered, many more should never be asked.

Filed under: Thoughts for the day — admin @ 10:45 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