Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. [00:22] <NegativeZero> Hey
  2. [00:23] <Ecumene> o/
  3. [00:23] <NegativeZero> So you're looking to achieve .ttf rendering?
  4. [00:23] <Ecumene> Yeah. You got the stuff?
  5. [00:23] <NegativeZero> in LWJGL?
  6. [00:23] <Ecumene> Yeah, perfect.
  7. [00:24] <Ecumene> How does yours work?
  8. [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
  9. [00:25] <Ecumene> Ah, cool. Do you have the source anywere?
  10. [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
  11. [00:27] <Ecumene> Okay. cool
  12. [00:29] <NegativeZero> So this is what I found to be the hard bit, generating the bufferedimage
  13. [00:29] <NegativeZero> http://pastebin.com/pG90T7w2
  14. [00:30] <NegativeZero> So fontImage is just an image that is used to get the dimensions
  15. [00:30] <NegativeZero> then iamge is the actual iamge generated
  16. [00:31] <Ecumene> FontCharacter, is apart of awt? Right?
  17. [00:31] <Ecumene> a part*
  18. [00:31] <NegativeZero> No, that's just a small class I created for storing UVs and dimensions
  19. [00:32] <Ecumene> So its per-character dimensions and UVs?
  20. [00:32] <NegativeZero> Yeah
  21. [00:32] <NegativeZero> inside the fontcharacter class is also this http://pastebin.com/Zru2Fvk8
  22. [00:32] <NegativeZero> Oh wait no you don't need that
  23. [00:33] <NegativeZero> I ended up not using that
  24. [00:33] <Ecumene> lol
  25. [00:33] <NegativeZero> This thread will help turn the bufferedimage into a texture http://www.java-gaming.org/index.php?topic=25516.0
  26. [00:34] <Ecumene> Hehe, I've got that down. lol
  27. [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
  28. [00:36] <NegativeZero> anyway I need to go to dinner
  29. [00:36] <NegativeZero> I hope that helps
  30. [00:36] <Ecumene> Alright, I think I've got the gist of it. Thanks!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement