-
-
Notifications
You must be signed in to change notification settings - Fork 27
Rmk140 Sketch uses new font interfaces #2358
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
base: master
Are you sure you want to change the base?
Conversation
|
A cache of values computed by examining the file system is invalid if the file system changes. |
|
Text in Sketch otherwise seems to be working fine. Concerning Terminal larger than 12, do I understand correctly that it's supposed to be coerced to Modern for 14 and up? |
|
Yes, it's a variable that has to be set to NIL in the event functions. The FONTEXISTS cache also has to be set back, only \FONTSINCORE is persistent. (There may still be some Sketch caches that should revert, I'm still learning)
… On Nov 7, 2025, at 8:02 AM, Larry Masinter ***@***.***> wrote:
masinter
left a comment
(Interlisp/medley#2358)
<#2358 (comment)>
A cache of values computed by examining the file system is invalid if the file system changes.
FONTSAVAILABLE looks to see what fonts are in the file system -- if you move to a different configuration or change the files in then FONTSAVAILABLE cache is no longer valid.
—
Reply to this email directly, view it on GitHub <#2358 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJPLE4F2EUNKTZZWXVD33S7BHAVCNFSM6AAAAACLNC66ZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMBTGM4DOOJUG4>.
You are receiving this because you authored the thread.
|
|
That's the idea. It may not work yet, there is still more about Sketch and fonts to understand. Why it's a draft.
… On Nov 7, 2025, at 8:47 AM, Paolo Amoroso ***@***.***> wrote:
pamoroso
left a comment
(Interlisp/medley#2358)
<#2358 (comment)>
Text in Sketch otherwise seems to be working fine. Concerning Terminal larger than 12, do I understand correctly that it's supposed to be coerced to Modern for 14 and up?
—
Reply to this email directly, view it on GitHub <#2358 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJIEEYIAE7JIE3V3I7333TELJAVCNFSM6AAAAACLNC66ZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMBTGYYTINBZHE>.
You are receiving this because you authored the thread.
|
|
I believe it is an error to coerce a fixed-pitch font such as Terminal into a variable-pitch font such as Modern. If the creator of the sketch wants a size that is not available then they should choose an alternative font that has the size. |
|
It is supposed to be driven by the device's CHARCOERCIONS. If (TERMINAL MODERN) is not on the list, then it will produce black boxes instead of maybe different-width fill-ins. That's the trade-off.
… On Nov 7, 2025, at 9:22 AM, Nick Briggs ***@***.***> wrote:
nbriggs
left a comment
(Interlisp/medley#2358)
<#2358 (comment)>
I believe it is an error to coerce a fixed-pitch font such as Terminal into a variable-pitch font such as Modern. If the creator of the sketch wants a size that is not available then they should choose an alternative font that has the size.
—
Reply to this email directly, view it on GitHub <#2358 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJNKQ3A4KUT5VZG46ZL33TIOVAVCNFSM6AAAAACLNC66ZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMBTG44DCNJVHA>.
You are receiving this because you authored the thread.
|
I thought it would be sufficient for FONT to ADDVARS those cache variables to MEDLEY-INIT-VARS, but that doesn't work. The file MEDLEYDIR comes at the beginning of the Lisp loadup, it has a VARS command that smashes any previous value of MEDLEY-INIT-VARS (that might have been set during the INIT phase). Is there any reason for MEDLEYDIR not to use an ADDVARS command instead of VARS ? |
|
i don't think there would be a problem with using ADDVARS ... this all was done when the loadup process was not scripted. The difficulties come when cross-compiling for a different maiko/opcodes where you don't want to mix the directories for things to run in this environment vs things to run in the future -- if they are being set in an ADDVARS when you're adding future values to the current values? |
|
In the release sysout I also get the same behavior with |
|
On @pamoroso 's observation that backspace doesn't work... It turns out that Sketch has a peculiar relationship to Tedit. Loading SKETCH doesn't actually insure that TEDIT has been loaded (no (FILES TEDIT)) command. But the way a single sketch is put to a file is to create an image object around that sketch, insert it in a tedit stream created by a call to OPENTEXTSTREAM, and then do a Tedit Put. Reading from a "sketch" file inverts that process: return the embedded sketch if the Tedit file has a single image object "character" of type Sketch. Thus, at least with respect to getting and putting, Sketch assumes that Tedit is always there, won't work without it. On the other hand, there is a function SK.GETSYNTAX that has a runtime test to see if the function TEDIT.GETSYNTAX exists, in which case it uses that to decode the meaning of characters like backspace, undo, etc. If it doesn't exist (but then you couldn't put or get), it uses the system level GETSYNTAX to get the syntax class. (It has a similar test and dependency on Tedit when it is trying to determine the word-bounding characters for middle-button select.) The reasonable motivation for these Tedit dependencies, I presume, was so that Sketch and Tedit would always have the same key-binding behavior, even if the user moved the Tedit bindings away from the system defaults. The bad behavior comes from the fact that I changed the values returned by TEDIT.GETSYNTAX when I simplified the Tedit process command loop and extended the interface for a larger set of Tedit command characters, as described in the Tedit release notes. Instead of having explicit dispatches in the Tedit command loop for the already defined syntax classes, I made the class of all of them uniformly be of type function-call, with each of them having their own separate implementation function. That's what provides the behavior of the extended set of keyboard actions (and also the Tedit buttons). (The command-loop simplification was also in preparation for a move to a single Tedit process.) But I didn't realize that Sedit was also calling that function and expecting all/only the previously defined class names (CHARDELETE instead of FUNCTIONCALL). So it broke. (I also didn't check the Tedit documentation, where I would have seen the explicit list of class names defined for its value). The simplification inside Tedit is below the level of the TEDIT.GETSYNTAX interface function, so I will try to restore the standard character class names in its output. I will also put in a (FILES TEDIT) command in SKETCH, to be clear. But this raises another possibility: If Sketch were to dispatch in the same way but to its own set of implementation functions, then we might get uniform keyboard operations for bold, italic, etc. that Sketch doesn't now provide, and the Tedit formatting buttons would also act on Sketch selections (the buttons just transmit the triggering characters). Using Tedit's tables for uniformity, we would just need a mapping from the names of the individual Tedit implementation functions to corresponding Sketch functions (e.g. \TEDIT.ONECHAR.FORWARD would map to SKETCH.ONECHAR.FORWARD). |
|
The backspace should now work |
|
With the latest commits up to f9a3ea6 |


Updated Sketch to use the more general font interface, should make it work for HTML when that gets installed. It also now sits on top of the more general font coercion, so that, for example, it might simulate a larger set of sizes (e.g. TERMINAL actually only has up to size 12, but it now should roll over to MODERN for 14 and up.)
I added a general cache for the results of FONTSAVAILABLE file lookups, eliminating some of the special performance-caching in Sketch.
The generic algorithms should also cover a few cases that the original algorithms seem to be missing.