-
-
Notifications
You must be signed in to change notification settings - Fork 27
rmk122--Next round on fonts and MCCS #2280
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
For the most part as described in docs/internal/FONTCODECHANGES and docs/internal/MEDLEYFONTFORMAT
See new Unicode documentation
On Linux Mint 22.1 Cinnamon this PR builds with no issues and I didn't notice anything unusual. I tested DInfo and NoteCards and the fonts look fine so far. |
Minor changes for forward compatibility with new hardcopy interface, but still good here
I have uploaded all of the medleyformat fonts, and removed the draft status. I expect/hope the only issue is that filenames with underscores and carets might not look the same in Medley vs Unix. I would like to get this tested and merged, to avoid confusion with the changes to the imagefile/hardcopy interfaces. |
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.
On Linux Mint 22.1 Cinnamon I tested up to commit d01503c and I haven't noticed anything unusual. Names containing ←
or ↑
in TEdit look as expected on Linux, i.e. with _
and ^
.
I found that PRETTYFILEINDEX had its own compensation for underscore/arrow, at least for Interpress. Removed it. |
@MattHeffron , LOADUPFULLFONTS on internal/loadups/LOADUP-FULL has some special code for building the postscript fontcache. I wonder whether this should be done when POSTSCRIPTSTREAM is loaded, as part of POSTSCRIPT.INIT. |
I pushed a revised set of medleyformat fonts, plus a few code files with some glitch fixes. The new fonts are built in a sequence that first moves character information in legacy encodings (XCCS$, Altotext...) to MCCS positions in all fonts, then replaces slugs with information it may grab from other MCCS fonts (according to DISPLAYCHARCOERCIONS). Probably no difference from before for the standard encodings (which mostly had arrow/underscore shifts within a font), but I think the coercions for Palatino are now correct. |
I tested up to commit b747e0f and I have nothing unusual to report other the the persistence of the Terminal font issue. |
I also see the left and up arrows when typing |
I investigated a bit further, a little progress. The input characters are handled by the function CHAT.TYPEIN. It gets the codes from the keyboard (e.g. 0,255 for F-10, the MCCS underscore code) and puts it on the Chat OUTPUTSTREAM, a Unix-pty stream. That's a UTF-8 stream, with outcharfn UTF8.OUTCHARFN. That functions does the MCCS to Unicode coercion, mapping 0,255 to the Unicode underscore 0,137. But CHAT.TYPEIN does a direct BOUT to the stream, so the translation doesn't happen. That's a case that I apparently missed when I did the external format transformation. With BOUT, the 0,255 gets put on the Unix stream directly, and presumably what I see as is the echo coming from the shell side--the shell doesn't like that character. Changing the BOUT's to \OUTCHARFN improves things. The goes away but instead is replaced by the left-arrow glyph. My bet now is that the window's display stream is actually just being used for echoing from the shell side, and the echo that's being provided is the already converted 0,137 (the MCCS left arrrow). That is, the keyboards 0,255 is sent down as 0,137, and then send back for echoing as 0,137. So that has to be translated the other way (UTOMCODE) before it is displayed in the new MCCS fonts. I'm still looking at that. |
I think this is going to break the terminal emulation -- the CHAT code is processing the returned codes as ASCII bytes to emulate either (in the two common cases) a Datamedia DM2500 or a DEC VT100 terminal. At times, the characters received are going to be used as binary values for things like cursor positioning. |
You should be able to download the ncurses examples from https://invisible-island.net/ncurses/ncurses-examples.html (untar the file, cd ncurses-examples-20211021, mkdir build, cd build, ../configure, make) then you'll find a collection of test/example/demo programs that make use of the "ncurses" package to drive ASCII graphic displays in the terminal. |
Another useful resource is the VTTEST tool which "tests the compatibility (demonstrates the non-compatibility) of so-called “VT100-compatible” terminals" |
Is the problem that this interface doesn't use Unicode/utf-8, but something else (ISO8859/1 ?) Should the MTOUCODE (or MCCS to ...) then be done explicitly in CHAT.TYPEIN, and then let it do the BOUTs as before on those translated codes? And likewise the reverse. So a code 0,255 from the keyboard would get translated to 0,137, and then bouted. CHAT.TYPEIN already has a guard that it will only bout 8 bit codes, otherwise it flashes the window (which is what I was seeing for the other function keys). And effectively do the reverse sequence the other way around--get the code back, maybe interpret it according to the protocol, but then translate actual characters back to MCCS. Essentially not rely on the stream's external format--or define a separate external format that does the desired mappings |
There are a few things to consider
|
WRT CHAT.KEYACTIONS, I think they would have to be defined to return the MCCS codes that will translate to whatever the user wants the shell to see, they would then get converted
If the user types Function-10, the keyaction table will produce the MCCS code for underscore 0,255, the translation will take it to 0,137, and reverting to the previous BOUT will just send that code.
There is a function TERM.PRINTCHAR in CHATTERMINAL that seems to be the one that puts the character on the display, after all special interpretation has been done. Putting the inverse translator there produces the MCCS code that the MCCS fonts expect. Assuming that the desired 8-bit codes are essentially Unicode charset 0/ISO8859-1, and putting MTOUCODE and UTOMCODE in one or two places seems to make it behave as expected, at least with respect to what shows up in the window with any of the new MCCS fonts: underscores when you type F-10, circumflex when you type F-6. Flashes the window when you type shift-6 (uparrow) or shift-hyphen (left arrow). So this seems like an easy fix...except that back-space doesn't work as I would expect. The Medley level keyaction table produces code 8 (CHARCODE BS) for the Delete key. But when I type Delete in the chat window the \GETKEY in CHAT.TYPEIN returns 127 (CHARCODE DEL). This doesn't exist in MCCS, so MTOUCODE would convert it to an unassigned Unicode, and the window would flash. To get it to work I have to brute-force exclude (CHARCODE DEL) from the translation. But, I'm not sure why the DEL is coming up, if this is the way backspace is supposed to be communicated. Or some sort of accident. (One other note: in release and in this PR, there seems to be an off-by-one bug in the backspace. It shows up if you backspace over an underscore--the right most pixel remains black.) |
A second thought re (CHARCODE DEL): Another solution would be to simply add (CHARCODE DEL) to MCCS, with an identity mapping into Unicode/ISO. And forget about this glitch. |
I also noticed some minor screen corruption when pressing |
Chat with MCCS fonts now works for me, for simple inputs (underscore) and backspace. I haven't done more elaborate testing. Added DEL as an MCCS known character |
One other Chat improvement: I modernized its window, so you can drag it around by the title and reshape by the corners. |
What do I need to put on CHAT.KEYACTIONS to make shift-6 send ASCII caret and shift-minus send underscore? There's no way I'm going to be able to change my touch typing to use different keystrokes between a regular terminal window and a CHAT window. |
The garbage is because the shell it's bringing up thinks it's talking to an xterm-256color, but the CHAT terminal emulation is a dm2500 (by default) - xterm controls that the shell is sending show as garbage on a dm2500 terminal. I suspect that something tried to pass down to the shell info about the terminal emulator type, but it failed. |
If you want it to generally switch the bindings of shift-6/f-6 and shift-hyphen/f10 (but not shift-4/f-4), that's in the general keyaction table in LLKEY.
If people think it's better that the characters align with the labels on current keyboards, then we can revert that change. I think it was discussed somewhere. You would then have to type f-10 to get the left-arrrow in create expressions--maybe dwim could be fixed to coerce _ to ←.
… On Oct 11, 2025, at 1:44 PM, Nick Briggs ***@***.***> wrote:
nbriggs
left a comment
(Interlisp/medley#2280)
<#2280 (comment)>
What do I need to put on CHAT.KEYACTIONS to make shift-6 send ASCII caret and shift-minus send underscore? There's no way I'm going to be able to change my touch typing to use different keystrokes between a regular terminal window and a CHAT window.
—
Reply to this email directly, view it on GitHub <#2280 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJN2YVC5JYHWYMNKTVT3XFTZDAVCNFSM6AAAAACF4OLO3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGOJTGY2DOMBRHA>.
You are receiving this because you were mentioned.
|
Is that something to worry about?
… On Oct 11, 2025, at 1:51 PM, Nick Briggs ***@***.***> wrote:
nbriggs
left a comment
(Interlisp/medley#2280)
<#2280 (comment)>
The garbage is because the shell it's bringing up thinks it's talking to an xterm-256color, but the CHAT terminal emulation is a dm2500 (by default) - xterm controls that the shell is sending show as garbage on a dm2500 terminal. I suspect that something tried to pass down to the shell info about the terminal emulator type, but it failed.
—
Reply to this email directly, view it on GitHub <#2280 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJN2TBJ7CF34DVHBART3XFUURAVCNFSM6AAAAACF4OLO3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGOJTGY2TANRRGY>.
You are receiving this because you were mentioned.
|
Not generally, just in CHAT, which I think should be doable using the CHAT.KEYACTIONS, right? I'm fine with using the underscore key to get a left-arrow in an exec (or SEdit), I'm not sure how I feel about it typing file name patterns in a file browser, but when I'm typing at a Unix shell through a CHAT window it's got to be like every other Unix shell. We should fix the way it tries to tell the shell about the terminal type. It works better if you have VTCHAT loaded. |
We're actually sending the correct info for the terminal type - it gets set to dm2500 in the default chat (implementation in DMCHAT). I have a test for LDESHELL in my .zshrc so that I try to set a simpler prompt -- I guess I need to look at what DMCHAT.HANDLECHARACTER is doing with
|
I was wrong about the source of the garbage -- it's the zsh line editor (zle) trying to say that we should "set bracketed paste mode". CSI here is
This is what gets you the reverse-highlighted text (and no activation if there's a linefeed) when you paste into a terminal window. We could fix up the DMCHAT code to parse the set/reset modes, but the easiest thing (on a mac, with zsh) is to My ~/.zshrc contains (with a few other things)
and my ~/.zshrc-medley now contains
|
I tested up to commit ab5c281. Now pressing |
Many files have changed as I have rearchitected the font interfaces, introduced the Medley font-format files, and worked to normalize to the MCCS encoding of internal data.
This PR is a draft that doesn't yet include the flood of files. For starters, it just has the documentation files that describe the strategy and new and changed features. It will be helpful to get some initial reactions so I can make adjustments before pushing everything. The code and font files will come later.