The VARKON Font Editor

IMPORTANT NOTE: This section is not complete. These are just rough notes.

Note also that a discussion of the VARKON font editor doesn't really belong in this Notebook on the Hershey glyphs, as the VARKON fonts here are derived from the Hershey glyph data, not created using the VARKON font editor. I didn't want to lose this information, though, and I didn't have anyplace else to put it.

Contents

  1. Enabling the Font Editor
  2. The Font Editor Menus
  3. Starting a Font Project

1 - Enabling the Font Editor

The Font Editor is present in stock VARKON, but its access through the menu system is commented out. Here's how I enabled it using the English menus (thanks to Dr. Kjellander for his advice on this).

cd $VARKON_ROOT/mdf/english 

Edit "menus.INC"

To enable the font editor menu, go to "m23" ("TEXT") and uncomment the "font-editor" line. Change the position of the menu's closing semicolon as well. So this original (VARKON 1.17D):

m23 = "TEXT"
      "left",f50
      "right",M113
      "centre   ",M114
      "2 positions",M115;
!      "font-editor",m93;

becomes this:

m23 = "TEXT" 
      "left",f50
      "right",M113 
      "centre   ",M114
      "2 positions",M115
      "font-editor",m93;

2 - The Font Editor Menus

The Font Editor menu itself is "m93".

m93 = "FONT_EDITOR"
      "template",p176
      "points ",f20
      "draw",M177
      "move",p178
      "genererate file",m94;

Button "template" calls a module named by t-string "176" This t-string is defined in "texts.INC as "fe_mall", which is the template-creating MBS function in the font editor sources.

The font related t-strings from "texts.INC" are:

t176 = "fe_mall"
t177 = "fe_drawm"
t178 = "fe_move"
t179 = "fe_tknfil"
t180 = "fe_fntfil"

Going back to the FONT_EDITOR menu, the "points" button calls built-in function number 20. The functions are listed in the VARKON Documentation -> VARKON User's Manual -> Interactive Functions. f20 is "2D Create Point" (it corresponds to MBS poi_free()).

The "draw" button calls an MBS Macro named by t-string "177", which is (see above) "fe_drawm".

The "move" button calls the MBS function named by t-string "178". This is "fe_move", one of the font editor MBS functions.

Finally (for this menu) the "generate file" button chains to menu "m94". This menu contains:

m94 = "GENERERATE FILE"
       "this char",M179
       "all  char",M180;

Menu "m94" has two buttons which invoke MACRO modules identified by t-strings "179" and 180". These are (see above) defined in "texts.INC" as "fe_tknfil" and "fe_fntfil".

3 - Starting a Font Project

Note: This is just one way to do it.

I created a project "font", with an active module "main".

Main Menu 2D -> Create -> Text -> Font Editor -> Template

VARKON will prompt for the ASCII value of the character, and for the string value of the character itself. A font template will then appear.

The Active Module now contains:

BASIC DRAWING MODULE main();


BEGINMODULE

  part(#1,fe_mall(49, "1"));

ENDMODULE

Where "49" is the ASCII value of the character I chose and "1" happens to be its text.

So MBS function fe_mall is the template function.

The font editor function sources are in "$VARKON_ROOT/sources/Vlib/fonts/fedit". They are:

fe_draw.MBS
fe_drawm.MBS            Macro to draw a line
fe_fntfil.MBS           write out an entire font
fe_mall.MBS             template generator
fe_move.MBS
fe_tknfil.MBS           write out a single character
jkc.SOV

When the editor is invoked, a file is also created in the job directory called "fedit.ONR" which holds the "ordningsnummer" This file initially contains "1 "

To draw a line, first enter two points

MAIN_MENU_2D -> Create -> Text -> Font Editor -> Point -> Absolute

enter the coordinates; I'll use (1000,1000) here You can now go back and view/edit the MBS, which contains:

  part(#1,fe_mall(49, "1"));
  poi_free(#2,vec(1000, 1000));

Enter another coordinate (I did this in MBS):

  part(#1,fe_mall(49, "1"));
  poi_free(#2,vec(1000, 1000));
  poi_free(#3,vec(9000, 1000));

The point (pun intended) to make is that the Font Editor menu item "template" just calls the MBS function "fe_mall", and the button "points" just calls the built-in point drawing function (f20) which is the same as the MBS function "poi_free" The VARKON "Font Editor" is not some special editing program; it's just a regular VARKON drawing session.

Exploring Dr. Hershey's Typography
CircuitousRoot