Skip to content

FONTSAMPLE add option for which charset to display #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 103 additions & 68 deletions library/FONTSAMPLE
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "11-Jun-90 15:51:10" {DSK}<usr>local>lde>lispcore>library>FONTSAMPLE.;2 16609

changes to%: (VARS FONTSAMPLECOMS)
(FILECREATED " 1-Feb-2025 11:29:39" {LIB}FONTSAMPLE.;2 17665

previous date%: "10-Jan-87 15:47:00" {DSK}<usr>local>lde>lispcore>library>FONTSAMPLE.;1)
:EDIT-BY "mth"

:CHANGES-TO (FNS FNT.DISPLOOK)

:PREVIOUS-DATE " 1-Feb-2025 10:22:33" {LIB}FONTSAMPLE.;1)


(* ; "
Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights reserved.
Copyright (c) 1985-1987, 1990, 2025 by Venue & Xerox Corporation.
")

(PRETTYCOMPRINT FONTSAMPLECOMS)

(RPAQQ FONTSAMPLECOMS ((MACROS IDIVUP)
(VARS FNT.PANEL FNT.FNAME FNT.INFOFONT FNT.OUTFTEXT)
(FNS FNT.MAKEBOOK FNT.LESSP FNT.SORTP FNT.DISPLOOK FNT.DISPTBLE
FNT.DISPDSCR FNT.NARRDSCR FNT.DISPINIT FNT.FACEMAP FNT.SIZEMAP
FNT.MAKENAME FNT.MAKEWIND FNT.FILEMAP FNT.FINDALL FNT.FLST)))
(RPAQQ FONTSAMPLECOMS
((MACROS IDIVUP)
(VARS FNT.PANEL FNT.FNAME FNT.INFOFONT FNT.OUTFTEXT)
(FNS FNT.MAKEBOOK FNT.LESSP FNT.SORTP FNT.DISPLOOK FNT.DISPTBLE FNT.DISPDSCR FNT.NARRDSCR
FNT.DISPINIT FNT.FACEMAP FNT.SIZEMAP FNT.MAKENAME FNT.MAKEWIND FNT.FILEMAP FNT.FINDALL
FNT.FLST)
(DECLARE%: EVAL@COMPILE DONTCOPY (FILES (FROM LOADUPS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes me uncomfortable to introduce a dependency on "LOADUPSDIRECTORIES" - if it really needs EXPORTS.ALL (does it?) then just (FILES EXPORTS.ALL) and it should use DIRECTORIES which should be set up in the site init file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in general, how should dependency on system level definitions (e.g., CHARSETINFO, FONTDESCRIPTOR, ...) be set in the COMS for modules in LIBRARY or LISPUSERS? The pattern:

(DECLARE%: EVAL@COMPILE DONTCOPY (FILES (FROM LOADUPS)
                                                EXPORTS.ALL))

I found in UNICODECOMS. (@rmkaplan)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the convention in the past was that those working on the "low level" system or calls to it would load the file SYSEDIT; SYSEDIT sets some variables as well as loading EXPORTS.ALL if needed. (There was also a file called "ABC" which looked like SYSEDIT and I tried to merge the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also related discussion in PR 2003

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masinter

I think the convention in the past was that those working on the "low level" system or calls to it would load the file SYSEDIT

But ... SYSEDIT does:

(RESETVARS ((CROSSCOMPILING T))
           (FILESLOAD (SOURCE FROM LOADUPS)
                  EXPORTS.ALL))

So why wouldn't it be acceptable for individual modules (e.g., on lispusers) to do a similar FILESLOAD under (DECLARE%: EVAL@COMPILE DONTCOPY. (Without the (RESETVARS ((CROSSCOMPILING T)) which is SYSEDIT-specific.) This also wouldn't change other system-level VARS that a particular user might not want changed.

More discussion? @rmkaplan @nbriggs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MattHeffron it only does it exactly like that because Larry changed it to do the FILESLOAD "FROM LOADUPS". It's the "FROM LOADUPS" that I'm objecting to, rather than having the right things on DIRECTORIES and not the fact of loading exports.all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But ... where did LOADUPSDIRECTORIES come from?
I take it that you're proposing that it be removed from the standard loadup sysouts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It (LOADUPDIRECTORIES) is set in sources/MEDLEYDIR -- and while I'm happy to have the mechanism there (though I think MEDLEYDIR should be in library not sources), I don't believe that that is the right place to set up a lot of values that are not actually a fundamental part of the system - that's the role of the site init (site greet) file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, instead of a LOADUPDIRECTORIES variable, would it be better (acceptable) for individual modules (e.g., on lispusers) to have:

(DECLARE%: EVAL@COMPILE DONTCOPY
           (FILES (SOURCE FROM VALUEOF (MEDLEYDIR "loadups>")) EXPORTS.ALL))

Should the location of EXPORTS.ALL be a known place?
The loadup sysout files are in the loadups directory because the MEDLEYDIR/scripts/medley/medley.command expects to find them in loadups.
Why not have the same a priori condition that EXPORTS.ALL is in the same place?

Or, should modules like these have a MODULENAME-SETUP-TO-COMPILE function that does the setup, or prints the setup instructions?

And, is it generally better for modules to load EXPORTS.ALL (somehow), or should they use LOADCOMP of the specific system module(s) needed? E.g., TEDIT has:

(DECLARE%: EVAL@COMPILE DONTCOPY (FILES (LOADCOMP) UNICODE))

I'm not trying to be difficult!

Should this discussion be extracted into a GitHub Issue or Discussion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it should just have (DECLARE: EVAL@COMPILE DONTCOPY (FILES EXPORTS.ALL)) - MEDLEYDIR and anything like that has anything to do with running on the emulator, unless the module is specifically targeted to something Unixy, should not appear in the module. The locations for everything should be set up in the site greet file and appear on DIRECTORIES, which FILESLOAD and friends already know about. I think that an EXPORTS.ALL that corresponds to the files that are in sources and library should be checked in to library, or at least it should appear there in the assets of the release. I don't know about TEDIT and UNICODE.

EXPORTS.ALL))
(PROP (MAKEFILE-ENVIRONMENT)
FONTSAMPLE)))
(DECLARE%: EVAL@COMPILE

(PUTPROPS IDIVUP DMACRO ((INUMEXPR IDENEXPR)
(LET (INUM IDEN)
(SETQ INUM INUMEXPR)
(SETQ IDEN IDENEXPR)
(IQUOTIENT (IPLUS INUM IDEN -1)
IDEN))))
(LET (INUM IDEN)
(SETQ INUM INUMEXPR)
(SETQ IDEN IDENEXPR)
(IQUOTIENT (IPLUS INUM IDEN -1)
IDEN))))
)

(RPAQQ FNT.PANEL
Expand All @@ -42,7 +50,7 @@ Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights r
(RPAQQ FNT.FNAME {DSK}FONTBOOK.IP)

(RPAQQ FNT.INFOFONT (TERMINAL 8 (MEDIUM REGULAR REGULAR)
0))
0))

