eSyntax10.Scn.FntP\ParcElemsAllocСSyntax14b.Scn.Fnt1Syntax12.Scn.Fnt#СSyntax12b.Scn.Fnt>2[ Z  Zw[An enhanced font mechanism for Oberon for Linux Robert Lichtenberger, November 1997 1. Introduction The original Oberon for Linux supports only a limited number of Fonts and special Files (*.Scn.Fnt) are needed for those. An adaption in Fonts.Mod make all installed X-Window fonts available for Oberon. This adaption uses calls to the X-Library to retrieve font metrics, etc. so no .Scn.Fnt file is needed any more. 2. Fontmapping In addition this version of Oberon for Linux allows fontmapping, i.e. Oberon can display a certain font (e.g. Syntax10.Scn.Fnt) with any other font (e.g. Syntax12.Scn.Fnt) thereby allowing magnification on small sized screens or use of another font, in case one cannot install the special Oberon X-Fonts on a certain X-Server. Fontmapping is done in the file Font.Map by default. It is possible to use another file for fontmapping by setting the environment variable "defaultFont". A special section marked with [Fontmap] is followed by a relation Oberon font name to X-Window font name. When a font is loaded Oberon first checks if a corresponding .Scn.Fnt file is available. If it is then the font is loaded as in standard ETH distributions. (i.e. the old mechanism, which still tries to use an X-Window font of the same name). It is however recommended that you remove all .Scn.Fnt files from you oberon directory and customize the file Font.Map the way you like. The syntax of the Fontmap file is:  Fontmap = {Comment | Section | Entry}. Comment = ";" {char} newLine. Section = "[" char {char} "]". Entry = DisplayEntry | PrinterEntry. DisplayEntry = Key " " Key ["map"] newLine. PrinterEntry = Key " " Key " " Key " " Key " " Key newLine. Key = String | Name. String = ' " ' char {char} ' " ' | " ' " char {char} " ' ". Name = char {char} " ".  Screen fonts are mapped under Section [Fontmap], PrinterFonts are mapped under Section [PSFonts]. If "map" is specified, the corresponding font is mapped. (i.e. special characters like german umlauts, etc. are mapped so that they are displayed / printed correctly) Font mapping for display has been implemented by abusing X11.Font.metrics[0].dx. If a font has to mapped this field is -1 else it is 0. Mapping is ultimately done in Display.GetChar. It would have been necessary to hack up X11, Display and Fonts interface to implement a "clean" parameter for Display.GetChar, so I decided, that this hack can be justified ;-) For Printer fonts Keys have to be Oberon names or the String - Syntax has to be used. 3. Printing Printing has also been improved to enable printing of files which contain fonts for which no corresponding .Pr3.Fnt - File exists. (e.g. Times) The mapping of Oberon font name to Postscript font name is done within the same file as for display fonts. The section is marked [PSFonts]. Note that only one entry is used for all sizes of a certain font in this section. .Pr3.Fnt - Files are no longer needed. The keys in PrinterEntry must be written in the following order: Oberon fontname, Postscript-fontname, Adobe Font Metric file for plain font, Adobe Font Metric file for italic font, Adobe Font Metric file for bold font. If you have installed ghostscript you should have these font - files somewhere in your directory tree. If not you must get them from somewhere. One may discuss whether or not the need for .AFM - Files is justified: o The standard Oberon system had a lot of unprintable fonts because of missing .Pr3 - files. o Postscript is the standard printing mechanism under UNIX. o Adobe recommends to use .AFM - Files in applications rather than calculating values by interpreting postscript. 4. Caveats  o You cannot use FontEdit without .Scn.Fnt files. o If you try to map the Default font to a XWindow font that is not available, oberon will not start (complaining about the OBERON environment variable). o If you don't map Printer fontnames to correct .afm - files then oberon will notify you that printing is not possible. If you try it'll trap.