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 

[OSLib] .pgf Fonts and Virtual File System

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



Joined: 14 Oct 2007
Posts: 17

PostPosted: Mon Sep 21, 2009 5:44 am    Post subject: [OSLib] .pgf Fonts and Virtual File System Reply with quote

Hey guys

I'm using .pgf fonts in my Homebrew. My problem is that they don't work when I use them with the Virtual File System.

Here's what I've done so far:
- Created a C structure of my .pgf file using bin2c and included the code to my source which looks like this:
Code:

const unsigned char font_data[41793]={0x4f,0x53,0x4c,0x46,0x6f,0x6e,0x74,0x20,0x76,0x30,0x31,0x00,0x01,...}

- Set up a virtual file system:
Code:

void setUpVirtualFileMenu(void)
{
     OSL_VIRTUALFILENAME ram_files[] =  {
                         {"ram:/font.pgf", (void*) font_data, sizeof(font_data), &VF_MEMORY}
                         };
     oslAddVirtualFileList(ram_files, oslNumberof(ram_files));
}

- Put this function (setUpVirtualFileMenu();) before loading the font with the following code:
Code:

OSL_FONT* font = oslLoadFontFile("ram:/font.pgf");


The code should be right because it's working with .oft font files. But when I do this with .pgf files, the PSP freezes at the last point (oslLoadFontFile).
By the way, when I load .pgf fonts directly without putting them into RAM it's working, but that's not my intention.

Does someone have any idea what the reason could be?

Thanks in advance,
DAan
Back to top
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Mon Sep 21, 2009 2:56 pm    Post subject: Reply with quote

are you using oslib or oslibmod
Back to top
View user's profile Send private message MSN Messenger
DAanDASja



Joined: 14 Oct 2007
Posts: 17

PostPosted: Mon Sep 21, 2009 6:59 pm    Post subject: Reply with quote

Both.
Back to top
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Mon Sep 21, 2009 9:37 pm    Post subject: Reply with quote

how are you using both? you should be using one or the other because oslibmod is oslib with mods hence the name.

if you are using oslibmod then your problem probably exist with sakya's modification. he/she doesn't always include the virtual filesystem implementation when doing stuff like font or jpeg images. ask him/her to fix it or look at the source and try to fix it yourself. shouldn't be to hard
Back to top
View user's profile Send private message MSN Messenger
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Mon Sep 21, 2009 9:57 pm    Post subject: Reply with quote

Hi! :)

coolkehon wrote:
he/she doesn't always include the virtual filesystem implementation when doing stuff like font or jpeg images.

You're right, I didn't modify intraFontLoad to include the virtual filesystem. :P
I'll have a look at it...

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
DAanDASja



Joined: 14 Oct 2007
Posts: 17

PostPosted: Mon Sep 21, 2009 10:13 pm    Post subject: Reply with quote

sakya wrote:
Hi! :)

coolkehon wrote:
he/she doesn't always include the virtual filesystem implementation when doing stuff like font or jpeg images.

You're right, I didn't modify intraFontLoad to include the virtual filesystem. :P
I'll have a look at it...

Ciaooo
Sakya


Wow, Sakya himself! I feel honored^^

It would be great if you fix that asap.

Thanks =)
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