1
0
mirror of synced 2026-01-12 00:42:56 +00:00
Interlisp.medley/docs/internal/fontchars.tedit

22 lines
31 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Font/Character Documentation
Greg Nuyens
filed as: {eris}<lispcore>internal>doc>font&chars.tedit
last edited: March 24, 1986
1
Notice:
this is a draft made available for comments. Please do not forward copies.
Comments are encouraged. Please send them to Nuyens.pa@Xerox.com
1
This note provides information about font and character facilities in Interlisp-D. It is organised in two parts:
1) a user level view of the changes involved in including NS characters in Interlisp-D (adapted from the Koto release notes ({Erinyes}<doc>koto>releasenotes>*))
2) a description of the underlying data-structures and facilities. (exported macros and fns, etc)
User-level view
1
Interlisp-D now supports the Xerox corporate character code standard, commonly referred to as the NS (Network Systems) encoding, described in the document Character Code Standard [Xerox System Integration Standards, XSIS 058404, April 1984]. Previous to the Koto release, Interlisp-D used the ASCII (American Standard Code for Information Interchange) encoding. While the extended-ASCII encoding provided for 8-bit (256 available) characters (primarily Latin alphabet and computer-specific symbols), the NS encoding supports 16-bit (65536 available) characters comprising many foreign alphabets and special symbols.
The benefit of having this large character set, in contrast to approaches that use a small set of character codes and a multiplicity of fonts (e.g., a Greek font, a math font), is that each semantically distinct character is represented by its own character code, completely independent of the character's appearance (font). Thus, the Greek character upper-case Beta ÿÿis ÿalways ÿÿcharacter code ÿ9794ÿÿ, ÿindependent of whether itÿÿ appearÿsÿÿ in printed form in ÿa serifÿÿ styleÿ, sans-serif ÿÿstyleÿ, italic, etc., and it is unrelated to the Roman letter B (character code 66).
NS characters can be used in strings, litatom print names, symbolic files, or anywhere else that characters can be used. All of the standard string and print name functions (RPLSTRING, GNC, NCHARS, STRPOS, etc.) accept litatoms and strings containing NS characters. For example:
_(STRPOS "char" "this is an 8-bit character string")
18
_(STRPOS "char" "ÿÿcelui-ci ÿcomporteÿÿ des charactñ°reÿs NS")
23
Characters are organized into 256-member character sets, each of which generally consists of semantically related characters. For example, character set 38 is the Greek character set and contains the Greek alphabet and punctuation characters needed to print Greek text. A 16-bit character code thus consists of an 8-bit character set and an 8-bit character number within that set. The ASCII character set is contained in NS character set zero; thus, ASCII characters are still represented by the same 8-bit character codes as previously (i.e., 16-bit character codes whose high 8 bits are zero). Most strings and atoms still consist entirely of characters from character set zero and are represented just as space-efficiently in memory and on files as in earlier releases of Interlisp-D that used only ASCII characters.
In almost all cases, a program does not need to know that it is dealing with 16-bit characters rather than 8-bit charactersÿÿï%the higher level system functions all treat them transparently. The exception is in character-level input/output, where the important ÿfactÿÿ to be aware of ÿis that characters are not bytes. The file pointer of a random-access file still counts bytes, and the function NCHARS still counts characters, but the two are no longer directly related. This is discussed in more detail below.
Character-level Input/Output
1
Incompatible Change: BIN and BOUT are no longer appropriate for character input/output.
A character is no longer generally representable in 8 bits. Therefore, characters can no longer, in general, be read or written with the functions BIN and BOUT, which read and write 8-bit quantities. The change is mostly transparent to user programs, especially if those programs use only the higher level functions, such as READ and PRINT. However, it is likely that user programs that manipulated a file character by character using BIN and BOUT should now use the following functions, which may produce or consume more than a single byte:
(READCCODE STREAM) [Function]
(PEEKCCODE STREAM) [Function]
(PRINTCCODE CODE STREAM) [Function]
These functions are documented in the new Interlisp-D Reference Manual. The functions BIN and BOUT are still appropriate for use when reading and writing strictly binary (rather than character) data.
Interlisp-D supports two ways of writing NS characters on files. One way is to write the full 16-bits (two bytes) every time a character is output. The other way, which is the system default, is to use "run-encoding," in which a run of characters in the same character set is written as a sequence of 8-bit character numbers within the character set, preceded by a "change character set" command. The byte 255 (illegal as either a character set number or a character number) followed by a character set number is used to signal a change to a given character set; the following bytes, up until the next change-character set sequence, are all interpreted as coming from the specified character set. Run-encoding can reduce the number of bytes required to encode a string of NS characters, as long as there are long sequences of characters from the same character set, which is usually the case.
Most characters in common use, including those in the ASCII character set, are in character set zero; a file containing only these characters is thus in exactly the same format as in previous releases, viz., one byte per character. However, this should not be relied on.
The fact that the file representation of a character may be more than a single byte has important consequences for any program that uses random access on text files whose characters are run-encoded. First, and most obviously, you cannot count the characters in a string being printed and use that number to derive the file pointer of where the string endsÿÿï%you must use GETFILEPTR. Second, programs that use SETFILEPTR need to be aware of possible character set changes. ÿAt any point when a file is being read or written, it has a "current character set," viz., the character set specified in the most recent "change character set" command written on the file. If the file pointer is changed with SETFILEPTR to a part of the file with a different character set, any characters read or written may have the wrong character set. Programs that use COPYBYTES to copy blocks of characters must ensure both that they are copying on character boundaries and copying to a place that is in the correct character set.
(Internal Note: PRINTCCODE is the user entry to the OUTCHARFN of the stream. It is bounds checked.)
The current character set can be accessed with the following function:
(CHARSET STREAM CHARACTERSET) [Function]
Returns the current character set of the stream STREAM, or T if STREAM is not run-encoded. If CHARACTERSET is non-NIL, the current character set for STREAM is set. For output streams this causes bytes to be written to the stream if CHARACTERSET is different from the current character set; for input streams it merely changes the reader's belief about the current character set. If CHARACTERSET is T, run encoding for STREAM is disabledÿÿï%henceforth each character printed to the stream is printed as exactly two bytes (ÿthe character set and the character number).
Programs that wish to count characters or avoid worrying about character set changes can thus disable run encoding for a particular stream and count each character as two bytes. There is, however, a cost in file space.
Extensions to CHARCODE
1
CHARCODE has been extended to allow specifying NS Characters.
CHARCODE has been extended to allow the specification of 16-bit NS characters in multiple character sets. It also uses two new variables, CHARACTERNAMES and CHARACTERSETNAMES, so characters and character sets can be specified symbolically. The new definition is the following:
(CHARCODE CHAR) [NLambda Function]
Returns the character code specified by CHAR (unevaluated). If CHAR is a one-character atom or string, the corresponding character code is simply returned. Thus, (CHARCODE A) is 65, (CHARCODE 0) is 48. If CHAR is a multi-character litatom or string, it specifies a character code as described below. If CHAR is NIL, CHARCODE simply returns NIL. Finally, if CHAR is a list structure, the value is a copy of CHAR with all the leaves replaced by the corresponding character codes. For instance, (CHARCODE (A (B C))) => (65 (66 67)).
If a character is specified by a multi-character litatom or string, CHARCODE interprets it as follows:
CR, SPACE, etc. The variable CHARACTERNAMES contains an association list mapping special litatoms to character codes. Among the characters defined this way are CR (13), LF (10), SPACE or SP (32), ESCAPE or ESC (27), BELL (7), BS (8), TAB (9), NULL (0), and DEL (127). Examples: (CHARCODE SPACE) returns 32, and (CHARCODE CR) returns 13.
CHARSET,CHARNUM, CHARSET-CHARNUM If the character specification is a litatom or string of the form CHARSET,CHARNUM or CHARSET-CHARNUM, the character code for the character number CHARNUM in the character set CHARSET is returned. CHARSET is either an octal number, or a litatom in the association list CHARACTERSETNAMES (which defines GREEK, CYRILLIC, etc.). CHARNUM is either an octal number, a single-character litatom, or a litatom from the association list CHARACTERNAMES. Examples: (CHARCODE 12,6), (CHARCODE 12,SPACE), (CHARCODE GREEK,A) and (CHARCODE ^GREEK,A)
Note that if CHARNUM is a single-digit number, it is interpreted as an octal character code, not as a character. Thus (CHARCODE GREEK,3) denotes the fourth character in the Greek character set, not the character "3" in that character set.
^CHARSPEC If the character specification is a litatom or string of one of the forms above, preceded by the character "^", this indicates a "control character," derived from the normal character code by clearing the seventh bit (100Q) of the character code (normally set in alphabetic characters). Example: (CHARCODE ^A)
#CHARSPEC (8-bit character codes) If the character specification is a litatom or string of one of the forms above, preceded by the character "#", the eighth bit (200Q), normally zero for 7-bit ASCII characters, is set. This is the way to get character numbers greater than 127. ^ and # can both be set at once. Examples: (CHARCODE #A), (CHARCODE #^GREEK,A)
Note: In Intermezzo (and in some other operating systems), characters with the eighth bit set were considered "meta" characters. In the Koto release, however, "meta" means character set 1, and the meta key produces characters with the 400Q bit set, not 200Q.
Internals
1
Note: The information in this section is advisory only. There is no guarantee of back-compatibility in future changes.
Structure of Font Descriptors
1
To incorporate the increase in information contained in font descriptors due to NS characters, the structure of font descriptors has changed. The current structure is as follows.
((SKETCH a% figure% from% a% document VERSION 3 SKETCHCONTEXT ((ROUND 1 0) (GACHA 10 (MEDIUM
REGULAR REGULAR)) (LEFT BASELINE) (CURVE 18.0 8) NIL NIL (CENTER CENTER) (NIL NIL) T NIL NIL 1.0
)) ((.3175 211.0 NIL) (GROUP (15.5 33.0 317.5 422.0) (((.152 160.25 NIL) (GROUP (15.5
303.0 320.5 152.0) (((.128 160.0 NIL) (BOX (16.0 312.0 320.0 128.0) (ROUND 1 0) NIL 1.0 (
NIL NIL))) ((.05 12.0 NIL) (TEXT (24.0 . 360.0) ("FONTFAMILY:" "FONTSIZE:" "FONTFACE:"
"ROTATION:" "FONTDEVICE:" "\SFAscent:" "\SFDescent:" "\SFHeight:" "FONTCHARSETVECTOR:" "") 1.0
(LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((24.0 411.0 77.0 12.0) (24.0 399.0 63.0
12.0) (24.0 387.0 63.0 12.0) (24.0 375.0 63.0 12.0) (24.0 363.0 77.0 12.0) (24.0 351.0
70.0 12.0) (24.0 339.0 77.0 12.0) (24.0 327.0 70.0 12.0) (24.0 315.0 126.0 12.0) (24.0
303.0 0.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (144.0 . 372.0) ("Modern" "12"
"(Medium Regular Regular)" "0" "RandomDIGdevice" "10" "4" "14") 1.0 (LEFT BASELINE) (GACHA 10
(MEDIUM REGULAR REGULAR)) ((144.0 411.0 42.0 12.0) (144.0 399.0 14.0 12.0) (144.0 387.0
168.0 12.0) (144.0 375.0 7.0 12.0) (144.0 363.0 105.0 12.0) (144.0 351.0 14.0 12.0) (
144.0 339.0 7.0 12.0) (144.0 327.0 14.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (68.0 . 446.0) (
"Font Descriptor") 1.0 (CENTER BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((15.5 443.0 105.0
12.0)) 0))) (176.0 . 376.0))) ((0.0 48.0 NIL) (OPENCURVE ((160.0 . 320.0) (168.0 . 296.0)
(152.0 . 264.0) (184.0 . 224.0)) (ROUND 1 0) NIL (NIL (CURVE 18.0 8.0)) 1.0 (145.0 204.0
46.8 136.4))) ((0.0 76.0 NIL) (OPENCURVE ((224.0 . 216.0) (280.0 . 144.0) (160.0 . 64.0)) (
ROUND 1 0) NIL (NIL (CURVE 18.0 8.0) T) 1.0 (135.0 33.0 170.0 214.8))) ((.094 62.0 NIL) (
GROUP (189.0 117.0 94.0 124.0) (((.05 12.0 NIL) (TEXT (192.0 . 232.0) ("CharsetVector") 1.0
(LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((192.0 229.0 91.0 12.0)) 0)) ((0.0 24.0
NIL) (WIRE ((192.0 . 176.0) (192.0 . 224.0) (232.0 . 224.0) (232.0 . 176.0)) (ROUND 1 0)
NIL NIL 1.0 NIL)) ((.05 12.0 NIL) (TEXT (200.0 . 216.0) ("0") 1.0 (LEFT BASELINE) (GACHA 10
(MEDIUM REGULAR REGULAR)) ((200.0 213.0 7.0 12.0)) 0)) ((0.0 20.0 NIL) (WIRE ((232.0 . 208.0
) (192.0 . 208.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((.05 12.0 NIL) (TEXT (200.0 . 200.0) ("1")
1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((200.0 197.0 7.0 12.0)) 0)) ((0.0
20.0 NIL) (WIRE ((232.0 . 192.0) (192.0 . 192.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0 20.0
NIL) (WIRE ((192.0 . 144.0) (192.0 . 120.0) (232.0 . 120.0) (232.0 . 144.0)) (ROUND 1 0) NIL
NIL 1.0 NIL)) ((0.0 20.0 NIL) (WIRE ((232.0 . 136.0) (192.0 . 136.0)) (ROUND 1 0) NIL NIL
1.0 NIL)) ((.05 12.0 NIL) (TEXT (208.0 . 152.0) ("o" "o" "o" "") 1.0 (LEFT BASELINE) (
GACHA 10 (MEDIUM REGULAR REGULAR)) ((208.0 167.0 7.0 12.0) (208.0 155.0 7.0 12.0) (208.0
143.0 7.0 12.0) (208.0 131.0 0.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (198.0 . 124.0) ("254")
1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((198.0 121.0 21.0 12.0)) 0))) (240.0
. 176.0)))) (176.0 . 248.0))))
(16.0 33.0 316.0 422.0)
1.0
8.0
((SKETCH NIL VERSION 3 SKETCHCONTEXT ((ROUND 1 0) (GACHA 10 (MEDIUM REGULAR REGULAR)) (LEFT BOTTOM
) (CURVE 18.0 8) NIL LAST (CENTER CENTER) (NIL NIL) T NIL NIL 1.0)) ((.284 236.5 NIL) (GROUP
(24.0 111.0 473.0 284.0) (((0.0 104.0 NIL) (OPENCURVE ((96.0 . 332.0) (152.0 . 328.0) (
216.0 . 272.0) (304.0 . 256.0)) (ROUND 1 0) NIL (NIL (CURVE 18.0 8.0) T) 1.0 (54.0 240.0
293.2 108.4))) ((.05 12.0 NIL) (TEXT (24.0 . 368.0) ("Charsetinfo") 1.0 (LEFT BASELINE) (
GACHA 10 (MEDIUM REGULAR REGULAR)) ((24.0 365.0 77.0 12.0)) 0)) ((0.0 64.0 NIL) (WIRE ((96.0
. 344.0) (224.0 . 344.0)) (ROUND 1 0) (NIL (CURVE 18.0 8.0) T) NIL 1.0 (95.0 343.0 130.0
2.0))) ((.096 76.0 NIL) (BOX (24.0 264.0 152.0 96.0) (ROUND 1 0) NIL 1.0 (NIL NIL))) ((.05
12.0 NIL) (TEXT (120.0 . 120.0) (" ") 1.0 (LEFT BOTTOM) (GACHA 10 (MEDIUM REGULAR REGULAR))
((120.0 120.0 7.0 12.0)) 0)) ((.07 55.0 NIL) (GROUP (221.0 285.0 70.0 110.0) (((0.0 32.0
NIL) (WIRE ((224.0 . 344.0) (224.0 . 392.0) (288.0 . 392.0) (288.0 . 344.0)) (ROUND 1 0) NIL
NIL 1.0 NIL)) ((0.0 32.0 NIL) (WIRE ((288.0 . 376.0) (224.0 . 376.0)) (ROUND 1 0) NIL NIL
1.0 NIL)) ((.05 12.0 NIL) (TEXT (232.0 . 368.0) ("1") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM
REGULAR REGULAR)) ((232.0 365.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (232.0 . 384.0) ("0")
1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((232.0 381.0 7.0 12.0)) 0)) ((0.0
32.0 NIL) (WIRE ((288.0 . 360.0) (224.0 . 360.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0 32.0
NIL) (WIRE ((224.0 . 312.0) (224.0 . 288.0) (288.0 . 288.0) (288.0 . 312.0)) (ROUND 1 0) NIL
NIL 1.0 NIL)) ((0.0 32.0 NIL) (WIRE ((288.0 . 304.0) (224.0 . 304.0)) (ROUND 1 0) NIL NIL
1.0 NIL)) ((.05 12.0 NIL) (TEXT (230.0 . 292.0) ("254") 1.0 (LEFT BASELINE) (GACHA 10 (
MEDIUM REGULAR REGULAR)) ((230.0 289.0 21.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (272.0 . 290.0)
("7") 1.0 (LEFT BOTTOM) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((272.0 290.0 7.0 12.0)) 0)) ((
.05 12.0 NIL) (TEXT (254.0 . 324.0) ("o" "o" "o" "") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM
REGULAR REGULAR)) ((254.0 339.0 7.0 12.0) (254.0 327.0 7.0 12.0) (254.0 315.0 7.0 12.0)
(254.0 303.0 0.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (270.0 . 362.0) ("7") 1.0 (LEFT BOTTOM)
(GACHA 10 (MEDIUM REGULAR REGULAR)) ((270.0 362.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (270.0
. 380.0) ("8") 1.0 (LEFT BOTTOM) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((270.0 380.0 7.0 12.0
)) 0))) (256.0 . 344.0))) ((.07 55.0 NIL) (GROUP (301.0 237.0 70.0 110.0) (((0.0 32.0 NIL)
(WIRE ((304.0 . 296.0) (304.0 . 344.0) (368.0 . 344.0) (368.0 . 296.0)) (ROUND 1 0) NIL NIL
1.0 NIL)) ((0.0 32.0 NIL) (WIRE ((368.0 . 328.0) (304.0 . 328.0)) (ROUND 1 0) NIL NIL 1.0
NIL)) ((.05 12.0 NIL) (TEXT (312.0 . 320.0) ("1") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM
REGULAR REGULAR)) ((312.0 317.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (312.0 . 336.0) ("0")
1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((312.0 333.0 7.0 12.0)) 0)) ((0.0
32.0 NIL) (WIRE ((368.0 . 312.0) (304.0 . 312.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((.05 12.0
NIL) (TEXT (352.0 . 336.0) ("0") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((
352.0 333.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (352.0 . 320.0) ("4") 1.0 (LEFT BASELINE)
(GACHA 10 (MEDIUM REGULAR REGULAR)) ((352.0 317.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (
334.0 . 276.0) ("o" "o" "o" "") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((
334.0 291.0 7.0 12.0) (334.0 279.0 7.0 12.0) (334.0 267.0 7.0 12.0) (334.0 255.0 0.0
12.0)) 0)) ((0.0 32.0 NIL) (WIRE ((304.0 . 264.0) (304.0 . 240.0) (368.0 . 240.0) (368.0 .
264.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0 32.0 NIL) (WIRE ((368.0 . 256.0) (304.0 . 256.0))
(ROUND 1 0) NIL NIL 1.0 NIL)) ((.05 12.0 NIL) (TEXT (310.0 . 244.0) ("254") 1.0 (LEFT
BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((310.0 241.0 21.0 12.0)) 0)) ((.05 12.0 NIL) (
TEXT (346.0 . 246.0) ("644") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((346.0
243.0 21.0 12.0)) 0))) (336.0 . 296.0))) ((.05 12.0 NIL) (TEXT (390.0 . 188.0) ("254") 1.0
(LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((390.0 185.0 21.0 12.0)) 0)) ((.07 55.0
NIL) (GROUP (381.0 181.0 70.0 110.0) (((0.0 32.0 NIL) (WIRE ((384.0 . 240.0) (384.0 .
288.0) (448.0 . 288.0) (448.0 . 240.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0 32.0 NIL) (WIRE
((448.0 . 272.0) (384.0 . 272.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0 32.0 NIL) (WIRE ((448.0
. 256.0) (384.0 . 256.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0 32.0 NIL) (WIRE ((384.0 .
208.0) (384.0 . 184.0) (448.0 . 184.0) (448.0 . 208.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((0.0
32.0 NIL) (WIRE ((448.0 . 200.0) (384.0 . 200.0)) (ROUND 1 0) NIL NIL 1.0 NIL)) ((.05 12.0
NIL) (TEXT (432.0 . 186.0) ("7") 1.0 (LEFT BOTTOM) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((
432.0 186.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (414.0 . 220.0) ("o" "o" "o" "") 1.0 (
LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((414.0 235.0 7.0 12.0) (414.0 223.0 7.0
12.0) (414.0 211.0 7.0 12.0) (414.0 199.0 0.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (430.0 .
258.0) ("9") 1.0 (LEFT BOTTOM) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((430.0 258.0 7.0 12.0)) 0
)) ((.05 12.0 NIL) (TEXT (430.0 . 276.0) ("7") 1.0 (LEFT BOTTOM) (GACHA 10 (MEDIUM REGULAR
REGULAR)) ((430.0 276.0 7.0 12.0)) 0)) ((.05 12.0 NIL) (TEXT (392.0 . 264.0) ("1") 1.0 (
LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((392.0 261.0 7.0 12.0)) 0)) ((.05 12.0 NIL
) (TEXT (392.0 . 280.0) ("0") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR REGULAR)) ((392.0
277.0 7.0 12.0)) 0))) (416.0 . 240.0))) ((.026 141.0 NIL) (GROUP (215.0 127.0 282.0 26.0)
(((.024 140.0 NIL) (BOX (216.0 128.0 280.0 24.0) (ROUND 1 0) NIL 1.0 (NIL NIL))) ((.05
12.0 NIL) (TEXT (224.0 . 136.0) ("!%"#$%%&'()*+,-./0123 ... uvwxyz{|}~ ") 1.0 (LEFT BOTTOM)
(GACHA 10 (MEDIUM REGULAR REGULAR)) ((224.0 136.0 273.0 12.0)) 0))) (360.0 . 144.0))) ((.05
12.0 NIL) (TEXT (32.0 . 304.0) ("WIDTHS:" "OFFSETS:" "IMAGEWIDTHS:" "CHARSETBITMAP:"
"YWIDTHS:" "CHARSETASCENT:" "CHARSETDESCENT:") 1.0 (LEFT BASELINE) (GACHA 10 (MEDIUM REGULAR
REGULAR)) ((32.0 337.0 49.0 12.0) (32.0 325.0 56.0 12.0) (32.0 313.0 84.0 12.0) (32.0
301.0 98.0 12.0) (32.0 289.0 56.0 12.0) (32.0 277.0 98.0 12.0) (32.0 265.0 105.0 12.0))
0)) ((.05 12.0 NIL) (TEXT (144.0 . 280.0) ("NIL" "9" "4") 1.0 (LEFT BASELINE) (GACHA 10 (
MEDIUM REGULAR REGULAR)) ((144.0 289.0 21.0 12.0) (144.0 277.0 7.0 12.0) (144.0 265.0 7.0
12.0)) 0)) ((0.0 132.0 NIL) (OPENCURVE ((120.0 . 320.0) (164.0 . 308.0) (280.0 . 204.0) (
384.0 . 196.0)) (ROUND 1 0) NIL (NIL (CURVE 18.0 8.0) T) 1.0 (67.0 171.0 371.6 175.6))) ((
0.0 81.0 NIL) (OPENCURVE ((134.0 . 306.0) (168.0 . 280.0) (152.0 . 168.0) (216.0 . 144.0))
(ROUND 1 0) NIL (NIL (CURVE 18.0 8.0) T) 1.0 (117.0 111.0 116.8 228.8)))) (264.0 . 256.0)))
)
(24.0 111.0 473.0 284.0)
1.0
8.0
Description:
Font Descriptors:
The figure represents the logical structure of a font descriptor. Clarification of field values:
Face: a list containing the weight, slope and expansion. (expansion is always regular)
Rotation: degrees of rotation
Device: name of the device for which this font is created
Ascent: the maximum distance above the baseline for any character in this font.
Descent: the maximum distance below the baseline for any character in this font. (always positive)
Height: maximum total height of any character in this font. Equals Descent+Ascent.
FontDeviceSpec: this is the font specification actually used to create this font after coercions. Thus, if the fontcreate method substituted something other than the original arguments to fontcreate, then this field shows the real contents of the font descriptor, while the family (etc.) fields contain the ostensible (pre-coercion) contents. For instance, display font substitions occur in \CREATECHARSET.DISPLAY according to the variable MISSINGDISPLAYFONTCOERCIONS.
OtherDeviceFontProps: available to the implementation of each stream. Unexamined by the system.
Charsetvector: this is a ptr block pointing to the individual charsetinfo's for each of 255 charsets. These are either NIL or a ptr to the charsetinfo. In the diagram, only the charsetinfo for charset 0 is present. When a fontdescriptor is created the charsetvector will already be present.
Charsetinfo:
A charsetinfo contains all the metrics for a single character set (255 characters) of the font.
Widths: a block of SMALLP's which gives the width in device units for each character (how much to advance the stream xpos after printing this character). This field must be present no matter what the stream type.
Offsets: integer offsets into the bitmap field, showing the xposition of the beginning of the bitmap for this character. Many streams (especially hardcopy streams) have no need of a bitmap or offsets.
Imagewidths: This is the width of the image of this character. Often this will be the same as the width, but it can be less or greater. The field must always be valid.
Bitmap: The bitmap for the characters in this charset. [optional]
YWidths: currently unused, but for forward compatibility, make this be a block giving the y distance to move for each character (i.e. carriage return should move the y position the height of the font.) [**?** is this a positive distance]
Ascent: max ascent in the character set.
Descent: max descent in the character set.
Widths, Offsets, YWidths and Imagewidths are instances of the result of CREATECSINFOELEMENT (see below).
Exported Macros and Functions
1
(\CHARSET CHARCODE)
returns the character set (upper 8 bits) of CHARCODE.
(\CHAR8CODE CHARCODE)
returns the offset of CHARCODE within the character set (the low 8 bits of the character )
(\CREATECHARSET CHARSET FONT NOSLUG?)
the createcharset method (determined by the value of the variable IMAGESTREAMTYPES) is called. NOSLUG? determines the result if the createcharset method returns NIL. If NOSLUG? is NIL, then a "slug" charsetinfo (all characters have a slug (black rectangle) as their image) is returned, otherwise NIL is returned. [This needs improvement, to control how a slug is build. Currently \BUILDSLUGCSINFO is presumed to know how to build a slug for all imagestreams.]
(\GETCHARSETINFO CHARSET FONTDESC NOSLUG?)
returns the charsetinfo for CHARSET (0..254) from FONTDESC. Calls \CREATECHARSET if the charsetinfo wasn't cached already.
(\SETCHARSETINFO CHARSETVECTOR CHARSET CSINFO)
will install CSINFO as the charsetinfo of (smallp) CHARSET in CHARSETVECTOR. Since \CREATECHARSET calls \SETCHARSETINFO directly, it usually need not be called.
(\CREATECSINFOELEMENT)
creates a word block for installing as a widths (imagewidths, offsets) field in a csinfo.
(\FGETWIDTH WIDTHSBLOCK CHAR8CODE)
returns the smallp width at index CHAR8CODE. e.g. (\FGETWIDTH (FETCH (CHARSETINFO WIDTHS) OF csinfo) 55)
(\FSETWIDTH WIDTHSBLOCK CHAR8CODE WIDTH)
sets the smallp width at index CHAR8CODE.
(\FGETCHARWIDTH FONTDESC CHARCODE)
returns the width of any character without having to explicitly fetch the correct charsetinfo for the character set of the character.
(\FGETIMAGEWIDTH FONT CHARCODE)
analagous to \FGETWIDTH but for imagewidths (the width of the character image rather than the amount the xposition should be incremented when printing this character.)
(\FGETCHARIMAGEWIDTH FONT CHARCODE)
analagous to \FGETCHARWIDTH but for imagewidths.
(\FGETOFFSET OFFSETBLOCK CHAR8CODE)
analagous to \FGETWIDTH but for offsets (the position in the bitmap for this character set where the image for this character begins. )
(\FSETOFFSET OFFSETSBLOCK CHAR8CODE OFFSET)
sets the smallp offset at index CHAR8CODE.

.ø.ø/øT.ø(($$($.~~.~~(MODERNMODERN 
TIMESROMAN
CLASSIC
MODERN
MODERN
MODERN
MODERN
 8 HRULE.GETFNMODERN LB HRULE.GETFNMODERN r£b HRULE.GETFNMODERN ¹p  !+ 
Q5
! ){#
Æ HRULE.GETFNMODERN C" 
 
 
É<03>eí$fG  
0
 +N   §1Ü HRULE.GETFNMODERN >
(Œ_2+zgF ]Ž 6!H
 HRULE.GETFNMODERN z HRULE.GETFNMODERN ´
W SKIO.GETFN.2MODERN
 SKIO.GETFN.2MODERN






cX ;QdWØa)    bÙË«Cð)+i  HRULE.GETFNMODERN  . =bFE 
Xq $ ? ! ˆ
«
3
Š
" k<>vzº