Font Help

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
TheMan
Posts: 10
Joined: Tue Jan 03, 2006 9:29 am

Font Help

Post by TheMan »

Hey, earlier today I was looking into sort of porting over the LUA way of simple png font loading, but I've ran into a few problems. Maybe you guys can help. Currently, it runs, but the font doesn't get displayed.

The font part of the code is here, and the rest is at the rapidshare link.

Code: Select all

int char2Font(char char_input[255]) {
	int indexNumber = 0;
	int i;
	for&#40;i=0;i++;i<=strlen&#40;inputString&#41;&#41; &#123;
		if &#40;stricmp&#40;inputString&#91;i&#93;, char_input&#41;==0&#41; &#123;
			return indexNumber;
		&#125;
		indexNumber = indexNumber + letterPixelsWide;
	&#125;
&#125;

void blitChar&#40;char text&#91;255&#93;, int posX, int posY&#41; &#123;
	blitAlphaImageToScreen&#40;char2Font&#40;text&#41;, 0, letterPixelsWide, letterPixelsTall, font, posX, posY&#41;;
&#125;

void blitString&#40;int posX, int posY, char text&#91;255&#93;&#41; &#123;
	int incX = 0;
	int i;
	strupr&#40;text&#41;;
	for&#40;i=0;i++;i<=strlen&#40;text&#41;&#41; &#123;
		blitChar&#40;text&#91;i&#93;, posX + incX, posY&#41;;
		incX = incX + letterPixelsWide;
	&#125;
&#125;
http://rapidshare.de/files/19803101/Font.zip.html

Thanks!
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: Font Help

Post by Shine »

Post Reply