Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: How to get 3D points from true type font?

Hybrid View

  1. #1
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    121

    How to get 3D points from true type font?

    Does anyone know how to get the 3D points (contour of the font) from a true type font? I am currently doing a project that require to convert the true type font into a 3D polyline. Hope someone could show me some hints or any website to get the information regarding to this problem. Thanks.

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    322

    Re: How to get 3D points from true type font?

    If you just want it for text rendering have a look at this.

    http://nehe.gamedev.net/data/lessons....asp?lesson=14

    If not, you'll have to render the character to a monochrome bitmap (freetype can do that for you), do an edge detect (i.e. find the pixels that differ from their neighbours), then turn the edge pixels into vertices and extrude.
    A lot of work, and you'll probably get more vertices than you actually need.

    [EDIT] Or see if you can find the specifications on the truetype format, and then parse the definitions. After all, characters are defined as lines and arcs in TT.

  3. #3
    Member Regular Contributor
    Join Date
    Aug 2003
    Location
    France
    Posts
    299

    Re: How to get 3D points from true type font?

    Freetype handles everything you need for arcs and contour. Still you'll need to extrude from those points by yourself.
    http://www.freetype.org

    You can find an implementation of what you want to achieve here : http://homepages.paradise.net.nz/henryj/code/#FTGL

    And I would not advise doing font rendering as shown in the NeHe example, that is full of bad practices, and completely texture space ineficient.

    SeskaPeel

  4. #4
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    121

    Re: How to get 3D points from true type font?

    Originally posted by SeskaPeel:
    Freetype handles everything you need for arcs and contour. Still you'll need to extrude from those points by yourself.
    http://www.freetype.org

    You can find an implementation of what you want to achieve here : http://homepages.paradise.net.nz/henryj/code/#FTGL

    And I would not advise doing font rendering as shown in the NeHe example, that is full of bad practices, and completely texture space ineficient.

    SeskaPeel
    I agree with you, the font rendering method from the NeHe example is very slow when dealing with a big number of string. Using FreeType is a good idea, but the problem is I develop my project with C# using Tao framework. I don't know how to include the .lib (FreeType) file from visual c++ to C#. Do you have any idea how to do it? Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •