• Advertisement
Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    423252

The Freetype2 cometh!

Sign in to follow this  

107 views

So, after my inital attempts at producing sane freetype2 based text textures (clicky ) I figured I could spend a few minutes trying to fix the problem.

So, I went and studied the Freetype 2 example of producing glyphs with proper kerening once more and noticed a section on 'Managing glyph images' which I had glanced at before but didnt really bother reading it all properly [grin], turns out the answer was there all along.

Freetype2 gives you a bitmap with the image and it also has a field which gives you the distance from its (0,0) point to the left most pixel of the glyph, so a simple addition of that to my destination pixel location and it works perfectly [grin]

Looking at it, I'm wondering if I can reduce it all down to a couple of standard lib. based loops (for_each()), I'm already using one and a functor to copy each glyph's bitmap into the final image and I should be able todo the same trick with the intial glyph generation as the only things which persists outside of the loop are 3 variables and the loop its self is pretty small.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement