Kamis, 03 Maret 2011


I recently gave typeface.js a try and I’m addicted. Compatibility (notably with the iPhone), ease of use, lightweight, completely javascript/canvas based are just some of the reasons that make it a promising project.
The flow goes something like this…import the typeface.js javascript file, convert a font you love (and is licensed appropriately!) to a typeface compatible js file using their online utility or downloadable Perl script, and use the font in your CSS definitions!
I did run into one issue, which was using .otf OpenType fonts with their converter. Since .ttf conversion works well, the straighforward solution is to convert the .otf fonts to .ttf fonts and then use them with the online typeface utility.
398268c92626fb4100209a714241890953ee2da6_1231353259_1A5edc6d18db25ffbc59dae4cd5ce09214efad646_1231353259_0
Solution after the jump…

Solution

The best solution I found was to use FontForge

An outline font editor that lets you create your own postscript, truetype, opentype, cid-keyed, multi-master, cff, svg and bitmap (bdf, FON, NFNT) fonts, or edit existing ones. Also lets you convert one format to another.

From the sourceforge page you can build it from source, or if you are on OSX you might as well use the port
sudo port install fontforge
After that you can either write a script to convert your fonts as desired by following the tutorial here or you can run the UI and convert them manually.
cd-mba:~ cdunn$ which fontforge
/opt/local/bin/fontforge
cd-mba:~ cdunn$ fontforge
Copyright (c) 2000-2008 by George Williams.
Executable based on sources from 18:11 GMT 10-Jan-2008.
Library based on sources from 15:11 GMT 9-Jan-2008.
From the UI you can just open the .otf font and select File -> Generate Fontand choose .ttf as the output format.
Now take your new .ttf to the online conversion here and you should be ready to go!
source : www.rubyglob.com

Tidak ada komentar:

Posting Komentar