Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [00:22] <NegativeZero> Hey
- [00:23] <Ecumene> o/
- [00:23] <NegativeZero> So you're looking to achieve .ttf rendering?
- [00:23] <Ecumene> Yeah. You got the stuff?
- [00:23] <NegativeZero> in LWJGL?
- [00:23] <Ecumene> Yeah, perfect.
- [00:24] <Ecumene> How does yours work?
- [00:24] <NegativeZero> Okay so basically you use awt's bufferedimage class to create an image of all the letters of the alphabet, while giving UV coords to each letter
- [00:25] <Ecumene> Ah, cool. Do you have the source anywere?
- [00:26] <NegativeZero> My source wouldn't make a whole lot of sense plus I'm bad at git so it'd take me far too long to figure it out, so i'll give you some tidbits of code and give you the general idea and let you figure the rest out
- [00:27] <Ecumene> Okay. cool
- [00:29] <NegativeZero> So this is what I found to be the hard bit, generating the bufferedimage
- [00:29] <NegativeZero> http://pastebin.com/pG90T7w2
- [00:30] <NegativeZero> So fontImage is just an image that is used to get the dimensions
- [00:30] <NegativeZero> then iamge is the actual iamge generated
- [00:31] <Ecumene> FontCharacter, is apart of awt? Right?
- [00:31] <Ecumene> a part*
- [00:31] <NegativeZero> No, that's just a small class I created for storing UVs and dimensions
- [00:32] <Ecumene> So its per-character dimensions and UVs?
- [00:32] <NegativeZero> Yeah
- [00:32] <NegativeZero> inside the fontcharacter class is also this http://pastebin.com/Zru2Fvk8
- [00:32] <NegativeZero> Oh wait no you don't need that
- [00:33] <NegativeZero> I ended up not using that
- [00:33] <Ecumene> lol
- [00:33] <NegativeZero> This thread will help turn the bufferedimage into a texture http://www.java-gaming.org/index.php?topic=25516.0
- [00:34] <Ecumene> Hehe, I've got that down. lol
- [00:35] <NegativeZero> And then you jsut need a way of parsing through each word to be rendered, getting each UV coords from each letter before rendering them
- [00:36] <NegativeZero> anyway I need to go to dinner
- [00:36] <NegativeZero> I hope that helps
- [00:36] <Ecumene> Alright, I think I've got the gist of it. Thanks!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement