| View previous topic :: View next topic |
| Author |
Message |
DAanDASja
Joined: 14 Oct 2007 Posts: 17
|
Posted: Mon Sep 21, 2009 5:44 am Post subject: [OSLib] .pgf Fonts and Virtual File System |
|
|
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 |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Mon Sep 21, 2009 2:56 pm Post subject: |
|
|
| are you using oslib or oslibmod |
|
| Back to top |
|
 |
DAanDASja
Joined: 14 Oct 2007 Posts: 17
|
Posted: Mon Sep 21, 2009 6:59 pm Post subject: |
|
|
| Both. |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Mon Sep 21, 2009 9:37 pm Post subject: |
|
|
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 |
|
 |
sakya
Joined: 28 Apr 2006 Posts: 190
|
Posted: Mon Sep 21, 2009 9:57 pm Post subject: |
|
|
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 |
|
 |
DAanDASja
Joined: 14 Oct 2007 Posts: 17
|
Posted: Mon Sep 21, 2009 10:13 pm Post subject: |
|
|
| 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 |
|
 |
|