* A revision to the font, Unicode, Tedit, and other modules to implement the MCCS character coding as the standard for internal text strings. MCCS is a variant of XCCS with arrows switched with circumflex/underscore and $ switched with currency, and allows for additional code assignments over time. :MCCS replaces :XCCS as the default external format, especially for source files. The file XCCS is removed in favor of the file MCCS, which includes the XCCS external format for backward compatibility. * This includes a single Medley-font formatted font file for each of the family/size/face display fonts. The glyph assignments correspond to the MCCS character encoding (except for fonts with idiosyncratic encodings--Hippo, Symbol). All charsets from legacy font files are included in each file, and the character sets and glyphs in each file have also been extended by offline coercion from related families (e.g. Glyphs not in legacy Terminal are taken from legacy Modern). There should be fewer black boxes, and character-display shouldn't change when you switch fonts. * The Unicode mapping tables have been redefined to set up correspondences between Unicode and MCCS, not XCCS. Separate XCCS to/from MCCS mapping functions are provided in the file MCCS; they are no longer included in INTERPRESS. * TEDIT converts characters in legacy fonts to their new MCCS codes as it reads formatted files, marks the file as MCCS compatible and preserves the new codes on writing. * Default keyboard assignments produce the MCCS uparrow and leftarrow for shift-6 and shift-hyphen, use Function-6 for circumflex and Function-10 for underscore. See documentation in FONTCODECHANGES.TEDIT MCCS.TEDIT MEDLEYFONTFORMAT.TEDIT in docs/internal, and library/UNICODE.TEDIT.
160 lines
33 KiB
Plaintext
160 lines
33 KiB
Plaintext
Medley FONT CODE CHANGES
|
||
2
|
||
|
||
4
|
||
|
||
1
|
||
|
||
FONT CODE CHANGES
|
||
1
|
||
|
||
4
|
||
|
||
By: Ron Kaplan
|
||
This document last edited on August 29, 2025.
|
||
Introduction
|
||
This document describes changes made to the font implementation in order to simplify the code, remove some unecessary (and sometimes broken) features, and to generalize some of the interfaces. The new code also allows the chain of font coercions to fill in not just entirely missing character sets but missing characters in character sets that are only partially populated.
|
||
Font data structures
|
||
The legacy fields FBBOX FBOY BBDX BBDY \SFLKerns \SFRWidths of FONTDESCRIPTOR have been removed and new fields have been added:
|
||
FONTCOMPLETEP: T if all character sets of the font are ©©char-complete¹¹ as defined below. In that case, all coercions are suppressed and the value is used by generic \BUILDSLUGCSINFO when a font's getcharset function returns NIL.
|
||
FONTHASLEFTKERNS: T if at least one character set has left-kern information (althoughthe interpretation of kerning information is still not well defined).
|
||
FONTSLUGWIDTH: The width of the slug/replacement character in the font, in font-scale units.
|
||
FONTTOMCCSFN: If not NIL, a function that translates character codes from the font's encoding to MCCS (e.g. SYMBOLTOMCODE). A hardcopy device can apply its own MCCS-to- device encoding function to the result (e.g. MTOUCODE, MTOXCODE).
|
||
FONTCHARENCODING: The char-encoding of (presumably for charset 0) of the font (e.g. SYMBOL, ALTOTEXT).
|
||
Element 256 (=the constant SLUGCHARSET) of the FONTCHARSETVECTOR has been reserved for a slug CHARSETINFO with a slug (black box or equivalent whose width is FONTSLUGWIDTH) entry for every character. A pointer to that single slug CHARSETINFO is installed in the vector for a character set that is requested but for which it is known that it will never have real characters. Thus, an element of the vector is NIL if a request for such a charset has not yet been made and will be the font's single slug-charsetinfo after the first request.
|
||
New fields have been added to the CHARSETINFO datatype:
|
||
CSSLUGP: This flag is T for all slug charsetinfos to say that the charset does not exist in the font. If FONTCOMPLETEP is not NIL, there may be an attempt to coerce from another font or charset.
|
||
CSCOMPLETEP: T if the CHARSETINFO is char-complete (a slug charsetinfo is always char-complete). Suppresses further attempts to fill in individual characters from other fonts.
|
||
CHARSETNO is set to the character-set number of this charsetinfo when it is installed in its font.
|
||
CSINFOPROPS holds an alist of device-independent or device-specific properties that may be associated with a charset. Properties can be set or retrieved by the function CHARSETPROP.
|
||
(CHARSETPROP CSINFO PROP NEWVALUE) [Macro]
|
||
CSINFO is a CHARSETINFO. If NEWVALUE is provided, it is stored as the new PROP value of CSINFO, and NEWVALUE is returned. Otherwise, the current PROP value of CSINFO is returned.
|
||
Font creation
|
||
The CHARSET argument to FONTCREATE can be a character-set name, or an octal or hex number string, not only a character-set number. Thus (FONTCREATE '(Gacha 10 NIL NIL NIL Greek) is another way of insuring that character set 46Q is instantiated. (A new function CHARSET.DECODE has been added to LLREAD).
|
||
FONTCREATE has been factored into two subfunctions, \FONT.CHECKARGS and FONTCREATE1. \FONT.CHECKARGS interprets the flexible ways in which the properties of the desired font can be expressed and/or defaulted, and checks them for validity. FONTCREATE1 finds or creates the font, knowing that the arguments have been standardized and validated.
|
||
(\FONT.CHECKARGS FAMILY SIZE FACE ROTATION DEVICE CHARSET) [Function]
|
||
The arguments are examined and possibly coerced or defaulted to values that would be sensible specifications for a requested font. Thus, FAMILY can be
|
||
An atomic family name: TIMESROMANÿÿ |