GP2X What Ttf Font For The Gp2x?


A_SN

Active Member
Joined
Jun 8, 2006
Messages
899
I'm currently making a proof-of-concept program to test my text input method, the only problem so far is that I can't seem to find in my Windows fonts a font that would display properly at small size on a 320x240 screen.

What I need is a fixed-width font, in a .ttf file. I'm using SDL_ttf, and I wanna get a 80x24 screen out of it or so (not so sure about it because that would mean 4 pixel-wide characters..)
 
Guyfawkes posted on Aug 29 2006 at 09:50 PM said:
give http://www.dafont.com/bitmap.php a try, should be something there to suit your needs.

Thanks but in all the bitmap fonts I coudln't find a suitable fixed-width one. Can't believe how hard it is to find that, really..
 
Last edited by a moderator:
I wouldn't go for TTF for such a small font. I use my "TinyFont.bmp" with this code:

http://daid.mine.nu/pub/TinyFont.bmp
Code:
int DrawText(int X, int Y, const char* Text)
{
	SDL_Rect Src;
	SDL_Rect Dest;
	while(*Text)
	{
		Src.x = ((*Text) & 0xF) * 6;
		Src.y = (((*Text) >> 4) - 2) * 8;
		Src.w = 6;
		Src.h = 8;
		Dest.x = X;
		Dest.y = Y;
		SDL_BlitSurface(Font, &Src, Screen, &Dest);
		Text++;
		X += 6;
	}
	return X;
}

While this font is 6 pixels width, it's readable.

Maybe you can use this font:
http://www.ticalc.org/archives/files/fileinfo/320/32053.html
(It's the smallest I could think off)

(Don't try with the windows 'SmallFont' it makes a 5 pixel width M on 5, and it's no longer readable on 4)
 
Back
Top