MyQJ | QJ.NET | Apple | Mobile | Science | MMORPG | Nintendo DS | Wii | World of Warcraft | PlayStation 3 | PSP | XBOX 360 | Gadgets | PC Gaming | Age of Conan | DL.QJ | QJ.NET Forums
Home :: XML Feed :: Files :: Forums :: Bookmark site :: Terms of use :: Privacy policy :: Submit News :: Advertise :: Contact us


Go Back   QJ.NET Forums > All QJ Forums > Gaming Forums > QJ.NET Sony PSP Forums > PSP Development, Hacks, and Homebrew > PSP Development Forum
Register FAQ+ Become Premium Members List Mark Forums Read Log Out

Reply
 
Thread Tools
Hey Guest!
Not Registered? Join today!

Registration allows you too:

Post on our Forums.

Take part in games and registered user benefits!

Get rid of this ad....
Old 12-03-2007, 10:08 AM   #1
BenHur
Neophyte


Join Date: Aug 2006
Posts: 12
Default [RELEASE] intraFont 0.22 - with S-JIS support

intraFont 0.22 is out, it has a couple of fixes and optimizations and two new features:

1. S-JIS string parsing for developers using Japanese
2. ASCII characters caching (for those who need only the standard character set, but want to save on memory and loadtime)

More details in the readme.

Cheers, BenHur
BenHur no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-03-2007, 10:19 AM   #2
Coolj
Avada Kedavra


Join Date: May 2007
Location: Spain
Posts: 619
   
Default

Great :D
Coolj está en línea   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-04-2007, 12:18 PM   #3
transce08
Elite
 
transce08's Avatar


Join Date: Jan 2007
Location: Transcendence
Posts: 291
   
Default

That's hot.


For other devs, here are a couple functions that are handy if you want a simple method to write one string or integer at a time.

Edit: change the size of the array as needed.

Spoiler for custom intraFont functions:

Code:
//print text to screen using font 
void printFontScreen(int x, int y, char* display, intraFont* font){
	guStart();
	intraFontPrint(font, x, y, display);
	sceGuTexMode(GU_PSM_8888, 0, 0, 0);
	sceGuFinish();
	sceGuSync(0,0);
}//end printFont 

//print int to screen using font
void printFontScreen(int x, int y, int i, intraFont* font){
	guStart();
	char number[5];
	snprintf(number, sizeof(number), "%i", i);	
	intraFontPrint(font, x, y, number);
	sceGuTexMode(GU_PSM_8888, 0, 0, 0);
	sceGuFinish();
	sceGuSync(0,0);
}//end printFont
__________________
Author: Magic PSP Station, VideopSpy, JaPSPanese, PSP Submenu Icon Injector (outdated), ...
YouTube PSP News: May 2008, April, March, Feb, Jan, Dec, Nov, ...

Last edited by transce08; 12-04-2007 at 01:11 PM.
transce08 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-04-2007, 12:57 PM   #4
Raphael
Developer
 
Raphael's Avatar


Join Date: Jan 2006
Location: Germany
Posts: 858
Default

Code:
char number[5];
snprintf(number, sizeof(number), "%i", i);
What if someone tries to print a number with more than 4 digits?
Apart from that, it's ugly graphics.c style (ab)usage of sceGuSync() which just wastes CPU cycles like hell.
__________________
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
Raphael no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-04-2007, 01:10 PM   #5
transce08
Elite
 
transce08's Avatar


Join Date: Jan 2007
Location: Transcendence
Posts: 291
   
Default

Quote:
Originally Posted by Raphael
What if someone tries to print a number with more than 4 digits?
Obviously, they change the size of the array. I thought the code was transparent enough that it didn't require explanation. And yes, it's inefficient for large amounts of text but it is beginner-friendly.


Edit: About the sceGuSync(), I couldn't remember why I had put it there at first but now I remember that without that line, you end up getting graphical errors and you get distorted characters showing up on random parts of the screen.
__________________
Author: Magic PSP Station, VideopSpy, JaPSPanese, PSP Submenu Icon Injector (outdated), ...
YouTube PSP News: May 2008, April, March, Feb, Jan, Dec, Nov, ...

Last edited by transce08; 12-04-2007 at 01:56 PM.
transce08 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-04-2007, 01:11 PM   #6
Mr305
Developer
 
Mr305's Avatar


Join Date: Nov 2006
Posts: 1,148
Default

Cool. Academika suite will rock with this...
Mr305 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-11-2007, 06:10 PM   #7
Art
Bush Programmer
 
Art's Avatar


Join Date: Nov 2005
Posts: 3,023
Default

Hi,
It appears if you go over a certain size, the colour information is ignored.
is this a bug, or am I doing something wrong?

ie. This prints GREEN:
Code:
        intraFontSetStyle(ltn[8], 1.0f,GREEN,BLACK,0);
	intraFontPrint(ltn[8], 180, y, "Hello World!");
This prints the right text with the previously defined colours
Code:
        intraFontSetStyle(ltn[4], 1.0f,GREEN,BLACK,0);
	intraFontPrint(ltn[4], 180, y, "Hello World!");
Cheers, Art.
Art no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-12-2007, 01:05 AM   #8
Xsjado7
Developer
 
Xsjado7's Avatar


Join Date: Aug 2007
Location: Australia
Posts: 587
Default

this looks mad
Xsjado7 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-12-2007, 06:54 AM   #9
BenHur
Neophyte


Join Date: Aug 2006
Posts: 12
Default

Quote:
Originally Posted by Art
It appears if you go over a certain size, the colour information is ignored.
is this a bug, or am I doing something wrong?
The sample does excactly what it's supposed to.

Probably you don't understand the way intraFont works:
ltn[4] and ltn[8] are not different sizes of the same font, but two independent fonts: in the fonttest example ltn is only an array holding all 16 ltn*.pgf (latin) fonts (large/small, w/without serif, regular/italic/bold).
intraFontSetStyle sets the style of ONE font: the one you feed the the function (either ltn[4] or ltn[8])
intraFontPrint prints using the selected font (either ltn[4] or ltn[8])

my suggestion: study intraFont.h and the sample properly or forget about it until there's a noob-proof version of it (no offence).

Cheers, BenHur
BenHur no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-12-2007, 06:06 PM   #10
Art
Bush Programmer
 
Art's Avatar


Join Date: Nov 2005
Posts: 3,023
Default

Fair enough, I'll wait for the noob friendly version.

Meanwhile, since I haven't seen any demo made with it,
It would be good to see the source if anyone does do a real time demo
with scrolltext, or anything dynamic like that.
Perhaps then it will be easier to see how it's handled.
Art no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post