I'm trying to figure out how to display some fonts in opengl without writing from scratch (if possible, of course) something that loads a picture with fonts, splits in many tiny imgs, ecc..
I'm getting sick at seeing to all those different methods discussed in the forums, but none of them seem to work to me.
SDL crashes installation (He miss 6/6 programs he needs to ./configure), I saw that installing this "sdl" (whatever it is) package will let me include some new libraries capable of loading ttf.
svn co ...trunk... idem, it won't install. Well, after 1 hour downloading files, he stopped ("Can't move whatsoever, exiting") and this was in order to get FreeType libraries... this mean I don't have them yet.
I tried on my own the way of flib.rar file linked in this forum (used "search" alot) but is completely missing a source file that obiously include in a header. Dead end, again.
I also found some half-threads regarding ".c" fonts, tomorrow I will check again, never heard of a c format for a font.
It is so difficult to display a font in gu context? You guys that already achieved, on your opinion, in wich direction do you suggest me to head to?
Need to write something: Freetype? .C? ttf? sdl? Raw? O_o
A simple way I have used is to have a font sprite, I'm using a 128x128 sprite.
Fill it with characters as shown here:
http://localhost.geek.nz/crap/font.png (black background is just for effect, first line is just to check alignment, yes I'm wasting alot of the sprite)
Then you can easily blit the right characters using some simple maths. (Which I'll leave up to the reader) :-)
Hint: The characters are arranged in ascii character order:
Fill it with characters as shown here:
http://localhost.geek.nz/crap/font.png (black background is just for effect, first line is just to check alignment, yes I'm wasting alot of the sprite)
Then you can easily blit the right characters using some simple maths. (Which I'll leave up to the reader) :-)
Hint: The characters are arranged in ascii character order:
Code: Select all
0123456789ABCDEF +00
0123456789ABCDEF +10
0123456789ABCDEF +20
0123456789ABCDEF +30
0123456789ABCDEF +40
0123456789ABCDEF +50
0123456789ABCDEF +60
0123456789ABCDEF +70
I forgot to mention that the example in the sdk was the first place where I looked... But surprisingly it has some missing libraries and some wrong includes, like:
#include XX_XXX_X
whitout < or " and nothing even similar to the library name mentioned... and as far as I know that must be my version of the toolchain corrupted or something. I should have a look tomorrow to fancytext (here in Italy it's 4.12 AM time to go to bed, shouldn't I?) as I can't remember of a fancytext directory in the examples.. Perhaps I got a sick toolchain (that's could explain why the same toolchain script destroyed my .bashrc in my laptop with kubuntu feisty, all the shell commands disappeared (no more sudo, no more "ls" ecc, "apt-get" neither O__O) after 3 hours downloading packages and the classic "permission denied" at the end. Luky me it was only a wrong path the toolchain changed in the bashrc pointing to usr/bin where the shell commands are)
I think I will pursue the way of doing the tiny split&blits on a image file, coz I like when I do things by myself.
I'll look for a datasheet on how rgb data are spread in a png file.. In case of need I will be tedious and boring to you and ask ask and ask again HAHA!
Good night!
#include XX_XXX_X
whitout < or " and nothing even similar to the library name mentioned... and as far as I know that must be my version of the toolchain corrupted or something. I should have a look tomorrow to fancytext (here in Italy it's 4.12 AM time to go to bed, shouldn't I?) as I can't remember of a fancytext directory in the examples.. Perhaps I got a sick toolchain (that's could explain why the same toolchain script destroyed my .bashrc in my laptop with kubuntu feisty, all the shell commands disappeared (no more sudo, no more "ls" ecc, "apt-get" neither O__O) after 3 hours downloading packages and the classic "permission denied" at the end. Luky me it was only a wrong path the toolchain changed in the bashrc pointing to usr/bin where the shell commands are)
I think I will pursue the way of doing the tiny split&blits on a image file, coz I like when I do things by myself.
I'll look for a datasheet on how rgb data are spread in a png file.. In case of need I will be tedious and boring to you and ask ask and ask again HAHA!
Good night!
-
- Posts: 43
- Joined: Mon Sep 10, 2007 9:32 am