* loadup scripts: set MEDLEY-INIT-VARS to NOBIND before loading MEDLEYDIR so that INITVARS in MEDLEYDIR replaces any previous settings in the loadup-sysout * FONT: add cache for FONTSAVAILABLE, add FLUSHFONTCACHE. See FONTCODECHANGES.tedit * Make FONTEXISTS and FONTSAVAILABLE consistent
162 lines
34 KiB
Plaintext
162 lines
34 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 ALWAYSFONTSPEC) [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ÿÿ |