Results 1 to 5 of 5

Thread: FCL-Image/FreeType

  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45

    FCL-Image/FreeType

    I have found two issues with FPC and FreeTypes' docs: FPC's docs seem to work but don't really give much information about how to do squat else (http://wiki.lazarus.freepascal.org/fcl-image near the bottom) and FreeType's documentation is written in C (this is OK, I can read C/C++ fine thank god ) but does not work with the fcl-image FreeType header since it would seem they are different versions. This is clear from line 1 where you cannot initialize FreeType (http://www.freetype.org/freetype2/do...ial/step1.html).

    Their other tutorials use an 'OGLFT' which is not supplied by default with FPC and is a little restrictive so is not really what I would like to use. So all in all, does anyone have some more or less functional/up to date code that does the following:

    Load a TTF file into a variable of some kind
    Render strings in specified colours of that font to an OpenGl Texture or similar? C/C++ and other mainstream languages are fine and I'll post my pascal equivalent once I'm done. Frankly, if this loads/draws TTF text nicely faster than sdl_ttf (hard not to I shoudl think) I'd be happy...

    Oh, and I am aware that PGD is slow as sh.. at the moment so I'm not expecting many/any replies until the hosting company figure this one out...
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    I don't think you should expect much of a performance gain by using Freetype directly because SDL_ttf uses FreeType internally.
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    So you'd have to make your own TTF processor to get better performance? Any thoughts on complexity?

    Either way, it would be good to not have to rely on the bulk of SDL to get fonts working nicely... So any code really is welcome here.
    Last edited by code_glitch; 15-05-2011 at 08:15 AM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  4. #4
    Did you know that freetype was written in pascal originally: http://www.google.com/codesearch/p?h...ype/pascal/lib
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  5. #5
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Actually I didn't... Their 'official' site says it was written in C/C++ and FPC says it uses a wrapper...

    But some of that code looks very interesting I see some potential for partially integrating that code with my Libs to make a more lightweight FreeType implementation... Interesting indeed. Of course I'll give credit where it is due but that is a very nice find.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

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
  •