Papervisoin3D’s 3D text is nice, but the font choices are limited unless you want to take the time to implement your own Font3D files. I’ve been working with font parsing for the last month for another project and thought why not create a font parser for Papervision3D?
The TrueType font parsing library came from Alessandro Crugnola. It is part of an ActionScript port of the Java applications typecast. I’m in the process of writing a much leaner font parser that will have support for both TrueType and OpenType fonts.
I did make a small change to the Papervision3D library. Some of the font files do not have a complete character set. This can cause VectorLetter3D to choke.
In org.papervision3d.typography.VectorLetter3D, around line 40 I added:
|
1 2 3 |
if (_font.motifs.hasOwnProperty(_char)) { createVertices(_font.motifs[_char]); } |
To load a TrueType font simply pass the font data as a ByteArray to the static class Font3DLoader and you get a Font3D object back.
|
1 |
var font3D:Font3D = Font3DLoader.load(trueTypeByteArray); |
If the font file contains more than one font, the first font is loaded.

Thanks, nicely done.
Source can be found at http://labs.zavoo.com/content/flex/DynamicFont3D/srcview/index.html
very cool – thanks for sharing
This is wonderful. Thank you!
Great work. This will be very useful!
Pingback: Vectorvision fonts, the easy way « Barcinski & Jeanjean
Hi! Do you know if there is already any way to do this process for OpenType fonts? I’ve noticed the majority of my fonts are OpenType, so I would appreciate a tool to generate a Font3d from an OpenType font file!
Thanks!
Felipe
Hi Felipe,
I currently do not have a way of generating a Font3D file without first converting the font to TrueType.
FontForge can convert OpenType to TrueType.
It is a free, open source, font editing tool that runs on Linux, OS X, and Windows.
Just open the font in FontForge and save it as TrueType.
http://fontforge.sourceforge.net/
You can find instructions for batch converting fonts at: http://www.stuermer.ch/blog/convert-otf-to-ttf-font-on-ubuntu.html
James
during publish in cs3 when use chinese font (size 3MB)truetype font has error ” over time 15 seconds”
Pingback: Dynamic TrueType Font Loading | Papervision Tutorials
thanks, very nice.
But how to use it with embed font?
I have the same question with SAM. Can you help us? I don’t know the detail of TTF, how to draw font on the screen?