Thomas Dickey wrote:
On Sun, 10 Apr 2005, Frank Heckenbach wrote:
Russell Whitaker wrote:
Program below illustrates a bug: lower case a, lower case f thru z, and number 0 are printed with graphic characters. This bug did not appear in earlier versions of slackware.
With the given example, I see a difference which I assume is what you're talking about: if I run the sample in Linux console, linked against ncurses 5.4 (or current), I'm seeing the cells 32-127 as line-drawing. (Cells 0-31 are control characters, and are blank).
Running against ncurses 5.3 or earlier, I don't see line-drawing.
In each case, cells 128-255 are displaying the PC-specific font (some double-width lines, etc).
Indeed 128-255 are ok in all versions I tried. (I left 0-31 out of the test to avoid side-effects, and they don't seem relevant here.)
Since the difference is in how cells 32-127 are displayed, I assume that's the issue. (Though the comments about direct access to the PC font are a little confusing to me...).
I agree with part of this. The part that I don't agree with is the assumption that setting A_ALTCHARSET would in some cases not try to use the terminal's alternate character set. (The sample code sets it in every cell).
Yes, it does, but in addition to setting smacs/rmacs ncurses does some internal remapping by means of real_map[] which it didn't do before AIUI.
Anyway, the affected characters are all printable ASCII characters which are the same, at least in the IBM PC character mapping and probably most other fonts, so if necessary I could just turn off A_ALTCHARSET for those characters (#if 0 in the example below).
yes - that sounds right.
Bear in mind that you're actually using the smpch/rmpch feature, which happens to work because smacs/smpch and rmacs/rmpch are the same strings. I seem to recall that long ago ncurses had something like A_PCCHARSET to distinguish these, but since it was not part of X/Open curses, that was dropped.
It was still available, I could probably use it, but now, A_ALTCHARSET is the only way to get at the font directly, isn't it?
Is this the recommended thing to do, or is there another way to get direct access to all characters of the underlying font (on the Linux console)?
As I understand the issue yes (though actually there's underlying font for cells 32-127, which you don't seem to want).
Maybe we have different definitions of underlying font, but in the end, we seem to mean the same.
What I mean is the font as loaded which has the standard ASCII characters in 32-127 (and other characters such as line drawing in higher positions), and I want to output them just this way.
Since ncurses remaps some of the ASCII characters, and since they're usually mapped 1:1 to the font anyway, I think I should just not set A_ALTCHARSET for those charaters as my patch did. If that's just it, I think we can consider the issue solved.
Frank