forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting lowercase letters into Font.c.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sumasshu



Joined: 04 Aug 2005
Posts: 3

PostPosted: Thu Aug 18, 2005 4:29 pm    Post subject: Getting lowercase letters into Font.c. Reply with quote

I am almost done creating a text input prototype for the PSP based off of the Hello World code, and am running into a problem with the font. I need to be able to display both uppercase and lowercase letters, but the font that's in font.c uses uppercase letters for both the uppercase and lowercase letters. I have been trying to figure out how exactly that file font.c was generated, and trying to figure out exactly how it works.

Does anyone know how the file font.c was created, and how I could get lowercase letters in there?

And more of a programming question, can someone please explain to me how exactly each character in the font is represent by only 8 hexidecimal characters? Hmm... thinking about it more, is it using bitwise operators? One hexidecimal number per line, and then one bit per horizontal pixel? If that's the case, wouldn't that mean that only 4 pixels could be displayed on each line for each character, because there are only 4 bits in the number 16 (or am I completely wrong about that?) Ahhh, the numbers aren't 16, but 64! Which gives us 8 bits! Sweet. I've been trying to figure that out all night. :) (I'll leave that there just in case anyone else is wondering how the font works...)

--Tom 'sumasshu' Oliphant
Back to top
View user's profile Send private message
sumasshu



Joined: 04 Aug 2005
Posts: 3

PostPosted: Fri Aug 19, 2005 2:45 pm    Post subject: Reply with quote

Alright, using a program called FontGen (http://www.8052.com/users/bahrio/fontgen.phtml), I was able to convert some text to hexidecimal and use it in my code. I couldn't get the fonts to be exactly 8 pixels high though, so I had to copy select lines of the letter code and paste it into my font file. There are probably programs that are better suited for doing this (for making the font exactly 8 pixels tall and wide), so if you know of one, be sure to post it here.

My text input prototype is ready to be released. I'll put it up on PSPupdates tomorrow night after work.

--Tom 'sumasshu' Oliphant
Back to top
View user's profile Send private message
PspPet



Joined: 30 Mar 2005
Posts: 210

PostPosted: Sat Aug 20, 2005 1:08 am    Post subject: Reply with quote

(not PSPSDK specific)
> ... I need to be able to display both uppercase and lowercase letters,
FWIW: the WiFi .02 sample includes a modified version of Nem's original "pg.c" code. I replaced the upper-case only font with the classic 8x8 pixel EGA font (see "font_ega.c_" - compatible with the original "font.c")
http://www.aibohack.com/psp/wifitest.htm (notice descenders on "py" of SpyWatch)
http://www.aibohack.com/psp/wifi_sample_002_src.zip (source)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sumasshu



Joined: 04 Aug 2005
Posts: 3

PostPosted: Sat Aug 20, 2005 4:14 pm    Post subject: Reply with quote

Thanks a lot PspPet. That font works great!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group