Removed WRITE-BDF-TO-DISPLAYFONT-FILE (i.e., no STRIKE format files). No multiple-values returned. Instead, use LIST when appropriate. BDF-TO-CHARSETINFO is now IDEMPOTENT w.r.t. the GLYPHS. Move resolution and defaulting of FAMILY, FACE, SIZE, ROTATION, DEVICE from WRITE-BDF-TO-MEDLEYDISPLAYFONT-FILE to BDF-TO-FONTDESCRIPTOR. Keep the MCCS chars present BITMAP in the BDF-FONT structure, instead of needing to schlepping it around separately. Abstracted testing/setting the MCCS chars present bits to CHAR-PRESENT-BIT (mimicking BITMAPBIT). Added COUNT-MCHARS to know how many MCCS chars are marked in the BITMAP as present. READ-BDF now handles when UTOMCODE? returns multiple mappings, and creates the appropriate duplicate GLYPHS with different MCCS char codes. READ-GLYPH doesn't create an empty BITMAP for spacing glyphs. Use font code changes: Set (CHARSETINFO CHARSETNO). Set (FONTDESCRIPTOR FONTSLUGWIDTH).
59 lines
9.6 KiB
Plaintext
59 lines
9.6 KiB
Plaintext
Medley READ-BDF
|
||
2
|
||
|
||
4
|
||
|
||
1
|
||
|
||
READ-BDF
|
||
1
|
||
|
||
4
|
||
|
||
By: Matt Heffron (heffron@alumni.caltech.edu)
|
||
This document last edited on April 26, 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 MCCS encoding. All newly created symbols in this module are in the BDF package.
|
||
FUNCTIONS
|
||
(BDF:READ-BDF PATH &OPTIONAL VERBOSE) [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. If VERBOSE is non-NIL, then at, its completion, BDF:READ-BDF will print the full internal font name, and the values of the Family, Size, Weight, Slant, and Expansion as determined from the parsed BDF file. (Collectively, Weight, Slant, and Expansion comprise the font FACE. See the IRM 27.12, Fonts, for further description.)
|
||
(BDF:WRITE-BDF-TO-DISPLAYFONT-FILES BDFONT DEST-DIR &KEY FAMILY SIZE FACE ROTATION DEVICE CHAR-SETS MAP-UNKNOWN-TO-PRIVATE WRITE-UNMAPPED RAW-UNICODE-MAPPING) [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.
|
||
FAMILY, SIZE, FACE, ROTATION, and 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. (See the description of VERBOSE output of BDF:READ-BDF, above.) 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.
|
||
CHAR-SETS specifies which character sets, if present, should have the corresponding DISPLAYFONT files written. It is either a single character set number (integer from 0 to 255), a list of character set numbers, T meaning all character sets, or NIL meaning only character set 0. The default is T.
|
||
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, if WRITE-UNMAPPED is non-NIL, 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.
|
||
BDF:WRITE-BDF-TO-DISPLAYFONT-FILES returns five values (not a list of five values). The IL:FONTDESCRIPTOR of the mapped character sets, the list of character sets with DISPLAYFONT files actually written, the IL:FONTDESCRIPTOR of the unmapped character sets, the list of the unmapped character sets with DISPLAYFONT files actually written, the list of BDF::GLYPH instances which could not be mapped. Specifically, those glyphs which have no mapping into XCCS and those with source encoding either > 0xFFFF or with a low byte = 0xFF, as well as those with a width (escapement) = 0 and a bitmap (image) width = 0. These glyphs are never written to DISPLAYFONT files.
|
||
NOTES
|
||
<EFBFBD><EFBFBD> |