Medley READ-BDF 2 4 1 READ-BDF 1 4 By: Matt Heffron (heffron@alumni.caltech.edu) This document last edited on April 12, 2025. INTRODUCTION This module defines functions to read BDF format font files, and then to write DISPLAYFONT files containing the glyphs from the source BDF file. In normal use, these DISPLAYFONT files will have remapped the glyphs from their Unicode encoding to Medley's XCCS encoding. All newly created symbols in this module are in the BDF package. FUNCTIONS (BDF:READ-BDF PATH) [Function] BDF:READ-BDF reads and parses the BDF file specified by PATH. (It is required and does not default the extension of the filename.) This returns a BDF::BDF-FONT structure containg all of the glyphs contained in the file. (BDF:WRITE-BDF-TO-DISPLAYFONT-FILES BDFONT DEST-DIR &OPTIONAL MAP-UNKNOWN-TO-PRIVATE RAW-UNICODE-MAPPING FAMILY SIZE FACE ROTATION DEVICE) [Function] BDF:WRITE-BDF-TO-DISPLAYFONT-FILES writes DISPLAYFONT files from BDFONT, for each XCCS character set which contains glyphs mapped into it. BDFONT must be of a BDF::BDF-FONT structure. The files will be written into the corresponding sub-directory of DEST-DIR by character set number. BDFONT and DEST-DIR must be provided. MAP-UNKNOWN-TO-PRIVATE selects how glyphs (character codes) which are present in the BDF file but do not map into XCCS should be handled. If non-NIL, then those will be mapped into the private range of the XCCS encoding space, and the corresponding DISPLAYFONT files will be written. If MAP-UNKNOWN-TO-PRIVATE is NIL (the default), then they will be written, with their BDF (Unicode) encoding, into a parallel set of DISPLAYFONT files with "-UNMAPPED" appended to the FAMILY part of the file name. RAW-UNICODE-MAPPING, if non-NIL, overrides the mapping of character codes from the BDF file (Unicode) encoding to XCCS encoding, and just writes the DISPLAYFONT files according to the BDF file encoding for the glyphs. It will prefix the FAMILY part of the file name with "RAW-". This defaults to NIL. FAMILY SIZE FACE ROTATION DEVICE correspond to the same arguments to IL:FONTCREATE. BDF:WRITE-BDF-TO-DISPLAYFONT-FILES will attempt to get default values from the information in the BDF::BDF-FONT. FAMILY may be a list of values as for IL:FONTCREATE, in which case SIZE FACE ROTATION and DEVICE are taken from the FAMILY list. FAMILY may also be an IL:FONTDESCRIPTOR, again as for IL:FONTCREATE, in this case the values will be used if no values were specified or found in the BDF::BDF-FONT. NOTES f The names of the two entry point functions, READ-BDF and WRITE-BDF-TO-DISPLAYFONT-FILES, are the only symbols exported from the BDF package, all others are internal to that package. f For BDF files containing a large number of glyphs, BDF:READ-BDF can take quite a while and use a lot of memory. For example, READ-BDF of gnu unifont-16.0.02.bdf with 57086 glyphs, took 72 seconds, and allocated 1.3 million FIXP and 3.3 million ONED-ARRAY.) (SEQUENCE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "") STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (ALTERNATE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))))) 1$4 $4$5$T7$1$18$18$J$ PAGEHEADING RUNNINGHEAD MODERN GACHA MODERN MODERN MODERN MODERN  HELVETICA MODERN MODERN MODERN TIMESROMAN$     HRULE.GETFN HRULE.GETFN HRULE.GETFN  HRULE.GETFN  HRULE.GETFN /, A   8V '" ! "D N   4"N= &DATE:iqc xz