-
-
Notifications
You must be signed in to change notification settings - Fork 29
Rmk143 INITVARS command for MEDLEY-INIT-VARS, FLUSHFONTCACHE #2383
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
Conversation
So that INITVARS in MEDLEYDIR replaces any previous settings in the loadup-sysout
FONTSAVAILABLE was allowing the absence of a face in a filename to map to (MEDIUM REGULAR REGULAR). FONTEXISTS/FONTCREATE don't do that, nor does the Venue sysout.
|
As per discussion with @nbriggs , FONTSPECFROMFILENAME no longer defaults to (MEDIUM REGULAR REGULAR) when the filename doesn't have a valid sequence of face characters. This makes FONTSAVAILABLE consistent with FONTEXISTS/FONTCREATE (at least when font substitutions are not involved). |
|
It builds and works with no issues on Linux Mint 22.1 Cinnamon. |
|
@pamoroso - I'd expect it to build and work in the normal case, did you happen to check whether
|
You probably have to call FLUSHFONTCACHE on this one, because at least for the display there is code to fake up italic/bold from other existing faces. The faked-face font would be in the incore cache, as it has always been, and it wouldn't then look for or notice the new file. |
|
I carried out the following tests. 1.
I get this error: 2.What should I supply as the first argument of 3.
The calls to
The calls to 4.As noted I'm unsure how to call 5.Some tests: |
|
It appears that hanging the cache resets on MEDLEY-INIT-VARS is not the right thing to do. Part of the logic there is correct (don't do anything if MEDLEYDIR hasn't changed, presumably on the same machine), but otherwise it assumes that there is a list of strings with old medleydir prefixes that need to be updated to new medleydir prefixes, and that's all it does. Nothing happens if the old values are not of that form.
I modeled this after the entries for ShellBrowser and ShellOpener on UNIXUTILS, I think those are also probably incorrect (old values won't get set back to NIL).
I think the INITVARS part of this PR is good, MEDLEY-INIT-VARS should not be accumulating entries accidentally.
But another resetting function and another list of variables is needed so that they are completely reset when the MEDLEYDIR changes.
I think I'll put this also in the MEDLEYDIR file, since at least it depends on that change in context.
… On Nov 25, 2025, at 3:37 AM, Paolo Amoroso ***@***.***> wrote:
pamoroso
left a comment
(Interlisp/medley#2383)
<#2383 (comment)>
I carried out the following tests.
1.
(FONTCREATE '(PAOLO 10))
(IL:SYSOUT 'FONTS)
(LOGOUT)
under fonts/medleydisplayfonts, copy MODERN10-MRR.MEDLEYDISPLAYFONT to PAOLO10-MRR.MEDLEYDISPLAYFONTS
start a new session with medley -e -n -v + -y ~/il/FONTS.SYSOUTS
(IL:FONTCREATE '(IL:PAOLO 10))
I get this error:
FONT NOT FOUND
(PAOLO 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY)
2.
What should I supply as the first argument of FLUSHFONTCACHE? Should the following arguments be PAOLO and 10?
3.
under fonts/medleydisplayfonts, copy MODERN10-MRR.MEDLEYDISPLAYFONT to PAOLO10.MEDLEYDISPLAYFONTS
start Medley
The calls to FONTCREATE and FONTSAVAILABLE:
4_ (FONTCREATE 'PAOLO 10)
In ERROR:
FONT NOT FOUND
(PAOLO 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY)
5_:
6_ (FONTSAVAILABLE 'PAOLO 10)
NIL
(LOGOUT T)
under fonts/medleydisplayfonts, rename PAOLO10.MEDLEYDISPLAYFONTS to PAOLO10-MRR.MEDLEYDISPLAYFONTS
start Medley
The calls to FONTCREATE and FONTSAVAILABLE:
4_ (FONTCREATE 'PAOLO 10)
{MODERN10-MRR/135,72420}
5_ (FONTSAVAILABLE 'PAOLO 10)
((PAOLO 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY))
4.
As noted I'm unsure how to call FLUSHFONTCACHE.
5.
Some tests:
11_ (FONTCREATE 'MODERN 10 'STANDARD)
{MODERN10-MRR/146,24210}
12_ (FONTCREATE 'MODERN 10 'BIR 90)
{MODERN10-BIR/135,72210}
13_ (FONTCREATE 'TIMESROMAND 36)
{TIMESROMAND36-MRR/173,104210}
15_ (FONTCREATE 'TIMESROMAND 36 'BIR)
{TIMESROMAND36-BIR/135,72104}
17_ (FONTCREATE 'TIMESROMAND 36 'BIR 90)
{TIMESROMAND36-BIR/135,72000}
—
Reply to this email directly, view it on GitHub <#2383 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJKVWYKMFDOHB2C5WZ336Q5QHAVCNFSM6AAAAACM7IYZUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZVGIYTMNRRGQ>.
You are receiving this because you authored the thread.
|
|
Ahh, it seems the MEDLEY-INIT-VARS has a RESET flag that does what I expected. So I think it will be sufficient just to had that flag to the variables in FONT and UNIXUTILS.
As of now, the reset feature is not conditioned on a MEDLEYDIR change, so caches will be flushed whenever you restart a sysout, even on the same machine/path.
… On Nov 26, 2025, at 2:02 PM, Ron Kaplan ***@***.***> wrote:
It appears that hanging the cache resets on MEDLEY-INIT-VARS is not the right thing to do. Part of the logic there is correct (don't do anything if MEDLEYDIR hasn't changed, presumably on the same machine), but otherwise it assumes that there is a list of strings with old medleydir prefixes that need to be updated to new medleydir prefixes, and that's all it does. Nothing happens if the old values are not of that form.
I modeled this after the entries for ShellBrowser and ShellOpener on UNIXUTILS, I think those are also probably incorrect (old values won't get set back to NIL).
I think the INITVARS part of this PR is good, MEDLEY-INIT-VARS should not be accumulating entries accidentally.
But another resetting function and another list of variables is needed so that they are completely reset when the MEDLEYDIR changes.
I think I'll put this also in the MEDLEYDIR file, since at least it depends on that change in context.
> On Nov 25, 2025, at 3:37 AM, Paolo Amoroso ***@***.***> wrote:
>
>
> pamoroso
> left a comment
> (Interlisp/medley#2383)
> <#2383 (comment)>
> I carried out the following tests.
>
> 1.
>
> (FONTCREATE '(PAOLO 10))
> (IL:SYSOUT 'FONTS)
> (LOGOUT)
> under fonts/medleydisplayfonts, copy MODERN10-MRR.MEDLEYDISPLAYFONT to PAOLO10-MRR.MEDLEYDISPLAYFONTS
> start a new session with medley -e -n -v + -y ~/il/FONTS.SYSOUTS
> (IL:FONTCREATE '(IL:PAOLO 10))
> I get this error:
>
> FONT NOT FOUND
> (PAOLO 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY)
> 2.
>
> What should I supply as the first argument of FLUSHFONTCACHE? Should the following arguments be PAOLO and 10?
>
> 3.
>
> under fonts/medleydisplayfonts, copy MODERN10-MRR.MEDLEYDISPLAYFONT to PAOLO10.MEDLEYDISPLAYFONTS
> start Medley
> The calls to FONTCREATE and FONTSAVAILABLE:
>
> 4_ (FONTCREATE 'PAOLO 10)
> In ERROR:
> FONT NOT FOUND
> (PAOLO 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY)
>
> 5_:
> 6_ (FONTSAVAILABLE 'PAOLO 10)
> NIL
> (LOGOUT T)
> under fonts/medleydisplayfonts, rename PAOLO10.MEDLEYDISPLAYFONTS to PAOLO10-MRR.MEDLEYDISPLAYFONTS
> start Medley
> The calls to FONTCREATE and FONTSAVAILABLE:
>
> 4_ (FONTCREATE 'PAOLO 10)
> {MODERN10-MRR/135,72420}
> 5_ (FONTSAVAILABLE 'PAOLO 10)
> ((PAOLO 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY))
> 4.
>
> As noted I'm unsure how to call FLUSHFONTCACHE.
>
> 5.
>
> Some tests:
>
> 11_ (FONTCREATE 'MODERN 10 'STANDARD)
> {MODERN10-MRR/146,24210}
> 12_ (FONTCREATE 'MODERN 10 'BIR 90)
> {MODERN10-BIR/135,72210}
> 13_ (FONTCREATE 'TIMESROMAND 36)
> {TIMESROMAND36-MRR/173,104210}
> 15_ (FONTCREATE 'TIMESROMAND 36 'BIR)
> {TIMESROMAND36-BIR/135,72104}
> 17_ (FONTCREATE 'TIMESROMAND 36 'BIR 90)
> {TIMESROMAND36-BIR/135,72000}
> —
> Reply to this email directly, view it on GitHub <#2383 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJKVWYKMFDOHB2C5WZ336Q5QHAVCNFSM6AAAAACM7IYZUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZVGIYTMNRRGQ>.
> You are receiving this because you authored the thread.
>
|
|
I updated the various files so that the cache variables are RESET. The caches are flushed whenever a sysout or makesys is started, even in the same environment. The TYPE argument to FLUSHFONTCACHE is one of :INCORE :EXISTS :AVAILABLE (or NIL meaning flush all of them). |
|
I updated to commit b6d5384. 2.
I get an error: Do I need to start a new Medley session after step 2? 4.I wanted to test with XEROXLOGO 48 whose only file is |
|
(FLUSHFONTCACHE) with no arguments was interpreting that as the default font for all caches, not as all fonts. Now fixed. To be more specific try (FLUSHFONTCACHE :EXISTS '(PAOLO 10)). You should see (:EXISTS 1) in the result to tell you that it deleted 1 entry. Then hopefully the test will succeed |
|
I updated to commit cf6c489. 2.It looks like the test succeeded (same steps as my previous attempt): 4.What font can I use for this test? XEROXLOGO 48? |
|
@pamoroso , if I understand it, there are 2 separate tests suggested in 4. One is about faces that don't exist and then do exist, the other is about the medleyfontformat vs some other displayfont format. I think the format issue is not at stake in this PR. That's the question, independent of face, as to whether adding a font that was previously known not to exist is then recognized after flushing the caches and adding it as a displayfont instead of a medleyfont. The face question is more interesting because of the fact that it fakes up missing faces from other existing faces. So pick a medleyfont that has both an MRR and a BRR. First copy only the MRR to a new family name, ask for the Bold. You should get a font with the fake-bold glyphs. Use EDITFONT to show them on the screen. Then flush all the caches (including :INCORE), copy the BRR to the new family name, ask for Bold again. The glyphs in EDITFONT should look better. (In fact you could copy any other random font to the Bold name, if you really wanted to see the contrast). |
|
For the non-existant face, try, for example, BIC (bold italic condensed) which no fonts have, and which shouldn't be derivable from any existing face. |
|
Probably wouldn't make a difference: it coerces nonexistent COMPRESSED to REGULAR, without trying to change the bitmap (unlike faking bold and italic).
… On Nov 28, 2025, at 11:06 AM, Nick Briggs ***@***.***> wrote:
nbriggs
left a comment
(Interlisp/medley#2383)
<#2383 (comment)>
For the non-existant face, try, for example, BIC (bold italic condensed) which no fonts have, and which shouldn't be derivable from any existing face.
—
Reply to this email directly, view it on GitHub <#2383 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJNZO7OV4366YHBEHAL37CMK3AVCNFSM6AAAAACM7IYZUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJQGE2TMNRUGE>.
You are receiving this because you authored the thread.
|
|
On @pamoroso 's test, the only thing of note is that the font name for the copied font comes back as HELVETICA12 instead of PAOLO10, so it is ends up with the name that is written in the font as opposed to the user-level name that was requested. Probably haven't considered before the case of a filename that lies about the font it contains (which the Medley format knows about, not sure about strike and ac). So should FONTCREATE always produce a font with the asked-for name (i.e. based on the filename)? That would make it consistent with FONTSAVAILABLE. Or should FONTSAVAILABLE look inside the file to see what's really there? I think this is a separate issue, not related to this PR. |
|
As expected
… On Nov 28, 2025, at 12:00 PM, Paolo Amoroso ***@***.***> wrote:
pamoroso
left a comment
(Interlisp/medley#2383)
<#2383 (comment)>
A test for a non-existant face:
5_ (EDITFONT (FONTCREATE '(MODERN 10 BIC)))
{MODERN10-BIC/135,73420}
nonex-font.png (view on web) <https://github.com/user-attachments/assets/f8e38e89-f86e-4dba-af6d-bf760e5d9a0f>
—
Reply to this email directly, view it on GitHub <#2383 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJLCIDFDQA7UGBFOUBD37CSXVAVCNFSM6AAAAACM7IYZUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJQGI3TEMBZGU>.
You are receiving this because you authored the thread.
|
|
I updated to commit 857c865, still looking good. |
|
I updated to commit 85b3cbc, nothing unusual to report. |
|
If this is looking good, can it be approved/merged?
… On Nov 30, 2025, at 7:25 AM, Paolo Amoroso ***@***.***> wrote:
pamoroso
left a comment
(Interlisp/medley#2383)
<#2383 (comment)>
I updated to commit 85b3cbc <85b3cbc>, nothing unusual to report.
—
Reply to this email directly, view it on GitHub <#2383 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJP7OLC4R7EOY6XJL5T37MD6JAVCNFSM6AAAAACM7IYZUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJSGY4DMMRVGA>.
You are receiving this because you authored the thread.
|
pamoroso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my tests it works with no issues.



The loadup scripts are changed to set MEDLEY-INIT-VARS back to NOBIND before loading MEDLEYDIR, and MEDLEYDIR is changed to use an INITVARS command for MEDLEY-INIT-VARS. Other files can add new entries to MEDLEY-INIT-VARS without that value being sucked up into MEDLEYDIR the next time it is edited. (Except for variables, like the font cache variables, that appear in files like FONT that are loaded during the make-init phase--the NOBIND would wipe out their values.)
This sets up the font cache variables so that they will be nulled when running in a new system, also adds a more general function FLUSHFONTCACHE for taking specified entries out of the caches (generalization of FLUSHFONTSINCORE). Documentation in FONTCODECHANGES.TEDIT.
This addresses discussion points raised in #2358 and also the "negative caching" issue raised by @nbriggs in Nov 18 2025 private email:
"and the negative caching is still a problem - I don't see an obvious way to force it to look for the font file again. It's not fixed by doing a (LOGOUT) and restart -- which it really should, since the sysout may be starting in a different environment."