Skip to content

Commit 4e510f8

Browse files
authored
FontSampler sample sheet display in column major order. (#2406)
FontSampler sample sheet display in column major order. Added alternative CharacterSets designations. Updated documentation. Resolves #2273
2 parents e7bf6e0 + e530304 commit 4e510f8

File tree

3 files changed

+56
-21
lines changed

3 files changed

+56
-21
lines changed

lispusers/FONTSAMPLER

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
22

3-
(FILECREATED " 5-Feb-2025 17:03:38" {DSK}<home>matt>Interlisp>medley>lispusers>FONTSAMPLER.;11 9743
3+
(FILECREATED " 5-Dec-2025 11:09:30" {DSK}<home>matt>Interlisp>medley>lispusers>FONTSAMPLER.;6 12333
44

55
:EDIT-BY "mth"
66

77
:CHANGES-TO (FNS FontSample FontTable)
88

9-
:PREVIOUS-DATE " 3-Feb-2025 20:08:40" {DSK}<home>matt>Interlisp>medley>lispusers>FONTSAMPLER.;10
9+
:PREVIOUS-DATE " 4-Dec-2025 23:56:07" {DSK}<home>matt>Interlisp>medley>lispusers>FONTSAMPLER.;5
1010
)
1111

1212

@@ -21,30 +21,62 @@
2121

2222
(FontSample
2323
[LAMBDA (Fonts CharacterSets Printer StreamType Hexadecimal)
24+
(* ; "Edited 5-Dec-2025 11:06 by mth")
2425
(* ; "Edited 5-Feb-2025 17:02 by mth")
25-
(* edited%: "29-Apr-87 22:03")
26-
(LET* [[TitleFont (FONTCREATE NIL 12 'MRR 0 (OR StreamType (PRINTERTYPE Printer]
26+
(* ; "Edited 29-Apr-87 22:03")
27+
(LET* [[TitleFont (FONTCREATE NIL 12 'MRR 0 (SETQ StreamType (OR StreamType (PRINTERTYPE Printer]
2728
(FontList (if (LISTP Fonts)
2829
else (CONS Fonts)))
2930
[Stream (OPENIMAGESTREAM Printer StreamType (LIST 'FONTS (CONS TitleFont FontList]
3031
(InchesToPrinterUnits (FTIMES 72.0 (DSPSCALE NIL Stream)))
3132
(LastFont (CAR (LAST FontList)))
3233
[CharacterSets (if (LISTP CharacterSets)
3334
then CharacterSets
35+
elseif (MEMB CharacterSets '(T :INCORE :ALL :INTERESTING))
36+
then CharacterSets
3437
else (LIST (OR CharacterSets 0]
35-
(LastCharacterSet (CAR (LAST CharacterSets]
38+
(AllCharacterSets (CONSTANT (for CS from 0 to 255 collect CS]
3639
(DSPRIGHTMARGIN (fetch (REGION WIDTH) of (DSPCLIPPINGREGION NIL Stream))
3740
Stream)
38-
(for Font in FontList do (for CharacterSet in CharacterSets
39-
do (FontTable Font CharacterSet Stream (OR (NEQ Font LastFont)
40-
(NEQ CharacterSet
41-
LastCharacterSet
42-
))
43-
TitleFont InchesToPrinterUnits Hexadecimal))
41+
(for Font in FontList do
42+
(* ;; "Check for the special charset list builders")
43+
44+
(LET (FontCharacterSets (SlugCharsetInfo (\GETCHARSETINFO Font
45+
SLUGCHARSET)))
46+
(SETQ FontCharacterSets
47+
(SELECTQ CharacterSets
48+
(:ALL
49+
(* ;; "Forcibly install ALL CharacterSets.")
50+
51+
(for CS in AllCharacterSets
52+
when (\INSURECHARSETINFO Font CS) collect
53+
CS))
54+
(:INTERESTING (for CS in *INTERESTING-CHARSETS*
55+
when (\INSURECHARSETINFO Font CS)
56+
collect CS))
57+
((T :INCORE)
58+
(for CS in AllCharacterSets
59+
when (\GETCHARSETINFO Font CS) collect CS))
60+
CharacterSets))
61+
62+
(* ;;
63+
 "Exclude any CharacterSet known to reference the SlugCharsetInfo")
64+
65+
(SETQ FontCharacterSets (for CS in FontCharacterSets
66+
unless (EQ SlugCharsetInfo
67+
(\GETCHARSETINFO Font
68+
CS))
69+
collect CS))
70+
(for CharacterSet in FontCharacterSets
71+
bind (LastCharacterSet _ (CAR (LAST FontCharacterSets)))
72+
do (FontTable Font CharacterSet Stream
73+
(OR (NEQ Font LastFont)
74+
(NEQ CharacterSet LastCharacterSet))
75+
TitleFont InchesToPrinterUnits Hexadecimal)))
4476
finally (CLOSEF Stream])
4577

4678
(FontSampleFaked
47-
[LAMBDA (FontAsList Printer StreamType) (* N.H.Briggs "27-Apr-87 18:12")
79+
[LAMBDA (FontAsList Printer StreamType) (* N.H.Briggs "27-Apr-87 18:12")
4880
(LET* [[TitleFont (FONTCREATE NIL 12 'MRR 0 (OR StreamType (PRINTERTYPE Printer]
4981
(Font)
5082
[Stream (OPENIMAGESTREAM Printer StreamType (LIST 'FONTS (LIST TitleFont]
@@ -53,14 +85,16 @@
5385
(replace FONTFAMILY of Font with (CAR FontAsList))
5486
(replace FONTSIZE of Font with (CADR FontAsList))
5587
(replace FONTFACE of Font with (\FONTFACE (CADDR FontAsList)))
56-
(FontTable Font '(0) Stream NIL TitleFont InchesToPrinterUnits)
88+
(FontTable Font '(0)
89+
Stream NIL TitleFont InchesToPrinterUnits)
5790
(CLOSEF Stream])
5891

5992
(FontTable
6093
[LAMBDA (Font CharacterSet Stream FormFeed TitleFont InchesToPrinterUnits Hexadecimal)
94+
(* ; "Edited 5-Dec-2025 11:09 by mth")
6195
(* ; "Edited 5-Feb-2025 17:03 by mth")
6296
(* ; "Edited 3-Feb-2025 20:07 by mth")
63-
(* edited%: "29-Apr-87 22:36")
97+
(* ; "Edited 29-Apr-87 22:36")
6498
(LET*
6599
((Family (FONTPROP Font 'FAMILY))
66100
(Face (FONTPROP Font 'FACE))
@@ -119,10 +153,12 @@
119153
(DSPSCALE NIL Stream)
120154
'PAINT Stream)
121155
(CL:UNLESS UseDisplayFontBitmaps (DSPFONT Font Stream))
122-
(for YPosition from (TIMES 9 InchesToPrinterUnits) by (MINUS YCellSpacing) as YCounter
123-
from 0 to 15 bind (CharacterCode _ 0)
156+
(for XPosition from (TIMES 0.75 InchesToPrinterUnits) by XCellSpacing as XCounter from 0
157+
to 15 bind (CharacterCode _ 0)
158+
[RangedCodesStreamType _ (MEMB (IMAGESTREAMTYPE Stream)
159+
'(DISPLAY INTERPRESS]
124160
do
125-
(for XPosition from (TIMES 0.75 InchesToPrinterUnits) by XCellSpacing as XCounter
161+
(for YPosition from (TIMES 9 InchesToPrinterUnits) by (MINUS YCellSpacing) as YCounter
126162
from 0 to 15
127163
do [LET ((CCode (IPLUS (ITIMES CharacterSet 256)
128164
CharacterCode)))
@@ -137,8 +173,7 @@
137173
RelativeDescent))
138174
ImWidth ImHeight 'INPUT 'REPLACE))
139175
else (if (AND (NEQ CharacterCode (CHARCODE FF))
140-
(if (MEMB (IMAGESTREAMTYPE Stream)
141-
'(DISPLAY INTERPRESS))
176+
(if RangedCodesStreamType
142177
then (OR (AND (IGREATERP CharacterCode 31)
143178
(ILESSP CharacterCode 127))
144179
(AND (IGREATERP CharacterCode 160)
@@ -185,6 +220,6 @@
185220
FONT)
186221
)
187222
(DECLARE%: DONTCOPY
188-
(FILEMAP (NIL (657 9580 (FontSample 667 . 2302) (FontSampleFaked 2304 . 3113) (FontTable 3115 . 9578))
189-
)))
223+
(FILEMAP (NIL (655 12170 (FontSample 665 . 4700) (FontSampleFaked 4702 . 5524) (FontTable 5526 . 12168
224+
)))))
190225
STOP

lispusers/FONTSAMPLER.LCOM

1.57 KB
Binary file not shown.

lispusers/fontsampler.tedit

1.76 KB
Binary file not shown.

0 commit comments

Comments
 (0)