Results 1 to 10 of 179

Thread: nxPascal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    I am using freetype2 to create texture maps on the fly. I'm not having any delays so why not just use that ?

  2. #2
    I don't know anything about freetype2. There isn't much of information with google either. I find TFontManager class in fpc, but seems cryptic. Are you really sure it's faster? It might support more font types though. Not all fonts can be drawn to TCanvas. (Also this wouldn't fit in Delphi right?)

    Size 9 "Arial"-font with full character table loading takes, with different texture sizes:
    256 -> 109ms
    512 -> 374ms
    1024 -> 1500ms
    You should always use smallest possible texture size, where characters still fit in. I managed to optimize bitmap loading slightly for fpc, but the numbers were pretty same as before.

    Font saving to bitmap already exists, through setting nxGraph.NX_SaveFontBitmap:=true; , it will save it to 'FontBitmap.bmp' when loaded.
    Attached Images Attached Images

  3. #3
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    I really have no idea whether it is faster, 1500 ms doesn't seem like it is worth worring about. I create one very long bitmap and use it that way but I dont use opengl to render my gui but rather send the final product to opengl. this way it only needs to be redrawn if something changes and because there are so many effects that can be applyed that I could not do in opengl at this time. some day perhaps. anyway the documentation on the freetype2 website is really good and is what I used. I found the fpc solution rather overkill myself. one of the commands was missing from the pascal header so I had to add that in myself.

Bookmarks

Posting Permissions

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