RE: Terminal Fonts and Axiom
C Y <[email protected]>
| Newsgroups | gmane.comp.mathematics.axiom.user |
|---|---|
| Message-ID | <[email protected]> |
--- "Page, Bill" <[email protected]> wrote: > > EBCDIC would appear to refer to Extended Binary Coded Decimal > > Interchange Code, apparently an alternative to ASCII. > > http://en.wikipedia.org/wiki/EBCDIC > > > > "It descended from punched cards and the corresponding six bit > binary-coded decimal code that most of IBM's computer peripherals > of the late 1950s and early 1960s used. ..." <grin> > Cliff, you make me feel very old if you really did not previously > know the meaning of the acronym EBCDIC! :-) But be careful not to > be confused by the name. If you take a look in vmlisp.lisp.pamphlet > you will see that EBCDIC is just a poorly named macro for a common > Lisp function (int-char x). Ah. (/me mutters under his breath about poorly named macros.) Well, I'm only 26 and didn't get introduced to computers in a big way until college, so I'm sure I'm missing lots of these goodies. I dunno if our output pamphlet should include a discussion of and introduction to these things, but I guess it couldn't hurt. (Insofar as it's possible, anyway - the complete unicode tables are a tad large for a pamphlet ;-) > http://wiki.axiom-developer.org/axiom--test--1/src/interp/VmlispLisp > > > Judging by the chart on wikipedia, 78 would be 4E in hexadecimal > > which is indeed the + character. plainRTspecialCharacters seems > > to hold definitions not relying on the EBCDIC encoding. As near as > > I can tell there are several styles of character output for EBCDIC > > plain and default, and the RT definitions which appear to be the > > ones which work on modern systems. > > In Axiom right now the only character definitions that are used are > $RTspecialCharacters and $plainRTspecialCharacters. See > > http://wiki.axiom-developer.org/axiom--test--1/src/interp/SetvarsBoot > > These are just more poorly chosen names for extended ASCII (CP850) > and plain ASCII character tables. OK. > Actually I was surprised to see that > > )set output characters default > > works properly on my Windows version of Axiom, although the actual > default is 'plain'. Apparently the MSDOS box in Windows uses CP850 > although a different code might be default in other countries. Some sort of font must be available in Windows that works - my Emacs doesn't have a "Terminal" option. > The rest of the tables in i-output are just cruft. I cannot imagine > that any system running Axiom today would actually use EBCDIC. That's what I was thinking. > > Unfortunately unicode is apparently out of bounds (pity) but > > perhaps those wanting to tweak the appearance of output could use > > variations on the above. > > In general I wouldn't recommend doing this unless you understand > how it is implemented and why it works. Well, that lets me out ;-). > It is quite possible that > this might change in the future. I imagine some updating is in order, yes. > > Eventually, some fun might be had with unicode support: > > http://www.utf8-chartable.de/unicode-utf8-table.pl?start=8704 > > although I expect the real effort on output formatting should > > go to output systems more sophisticated than the terminal. > > You are right, but I expect that there are a lot of people who > will still want to use Axiom in terminal mode. I think the best > approach would be to clean-up 'i-output.boot' and provide some > modern standard character set alternatives there such as utf8, > iso8859-1 etc. And to extend 'setvars.boot' to allow meaningful > commands such as > > )set output characters utf8 I don't think setvars.boot will present too much of a problem. i-output.boot will be more of a challenge, especially since I'm not sure how portable such things are across lisp implementations. > However many of these character sets will not have support for > special line drawing characters such as those in CP850. So there > effect might not be much different than 'plain'. It might be instructive to see how links handles things - they have several options for "frames" in their config, one of which (VT100) seems to work fairly well in xterm. Maybe using a library like ncurses could also result in some interesting options. I seem to recall the discussion sometime back of the technical possibility of an McCLIM backend for ncurses, which would allow automatic retargeting of a GUI to the terminal interface. Dunno if it would be possible but it sure is interesting to think about. > Here is a very good but brief tutorial on character sets: > > http://www.cs.tut.fi/~jkorpela/chars.html Thanks! Looks interesting. > It would be nice if the user did not have to specify the character > set in Axiom. There are some standard ways to determine the proper > default character set for a given terminal environment, at least on > Linux systems. See POSIX locale LC_CTYPE. I agree it would be good to automatically determine this. > If you are willing to spend a little more effort on this I think > it might be appreciated by some people who use Axiom on international > platforms. However unless you want to do a little extra programming > I think you may be limited to supporting only single byte character > codes which might rule out utf-8. I think so, at least until the underlying lisp supports it. Also, I think the terminal it's running in also has to support it. > I suppose that character set support really should be built into the > Lisp that underlies Axiom, but as far as I know GCL does not yet > directly support unicode (some other lisps do, e.g. clisp, sbcl). That's my understanding as well. Axiom will probably want to abstract the functionality it needs, as I think such support is rather different platform to platform. Anyway, I expect to make really good use of unicode in the terminal we would need more intelligent algorithms for formatting than we now have (for example, special case usage of the square root and integral graphics, when they make sense in a layout.) Once again, Tim is proved right - there is no such thing as a simple job ;-). Cheers, CY ____________________________________________________________________________________ Sponsored Link Mortgage rates near 39yr lows. $420k for $1,399/mo. Calculate new payment! www.LowerMyBills.com/lre