This PR contains a large number of changes in support of the implementation of the Medley Dsplay Fon file format. The changes are documented in the docs/internal/FONTCHANGES.TEDIT file.
92 lines
22 KiB
Plaintext
92 lines
22 KiB
Plaintext
Medley FONT CODE CHANGES
|
||
2
|
||
|
||
4
|
||
|
||
1
|
||
|
||
FONT CODE CHANGES
|
||
1
|
||
|
||
4
|
||
|
||
By: Ron Kaplan
|
||
This document last edited on July 11, 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 flag fields FONTCOMPLETEP and FONTHASLEFTKERNS have been added. FONTCOMPLETEP is T if all character sets of the font are ©©glyph-complete¹¹ as defined below. FONTHASLEFTKERNS is T if at least one character set has left-kern information (althoughthe interpretation of kerning information is still not well understood). The
|
||
Element 256 of the FONTCHARSETVECTOR has been reserved for a slug CHARSETINFO with a slug (black box or equivalent) 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 is has no real characters. Thus, an element of the vector is NIL if a request has not yet been made and is always a CHARSETINFO (maybe the slug) after the first request.
|
||
Flag fields CSSLUGP and CSCOMPLETEP and a pointer field CSINFOPROPS have been added to the CHARSETINFO data type. CSSLUGP is T for every slug CHARSETINFO. CSCOMPLETEP is T if the CHARSETINFO is glyph-complete (a slug charset is always glyph-complete). CSINFOPROPS holds an alist of device-independent or device-specific properties that may be associated with a charset.
|
||
(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, returns the current PROP value of CSINFO.
|
||
Font creation
|
||
The function 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, but also a list of font parameters, or a fontdescriptor or font class from which the desired properties can be extracted. SIZE must reduce to a postive integer, FACE must be convertable to a (weight slope expansion) list, DEVICE defaults to DISPLAY, CHARSET defaults to 0, etc. If the arguments are coerceable, \FONT.CHECKARGS returns a multiple-value vector of the decoded values for FAMILY SIZE FACE ROTATION DEVICE CHARSET FONTX, where the last FONTX is either NIL or the known font descriptor that may have emerged from the interpretation of the other arguments.
|
||
\FONT.CHECKARGS causes an error if any of the arguments cannot be properly deciphered (e.g. FAMILY does not map to an atom, ÿÿ |