[OSLib] .pgf Fonts and Virtual File System

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

Moderators: cheriff, TyRaNiD

Post Reply
DAanDASja
Posts: 17
Joined: Sun Oct 14, 2007 8:58 am

[OSLib] .pgf Fonts and Virtual File System

Post by DAanDASja »

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: Select all

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: Select all

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: Select all

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
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

are you using oslib or oslibmod
DAanDASja
Posts: 17
Joined: Sun Oct 14, 2007 8:58 am

Post by DAanDASja »

Both.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

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
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Post by sakya »

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
DAanDASja
Posts: 17
Joined: Sun Oct 14, 2007 8:58 am

Post by DAanDASja »

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 =)
Post Reply