| View previous topic :: View next topic |
| Author |
Message |
ruspa
Joined: 13 Sep 2007 Posts: 19 Location: Gorizia, ITALY
|
Posted: Fri Sep 14, 2007 9:29 am Post subject: Need to write something: Freetype? .C? ttf? sdl? Raw? O_o |
|
|
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? |
|
| Back to top |
|
 |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Fri Sep 14, 2007 10:09 am Post subject: |
|
|
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:
| Code: | 0123456789ABCDEF +00
0123456789ABCDEF +10
0123456789ABCDEF +20
0123456789ABCDEF +30
0123456789ABCDEF +40
0123456789ABCDEF +50
0123456789ABCDEF +60
0123456789ABCDEF +70
|
|
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Fri Sep 14, 2007 10:57 am Post subject: |
|
|
even then with this info it might not be possible for him :)
so i say what i always say to this question
look at samples/gu/font/ samples/gu/fancytext/
or better yet go learn the background behind APIs like freetype _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
ruspa
Joined: 13 Sep 2007 Posts: 19 Location: Gorizia, ITALY
|
Posted: Fri Sep 14, 2007 12:20 pm Post subject: |
|
|
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! |
|
| Back to top |
|
 |
Smong
Joined: 04 Sep 2007 Posts: 82
|
Posted: Sat Sep 15, 2007 7:17 am Post subject: |
|
|
Last time I looked it was in the samples/gu/text directory. _________________ (+[__]%) |
|
| Back to top |
|
 |
saulotmalo2
Joined: 10 Sep 2007 Posts: 43
|
Posted: Sat Sep 15, 2007 7:45 am Post subject: |
|
|
| i wrote a little open source library for PSP called 3D~GDS it should be on pspupdates.qj.net web. There is the code for rendering fonts on openGL you can add it to your code and start to write on screen ;). |
|
| Back to top |
|
 |
|