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 

PGELua and pge.font.load

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



Joined: 24 Jan 2010
Posts: 4

PostPosted: Sun Jan 24, 2010 6:32 am    Post subject: PGELua and pge.font.load Reply with quote

I've wanted to toy with PSP homebrew for awhile. I've actually taken the time to set up the PSP toolchain more than once, but I lost interest in it halfway. The other day I had the urge to recreate a very simple game that I LOVE (We Want You :official: :forum post:). So today I decided to use LuaPlayer at the suggestion of a friend of mine who used to do a lot of PSP homebrew for some quick and easy development (Lua is awesome). After about an hour of laying the framework for my game in Lua, I made a test and loaded it up on my PSP to find that LuaPlayer doesn't work on my PSP (slim, 5.00 m33-6).

Anyway, after a lot of searching and being annoyed, I decided to use PGELua (after seeing that it actually works).

I've finished converting the majority of my system to use pge and I seem to have hit a snag. I can't seem to get it to load fonts from a subdirectory properly. At the moment I have a list of fonts and their locations in the filesystem, but no matter how I set it up, if the font isn't in the same directory as the PBP it simply doesn't work.

Code:
font_scribble   = "./fonts/Skribble.ttf"
...
s_font = pge.font.load(font_scribble, 12)
...


This is an example of exactly what I'm doing. I've reordered the location every which way I know how. "/fonts/", "fonts/", etc... I've also renamed the folder, and double checked that everything is in its proper place. Just moving the font to the same directory as the PBP and referencing it as just "Skribble.ttf" works perfectly.

Does anyone know why this might be happening?
Any suggestions would be appreciated.

edit: woops. I see there's a PSP LuaPlayer section.


Last edited by nimblejack on Sun Jan 24, 2010 6:52 am; edited 1 time in total
Back to top
View user's profile Send private message
WosRet



Joined: 23 Apr 2008
Posts: 15
Location: Confoederatio Helveticae

PostPosted: Sun Jan 24, 2010 6:39 am    Post subject: Reply with quote

hmmm... how about using an absolute path like: "ms0:/PSP/GAME/whatever/fonts/Skribble.ttf" ?
Back to top
View user's profile Send private message
nimblejack



Joined: 24 Jan 2010
Posts: 4

PostPosted: Sun Jan 24, 2010 6:48 am    Post subject: Reply with quote

WosRet wrote:
hmmm... how about using an absolute path like: "ms0:/PSP/GAME/whatever/fonts/Skribble.ttf" ?


I considered that, but I reaaaaaaally would like not to, considering the folder could be moved anywhere.
I'd really prefer not to force something like that.

I haven't tested it though.
Back to top
View user's profile Send private message
WosRet



Joined: 23 Apr 2008
Posts: 15
Location: Confoederatio Helveticae

PostPosted: Sun Jan 24, 2010 7:04 am    Post subject: Reply with quote

i don't know lua much, but exist a command like pwd -print working directory- ? then use that as preference? ... reference. sorry for my english....

edit: btw, is there an existing source code for pge lua?
Back to top
View user's profile Send private message
nimblejack



Joined: 24 Jan 2010
Posts: 4

PostPosted: Sun Jan 24, 2010 7:30 am    Post subject: Reply with quote

WosRet wrote:
i don't know lua much, but exist a command like pwd -print working directory- ? then use that as preference? ... reference. sorry for my english....

edit: btw, is there an existing source code for pge lua?


You sir are a genius.

Unfortunately, pge.dir.getcwd() returns the proper location (ms0:/PSP/GAME/<game_dir>).
pge.file.exists("/fonts/etc...") is returning false nonetheless.
edit: I'm gonna try pge.file.exists(pge.dir.getcwd() .. "/fonts/etc...").

Quite frustrating.

Also, I have no clue if there's a public source code available.
Back to top
View user's profile Send private message
WosRet



Joined: 23 Apr 2008
Posts: 15
Location: Confoederatio Helveticae

PostPosted: Sun Jan 24, 2010 7:35 am    Post subject: Reply with quote

nimblejack wrote:
You sir are a genius.

oh... thanks by the way. :) (looking for problem by it's easiest way...) don't know, but it's a simple bug in your code, or a simple bug in pge lua code.

edit: english is not really my native language...
edit2: looking in the samples dir didn't really help much yet....
edit3: perhaps defining path as local var like: local path = "/fonts" then using pge.dir.chdir(path), and then loading the .ttf?
Back to top
View user's profile Send private message
nimblejack



Joined: 24 Jan 2010
Posts: 4

PostPosted: Sun Jan 24, 2010 8:16 am    Post subject: Reply with quote

Alright, I think it might have something to do with the fonts I'm trying to use.
I just did some tests loading multiple fonts, and it would report errors loading some, but not others.
All of them are truetype fonts, but for some reason some of them just don't "work."
Will test more and report back.
Back to top
View user's profile Send private message
WosRet



Joined: 23 Apr 2008
Posts: 15
Location: Confoederatio Helveticae

PostPosted: Sun Jan 24, 2010 8:39 am    Post subject: Reply with quote

nimblejack wrote:
... loading some, but not others.

yeah, it's perhaps a version issue...
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