Programming for Palm OS/PilRC

PilRC (the PILot Resource Compiler) takes human-readable definitions of User Interface features (example) and turns them into a machine-readable form suitable for feeding to tools such as build-prc.

installing PilRC on Debian
sudo apt-get install pilrc

usage
PilRC reads a .rcp file and produces one or more .bin files. To find out what can be put into a .rcp file:

mozilla file:///usr/share/doc/pilrc/html/manual.html#language

Then invoke PilRC like this:

pilrc -q YourProject.rcp

..and it will produce files named things like:

NFNT03e8.bin MBAR03e8.bin tFRM03e8.bin

..which are fed to build-prc like this:

build-prc $(PROJECT).prc "$(PROJECT)" $(CREATOR_ID) *.$(PROJECT).grc *.bin

fonts
In YourProject.h (so that resource IDs can be kept in sync between the source code and YourProject.rcp):


 * 1) define TinyFont  1000

..then in YourProject.rcp:


 * 1) include "YourProject.h"

FONT ID TinyFont FONTID 128 "6pt-sans-font.txt" <tt>128</tt> is <tt>fntAppCustomBase</tt> and should be in the range 128-255. <tt>6pt-sans-font.txt</tt> refers to a file that describes the font. This file looks like this:

ascent 5 descent 1 glyph 32 --- --- --- --- --- --- glyph 33 -#- -#- -#- --- -#- --- glyph -1



..although your fonts should define more than only two glyphs.

The following Ruby can be used to create a blank font file suitable for consumption by PilRC:

ROWS   = 7 COLUMNS = 6 puts 'ascent %i' % (ROWS - 1) puts 'descent 1' (32..127).each do |index| puts 'glyph %i' % index ROWS.times do   puts '-' * COLUMNS end end
 * 1) !/usr/bin/env ruby