Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - OpenFontDb

OpenFontDb

A PocketC native palm library offering native forms and assorted utilities

Postby RunningUtes on Tue Jun 22, 2004 7:41 pm

I'm getting an error using OpenFontDb. I have tried to make my own font for using xFONT wich looks ok. Now I'm trying to create the prc with the font using PilRC. My source.rcp contains one line (FONT ID 1000 FONTID 128 "font.txt") and successfully creates the font.prc using PilRC (pilrc -ro source.rcp font.prc). Now that I have the prc, I want to use it with the example code:
Code: Select all
//fontdb
library "PToolboxLib"
int a;
main(){
a=OpenFontDb("font");
alert (a);
if (a>0){
textattr(129,1,0);
text(20,20,"Hello World!");
}}


My alert is reporting -1 which I think means that the OpenFontDb command didn't load the font. Any ideas?
RunningUtes
 
Posts: 20
Joined: Sun May 30, 2004 3:27 am

Postby jstadolnik on Wed Jun 23, 2004 2:23 am

A return code of -1 means that the database could not be found.

When you use the -ro switch with PilRC the generated database appears on the a PalmOS device with exact name you gave it on the command line. In your case, the file name will appear on a device as "font.prc". So if use OpenFontDb("font.prc") it should work for you.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Mikael on Thu Jun 24, 2004 12:32 pm

Following on from the previous post, I've modified a Windows font with xFont (which works fine) which I'm now trying to append.
I've followed the instructions in the pToolbox docs:

First select a font database .pdb file containing the desired font. Use par to extract the fonts in the .pdb file into separate files (e.g. par x fontdb.pdb). Each font in the .pdb will now have its own unique .pdr file.

The trouble is instead of a .pdr file/s I just get a .bin file which is called : NFNT03e8.bin. I've tried both leaving the name unchanged and renaming it to: pNFT03e8.bin and pFNT2310.bin and pFNT0001.bin; all without success.

Why am I getting a different result? Is it because I only have one font in the .pdb? I wouldn't have thought that would have made a difference.

Thanks in advance,

Mikael
Mikael
 
Posts: 156
Joined: Sun Apr 13, 2003 9:19 am
Location: Denmark

Postby jstadolnik on Thu Jun 24, 2004 3:32 pm

Each .bin file is a raw resource itself. Resources go inside .prc files. A .prc contains header/tail information so that the palmOS can identify the file and utilize its contents. A plain .bin file has no such header/tail info.

Use the par "c" switch to create a .prc and the "a" switch to put the .bin files to it. PilRC's -ro switch can also be used to generate a .prc and add the resources to it.

Keep in mind that you can call OpenFontDb on your app's .prc file itself (no need to have a seperate font specific .prc file to include with your final app).

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Mikael on Thu Jun 24, 2004 5:45 pm

Thanks Joe,

I tried what you suggested, then ended up going round in circles. The .bin file mentioned above was one I'd extracted with par from a .prc created with pilrc. I tried again, just with par and got the same results - i.e. no .pdr files - only the single .bin. Then I read the docs again and realised that you were already appending .bin files - what I had to start with! So I re-read the docs and the bit where it says 'the one specified with @dbname' made it all clear.

I'd been using: OpenFontDb("fontdb"), instead of: OpenFontDb("FontDb") all along.

It works fine now.

Mikael
Mikael
 
Posts: 156
Joined: Sun Apr 13, 2003 9:19 am
Location: Denmark

Postby RunningUtes on Mon Jun 28, 2004 10:47 pm

Thanks Joe. It works great now. I used "font.prc" in the OpenFontDb command.
~Michael
RunningUtes
 
Posts: 20
Joined: Sun May 30, 2004 3:27 am


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 0 guests

cron