Amiga bitmap fonts are stored as binary load modules. This
makes it easy to convert them to an object module that can
be linked into your code.
USAGE
Font2Obj FONT font/size TO module.o SYMBOL _mydfh NAME data
The FONT parameter is just a filename in FONTS: (can be absolute
too) that refers to an Amiga font bitmap (can also be a bitmap
generated by Intellifont/Fountain).
TO specifies the output file.
SYMBOL is the name of the data structure that you can refer to
in your own code. For C usage it should begin with an underscore.
The default name is _the_font_hunk.
NAME is the name of the hunk. A linker will usually merge all
hunks with the same name into a single block. The default is
__MERGED which is the name of the SAS C near data segment, any
other name requires that you declare the symbol as __far.
EXAMPLE
font2obj garnet/9 TO garnet9.o SYMBOL _garnet9_dfh
When you link with garnet9.o you can refer to the symbol _garnet9_dfh
as:
#include <libraries/diskfont.h>
extern struct DiskFontHeader garnet9_dfh;
struct TextFont *tf = &garnet9_dfh.dfh_TF;
It is possible to select this font with:
SetFont(rp, tf);
Do not call CloseFont on that font as you did not use OpenFont or
OpenDiskFont to access it in the beginning.
BUGS
font2obj does not yet understand all possible Amiga load files
while font bitmaps, in theory, can be arbitrary load files.
To be exact, you can have CODE and DATA hunks (which gets copied
to a DATA hunk) and RELOC32 hunks. The symbol created points to
offset 4 of the first data or code hunk in the font file (which
happens to be a struct DiskFontHeader).
|