Papervision3D: Dynamic TrueType Font Loading


[View Source Code]

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:

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.

If the font file contains more than one font, the first font is loaded.

11 thoughts on “Papervision3D: Dynamic TrueType Font Loading

  1. Pingback: Vectorvision fonts, the easy way « Barcinski & Jeanjean

  2. Felipe Lima

    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

  3. james

    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

  4. ken

    during publish in cs3 when use chinese font (size 3MB)truetype font has error ” over time 15 seconds”

  5. Pingback: Dynamic TrueType Font Loading | Papervision Tutorials

  6. brian

    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?

Comments are closed.