Estimated time: 30 minutes.
Further font families are delivered with the Oberon system:
Open the FontEditor panel by executing the command:
The top part of the panel presents a table of 256 buttons, one for each of the 256 8-bit combinations. Buttons are captioned with the corresponding displayable (or printable) character where applicable, and with the corresponding hexadecimal value otherwise. Note that only the buttons 00 to 7F are the standardized ASCII codes. The assignment of the buttons 80 to 96 (special language characters) is a property of Oberon.
Enter the name of one of the Oberon fonts, such as "Syntax12.Scn.Fnt" or "Oberon14.Pr3.Fnt" for a 300 dpi printer font, in the text field gadget below the table and (middle) click on the [Load] button. An implementation limitation makes it impossible to edit 600 dpi printer fonts with this tool. The bitmaps are too big; the 600 dpi fonts delivered with the system were contructed with another tool.
Move the mouse focus onto one of the buttons of the table, and press the middle mouse key to select the corresponding character, which then appears in original size in the white area at the lower right of the panel. Drag on that key and watch how the various characters are previewed in the white area. Release the key when the mouse focus is positioned on the character to edit. A picture viewer is opened to edit the character.
The buttons in the lower part of the panel have the following meaning:
[Load] loads the font specified in the text field above the button. This font replaces the current one, if one is loaded, and it can now be inspected and modified.
[Store] stores the current font in the file named in the text field above the button. Font file names (must) have the following name suffixes:
New Viewer: When this check box is checked, the result of any of the three operations described below is presented in a new picture viewer. If it is not, the result appears in the current viewer.
[Flip H] flips the selection around the median line.
[Flip V] flips the selection around the median line.
[Turn 90] rotates the selection anticlockwise by 90 degrees.
The imaging model of characters defines that a character is contained in a box defined by a set of metric data x, y, w, h and dx, in a system of coordinates represented by the two red orthogonal lines. The origin of the coordinates is called the reference point and the X-axis is called the base line. (x, y) is a vector from the current reference point to the origin of the box. w and h are the width and the height of the box, and dx is the distance to the reference point of the next character on the same base line, that is the abscissa of the blue line.
The metrics of a character can be retrieved by program, as is shown below:
dx, x, y, w, h: INTEGER;
ch := "g";
ch, dx, x, y, w, h, pat);
Out.Int(x, 3), ....
(* Visualizing the values produces,
for the example letter in the example font,
x = 1, y = -3, w = 5, h = 10 and dx = 6 *)
Fonts.height: the minimum distance between lines. This distance is modified when the Vertical offset is modified.
Fonts.minX, Fonts.maxX, Fonts.minY, Fonts.maxY: are the extremal values of the box enclosing all characters when their base points are aligned at (0, 0).
The metrics of a font can be retrieved by program, as is shown below:
F := Fonts.This("Syntax12.Scn.Fnt");
Out.Int(F.height, 3); ...
(* Visualizing the values produces, for the example font,
F.height = 14, F.minX = 0, F.maxX = 13,
F.minY = -4 and F.maxY = 10 *)
This is obtained by using the TextDocs.ChangeOffset command. In that case the distance to the neighbouring lines is not equal to Fonts.height anymore, but is increased.
[-] reduces the size of the character picture. The button may be clicked a maximun of 5 times in succession until the original size is restored, and not beyond.
[Pixel] When Pixel is selected, position the mouse focus on a square of the grid. If the square is white, it changes to black when the middle mouse key is clicked. If it is black, it changes to white. Instead of editing the pattern dot-wise, you may drag on the middle key to process all the dots on a trajectory. If you started on a black square, it and all further dots are changed to white, and conversely. Changes are immediately reflected in the small white area in the panel.
Useful hint: to ease character retouching, make a copy of the viewer first, then magnify either of the two views as required. Whatever is retouched in the zoomed picture will be reflected in the original.
[Metric] When Metric is selected, the colored metric lines can be moved. Position the mouse cursor at the proximity of the line to move, press the middle mouse key, and drag on it in the direction of the line until the line is "captured". From that moment, a vertical line can be moved sideways, or the horizontal line up and down, in discrete intervals of the snapping grid. Release the key when the line is correctly positioned.
The mouse commands otherwise comply with the Oberon standard.
Clicking the right mouse key (anywhere in the viewer) selects the entire picture. The cursor changes to a flat hand and the entire white area is surrounded by a fat frame. Clicking again, deselects the picture and restores the cursor.
Pressing the key and dragging on it, tracks the selection which is delimited by a rubber band rectangle. When the key is released, a fat selection frame is drawn. When copying a selection, the caret may be set in a picture viewer different from the viewer containing the selection.
Moving a picture
Moving the white area in the viewer can be done in two ways. First, select the entire area with a right mouse click, then press the middle mouse key and drag. Second, if the area does not cover the viewer entirely, place the mouse focus outside the area, press the middle mouse key (the cursor changes to a flat hand), and drag. In both cases, when the white area is correctly positioned, release the key.
When editing is completed, close the picture viewer(s) and store the character in the current font.
Note: The Windows .FON file format used to produce the resource is documented in the Microsoft Windows Programmer's Reference, Vol. 4, Chapter 4: Font File Format.