Previous Next Contents

2. Using the UFL and Font Maintenance Libraries

2.1 Library Numbering

Each UFL library is assigned a "level" that indicates which fonts it contains. If we assign one bit for each font, we can come up with a binary representation as follows:

MSB   8 4 2 1  LSB
      . . x y
          ^ ^
       FNT2 FNT1

Using this scheme, we see that a library with only FNT1 would be assigned level # 01b (1), a library with only FNT2 would be assigned level # 10b (2), and a library with both FNT1 and FNT2 would be assigned level # 11b (3). Notice that with this numbering convention, if an addition FNT3 is ever added, the numbering of the existing libraries would remain unchanged.

2.2 Libraries in this Package

Using the decimal levels for FNT1 and FNT2 we see there are currently three UFL libraries, as follows:

All UFL libraries have the same library number of 257 (# 101h).

You only need to load one of these libraries on your calculator. Which particular one you need will depend on what applications you use that require the UFL. See the documentation that came with the programs you are using to determine whether you need FNT1, FNT2, or both. If you are getting lots of "Font not Found" errors, most likely you do not have the correct UFL level loaded on your calculator.

There is only one Font Maintenance Library (FMnt) and it is in the file `fmnt.lib'. It has library number 258 (# 102h).

You only need to load the FMnt library if you wish to check the status of your UFL or if you want to edit or recall the fonts in it. If you are satisfied with the fonts that come with the UFL, you do not need the FMnt library. However, if you decide to change the fonts, you are free to purge the FMnt library once you have edited the fonts to your liking.

2.3 To Install a Library

  1. Download it into a variable of the calc.
  2. Place the library on the stack.
  3. Type the number of the port in which you want to store the library in. 0 is appropriate if you do not have any expansion cards.
  4. Press STO to store the library in that port.
  5. Turn the calculator off and then on, or press ON-C, to finish installation of the library.

Sometimes you have to purge the variable containing the library before storing it in a port, if you are low on memory.

2.4 To Delete a Library

Say you have library 257 in port 0 that you want to delete.

  1. Go to the directory to which the library is attached. In most cases this will be HOME.
  2. Enter :0: 257
  3. Press [ENTER] or type DUP
  4. Type DETACH
  5. Type PURGE

2.5 UFL Commands

FNT

Usage: ( size -> fnt )

FNT is the user interface to the UFL's fonts. It takes the size of desired font and recalls the font as a library data object if it exists. The size should be a real number or system binary. Indexing is one relative so 1 corresponds to FNT1 and 2 corresponds to FNT2.

Will error with "Font not Found" if the level of UFL you are using does not contain the requested font.

Remaining Access Routines

The remaining access routines in the UFL are hidden from the library menu as a means of encapsulation, and to protect the general user from routines that do not perform argument checking. The interface to these is given in detail for System RPL programmers in the "System RPL Specifications" section of this document.

2.6 FMnt Commands

FSTAT

FSTAT shows a simple screen that allows you check the status of your UFL library. The information shown includes yes or no answers for the following:

Whether FNT1 or FNT2 is present will depend on what level of UFL you have installed. In order for the fonts to be editable the UFL must be in port 0 or an uncovered RAM card (0/1/2 on SX, 0/1 on GX). If the UFL is on a RAM card it must be unlocked for the fonts to be editable.

sFED

Usage: ( grob -> grob )

sFED is a FNT1 editor designed for the FMnt library. It takes a 128 x 48 FNT1 grob, allows you to edit it, and leaves the edited grob on the stack. You can use F1-> to provide your current FNT1 as the initial input to sFED. Once you are done you can update your UFL library by using the output of sFED as input to ->F1 (see below). For a G/GX FNT2 editor, see the README in the `contrib' directory.

sFED will error under the following conditions:

Usage instructions for sFED:

Main Screen:

Edit or [ENTER]

Edit the currently highlighted character.

Quit or [ON]

Quit sFED. If you made any changes, you will be prompted if you want to save your changes upon exit.

About

About information

Edit Screen:

Dot+

Continuous draw

Dot-

Continous erase

[+/-]

Toggle "pixel"

Abort or [ON]

Abort any changes made to the character

Keep or [ENTER]

Keep all changes made to the character

->F1

Usage: ( grob -> )

Takes a 128 x 48 grob and changes FNT1. Modifies the UFL library with the new FNT1 if it is in an accessible port. Will error under the following conditions:

The original FNT1 is stored in the file `fnt1.zip' as `ufl1.fnt'.

F1->

Usage: ( -> grob )

Returns the current FNT1 as a 128 x 48 grob. This output can be edited to taste and then used as input to the ->F1 command. The output of F1-> can be used as input to sFED. Will error under the following conditions:

->F2

Usage: ( grob -> )

Takes a 192 x 64 or 6,7,8 x 2048 grob and changes FNT2. Modifies the UFL library with the new FNT2 if it is in an accessible port. Will error under the following conditions:

The original FNT2 is stored in the file `fnt2.zip' as `ufl2.fnt'.

F2->

Usage: ( -> grob )

Returns the current FNT2 as a 192 x 64 grob. This output can be edited to taste and then used as input to the ->F2 command. Will error under the following conditions:

2.7 List of Possible Errors

There are several errors that can occur with the above commands due to non-existence of the UFL, the combinations of fonts, and locking of RAM cards. The possible errors are:

UFL not Found

You have either not installed the UFL library, or not installed a valid UFL library. Install an appropriate level of the UFL as described above for the programs you are using.

Font not Found

The specific font required by the program you executed was not found in the UFL you have installed. You need to determine what font is missing and install a different level of the UFL that contains it.

Cannot edit UFL

You tried to modify one of the fonts with the UFL installed in a locked or covered port. In order for the fonts to be editable the UFL must be in port 0 or an uncovered RAM card (0/1/2 on SX, 0/1 on GX). If the UFL is on a RAM card it must be unlocked for the fonts to be editable.

G/GX Only

You cannot use this binary on an S/SX machine. The only place this should occur is in the contributed FNT2 editor, FED.


Previous Next Contents