(RPAQQ FNT.OUTFTEXT "abcdefghijkl ABCDEFGHIJKL")
(DEFINEQ
Expand Down Expand Up @@ -131,10 +139,11 @@ Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights r
(RETURN (ALPHORDER KEY1 KEY2])

(FNT.DISPLOOK
[LAMBDA (FILEDSC FONTDSC) (* FS "24-Jan-86 18:19")

(* * uses "private" global vars fnt.infofont and fnt.outftext to generate
 sample string)
[LAMBDA (FILEDSC FONTDSC) (* ; "Edited 1-Feb-2025 11:29 by mth")
(* FS "24-Jan-86 18:19")

(* * uses "private" global vars fnt.infofont and fnt.outftext to generate sample
 string)

(LET NIL (DSPFONT FNT.INFOFONT FILEDSC)
(TERPRI FILEDSC)
Expand All @@ -146,28 +155,35 @@ Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights r
(printout FILEDSC FNT.OUTFTEXT])

(FNT.DISPTBLE
[LAMBDA (Stream FONTDSC) (* FS "17-Mar-86 17:37")

(* * generates a font table using prin1)
[LAMBDA (Stream FONTDSC CHARSET) (* ; "Edited 1-Feb-2025 09:59 by mth")
(* FS "17-Mar-86 17:37")

(* * generates a font table using prin1)

(LET* ((TitleFont (FONTCREATE FNT.INFOFONT))
(FontList (LIST FONTDSC))
(InchesToPrinterUnits (FTIMES 72.0 (DSPSCALE NIL Stream)))
(DDev (IMAGESTREAMTYPE Stream)))
(DDev (IMAGESTREAMTYPE Stream))
(CHARSET (OR (AND (FIXP CHARSET)
(<= 0 CHARSET 255)
CHARSET)
0)))
(if (WINDOWP Stream)
then (CLEARW Stream))
(for Font in FontList
do (DSPRIGHTMARGIN (TIMES 100.0 InchesToPrinterUnits)
Stream) (* Let clip on right *)
(MOVETO (FTIMES 0.75 InchesToPrinterUnits)
(FTIMES 10.0 InchesToPrinterUnits)
Stream)
(DSPFONT TitleFont Stream)
(FNT.NARRDSCR Stream FontList)
(FNT.NARRDSCR Stream FontList CHARSET)
(DSPFONT FONTDSC Stream)
(printout Stream FNT.OUTFTEXT)
(DSPFONT Font Stream)
(for YPosition from (TIMES 9 InchesToPrinterUnits) to (TIMES 1.5 InchesToPrinterUnits
)
by (TIMES -0.5 InchesToPrinterUnits) bind (CharacterCode _ 0)
by (TIMES -0.5 InchesToPrinterUnits) bind (CharacterCode _ (LLSH CHARSET 8))
do (for XPosition from (TIMES 0.75 InchesToPrinterUnits)
to (TIMES 7.5 InchesToPrinterUnits) by (TIMES 0.45 InchesToPrinterUnits)
do (MOVETO XPosition YPosition Stream)
Expand Down Expand Up @@ -226,12 +242,17 @@ Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights r
(RETURN NIL])

(FNT.NARRDSCR
[LAMBDA (OUTF FONTLIST) (* ; "Edited 9-Jan-87 18:57 by FS")

(* * Prints a list of fontlists with narrow formatting appropriate for 8 pt.
 terminal)
[LAMBDA (OUTF FONTLIST CHARSET) (* ; "Edited 1-Feb-2025 10:14 by mth")
(* ; "Edited 9-Jan-87 18:57 by FS")

(* * Prints a list of fontlists with narrow formatting appropriate for 8 pt.
 terminal)

(PROG (NAME SIZE FACE NUMB STRM TEMP OFFX UNITS T0 T1 T2 T3 T4 T5 DESCR)
(PROG (NAME SIZE FACE NUMB STRM TEMP OFFX UNITS T0 T1 T2 T3 T4 T5 T6 DESCR
(CHARSET (OR (AND (FIXP CHARSET)
(<= 0 CHARSET 255)
CHARSET)
0)))
(if (EQ FONTLIST NIL)
then (RETURN NIL))
(if (TYPENAMEP FONTLIST 'FONTDESCRIPTOR)
Expand All @@ -245,38 +266,45 @@ Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights r
(SETQ T3 (PLUS OFFX (TIMES 28 UNITS)))
(SETQ T4 (PLUS OFFX (TIMES 33 UNITS)))
(SETQ T5 (PLUS OFFX (TIMES 48 UNITS)))

(* * (MAPC FONTLIST (QUOTE (LAMBDA (DESCR)
 (SETQ NAME (CAR DESCR)) (SETQ SIZE (CADR DESCR))
 (SETQ FACE (FNT.FACEMAP (CADDR DESCR))) (SETQ TEMP
 (CDDDR DESCR)) (SETQ NUMB (CAR TEMP)) (SETQ STRM
 (CADR TEMP)) (DSPXPOSITION T0 OUTF) (printout OUTF NAME)
 (DSPXPOSITION T1 OUTF) (printout OUTF |.I3| SIZE)
 (DSPXPOSITION T2 OUTF) (printout OUTF FACE)
 (DSPXPOSITION T3 OUTF) (printout OUTF NUMB)
 (DSPXPOSITION T4 OUTF) (printout OUTF STRM)
 (DSPXPOSITION T5 OUTF)))))

(for I in FONTLIST do (if (type? FONTDESCRIPTOR I)
then (SETQ DESCR (FNT.FLST I))
else (SETQ DESCR I))
(SETQ NAME (CAR DESCR))
(SETQ SIZE (CADR DESCR))
(SETQ FACE (FNT.FACEMAP (CADDR DESCR)))
(SETQ TEMP (CDDDR DESCR))
(SETQ NUMB (CAR TEMP))
(SETQ STRM (CADR TEMP))
(DSPXPOSITION T0 OUTF)
(printout OUTF NAME)
(DSPXPOSITION T1 OUTF)
(printout OUTF |.I3| SIZE)
(DSPXPOSITION T2 OUTF)
(printout OUTF FACE)
(DSPXPOSITION T3 OUTF)
(printout OUTF NUMB)
(DSPXPOSITION T4 OUTF)
(printout OUTF STRM)
(DSPXPOSITION T5 OUTF))
(SETQ T6 (PLUS OFFX (TIMES 63 UNITS)))

(* * (MAPC FONTLIST (QUOTE (LAMBDA (DESCR)
 (SETQ NAME (CAR DESCR)) (SETQ SIZE (CADR DESCR))
 (SETQ FACE (FNT.FACEMAP (CADDR DESCR))) (SETQ TEMP
 (CDDDR DESCR)) (SETQ NUMB (CAR TEMP)) (SETQ STRM
 (CADR TEMP)) (DSPXPOSITION T0 OUTF) (printout OUTF NAME)
 (DSPXPOSITION T1 OUTF) (printout OUTF .I3 SIZE)
 (DSPXPOSITION T2 OUTF) (printout OUTF FACE)
 (DSPXPOSITION T3 OUTF) (printout OUTF NUMB)
 (DSPXPOSITION T4 OUTF) (printout OUTF STRM)
 (DSPXPOSITION T5 OUTF)))))

(for I in FONTLIST
do (if (type? FONTDESCRIPTOR I)
then (SETQ DESCR (FNT.FLST I))
else (SETQ DESCR I))
(SETQ NAME (CAR DESCR))
(SETQ SIZE (CADR DESCR))
(SETQ FACE (FNT.FACEMAP (CADDR DESCR)))
(SETQ TEMP (CDDDR DESCR))
(SETQ NUMB (CAR TEMP))
(SETQ STRM (CADR TEMP))
(DSPXPOSITION T0 OUTF)
(if NIL
then (printout OUTF NAME)
(DSPXPOSITION T1 OUTF)
(printout OUTF .I3 SIZE)
(DSPXPOSITION T2 OUTF)
(printout OUTF FACE)
(DSPXPOSITION T3 OUTF)
(printout OUTF NUMB)
(DSPXPOSITION T4 OUTF)
(printout OUTF STRM)
(DSPXPOSITION T5 OUTF)
(printout OUTF "CS=" .I1 CHARSET)
(DSPXPOSITION T6 OUTF)
else (printout OUTF NAME -2 "size=" .I1 SIZE -2 FACE -2 "rot=" .I1 NUMB -2 "C"
.I1.8 CHARSET -2 STRM -3)))
(RETURN NIL])

(FNT.DISPINIT
Expand Down Expand Up @@ -381,11 +409,18 @@ Copyright (c) 1985, 1986, 1987, 1990 by Venue & Xerox Corporation. All rights r
((LISTP FONTOBJ)
FONTOBJ])
)
(PUTPROPS FONTSAMPLE COPYRIGHT ("Venue & Xerox Corporation" 1985 1986 1987 1990))
(DECLARE%: EVAL@COMPILE DONTCOPY

(FILESLOAD (FROM LOADUPS)
EXPORTS.ALL)
)

(PUTPROPS FONTSAMPLE MAKEFILE-ENVIRONMENT (:READTABLE "INTERLISP" :PACKAGE "INTERLISP" :FORMAT :XCCS))
(PUTPROPS FONTSAMPLE COPYRIGHT ("Venue & Xerox Corporation" 1985 1986 1987 1990 2025))
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1964 16504 (FNT.MAKEBOOK 1974 . 3779) (FNT.LESSP 3781 . 4575) (FNT.SORTP 4577 . 5343) (
FNT.DISPLOOK 5345 . 5862) (FNT.DISPTBLE 5864 . 7867) (FNT.DISPDSCR 7869 . 9976) (FNT.NARRDSCR 9978 .
12722) (FNT.DISPINIT 12724 . 13136) (FNT.FACEMAP 13138 . 13525) (FNT.SIZEMAP 13527 . 13863) (
FNT.MAKENAME 13865 . 14549) (FNT.MAKEWIND 14551 . 15105) (FNT.FILEMAP 15107 . 15737) (FNT.FINDALL
15739 . 16082) (FNT.FLST 16084 . 16502)))))
(FILEMAP (NIL (1973 17356 (FNT.MAKEBOOK 1983 . 3788) (FNT.LESSP 3790 . 4584) (FNT.SORTP 4586 . 5352) (
FNT.DISPLOOK 5354 . 5964) (FNT.DISPTBLE 5966 . 8319) (FNT.DISPDSCR 8321 . 10428) (FNT.NARRDSCR 10430
. 13574) (FNT.DISPINIT 13576 . 13988) (FNT.FACEMAP 13990 . 14377) (FNT.SIZEMAP 14379 . 14715) (
FNT.MAKENAME 14717 . 15401) (FNT.MAKEWIND 15403 . 15957) (FNT.FILEMAP 15959 . 16589) (FNT.FINDALL
16591 . 16934) (FNT.FLST 16936 . 17354)))))
STOP
Binary file modified library/FONTSAMPLE.LCOM
Binary file not shown.
Binary file modified library/FONTSAMPLE.TEDIT
Binary file not shown.