AnalogTerm2: Multiple changes
authorMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 30 Mar 2024 09:02:12 +0000 (09:02 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 30 Mar 2024 09:02:12 +0000 (09:02 +0000)
- TODO update
- Minor help fix
- Explicitly initialize an unused element of an array still
- Add two new aliases, "athight" and "atlowt" to alter the "t"
  default character, making it an ascender or not
- Add a few 7x11 AnalogTerm ][ Even font style variants that can
  be loaded on top of the main at2-even font:
  - AY-variant
  - dashedzero, for an Apple ][/Signetics style 0
  - boldpunctuation, for bolder/thicker general punctuation
  - f-variant, another look for "f" but unaligned with "t"
  - wideserif, widening some characters to fill more evenly
  - widecurved, a variant of the above.

17 files changed:
mmsoftware/analogterm2/TODO.txt
mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant-ansi.txt.gz [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant.txt [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation-ansi.txt.gz [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation.txt [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero-ansi.txt.gz [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero.txt [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant-ansi.txt.gz [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant.txt [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved-ansi.txt.gz [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved.txt [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif-ansi.txt.gz [new file with mode: 0644]
mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif.txt [new file with mode: 0644]
mmsoftware/analogterm2/src/draw.c
mmsoftware/analogterm2/src/main.c
mmsoftware/analogterm2/src/screen.c
mmsoftware/analogterm2/tests/at2-aliases.sh

index 47ad429..7adc11c 100644 (file)
@@ -1,3 +1,27 @@
+- Maybe make the t an ascender in the default font, making it higher by one
+  pixel.  Currently, because variants like "wideserif" and "widecurved" also
+  alter "t" and must stick to a common default, new aliases also allow to
+  switch between high and low t forms: "athight" and "atlowt".
+- Maybe enlarge punctuation like () [] {} in the "even" at2 font?
+  Otherwise some characters really protrude downwards, like y...
+  Actually, this would look strange with digits or uppercase characters,
+  unless they are also higher.
+- -I does not appear to behave as expected when in vim, where the cursor
+  appears to reset to "off" by default instead of not resetting at input.
+  Interestingly, this does not happen with the shell prompt.
+  atcurnodisable does not affect the situation.  It is possible that it is due
+  to a cursor change command vim issues that also causes its state to be
+  reset.  To investigate.
+- Some terminals reset the cursor to off instead of to on at user input.
+  Maybe support this.  A "cursor reset type" feature may be better to be able
+  to use the same option to control cursor options.
+  0 - No reset
+  1 - Reset at input
+  2 - Reset at output
+  3 - Reset at input and output
+  Then reset to on or off...  Or, bits, so that a number can represent any of
+  wanted options.  Or the equivalent with special letters/chars?
+- Maybe add special escape sequences to control cursor reset features.
 - Maybe add non-ASCII characters to the PET20 font, including PETSCII
   where/if supported by Unicode.
 - Maybe add non-ASCII characters for the videoterm and ultraterm.
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant-ansi.txt.gz b/mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant-ansi.txt.gz
new file mode 100644 (file)
index 0000000..294abea
Binary files /dev/null and b/mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant-ansi.txt.gz differ
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant.txt b/mmsoftware/analogterm2/fonts/7x11/at2-even-AY-variant.txt
new file mode 100644 (file)
index 0000000..30020c9
--- /dev/null
@@ -0,0 +1,37 @@
+# Variant for the A and Y uppercase characters that can be loaded on top of
+# the default AT2 font.  It is difficult to get all characters to look optimal
+# at such font sizes and compromises are always necessary.
+# In the original AT2 font, the A is like the Sygnetics/Apple ][ and IBM 3270
+# ones, pointy at top.  For it to look properly, its center horizontal bar
+# is misaligned, down by one pixel.  This variant aligns the bar and uses a
+# rounded square top, like for the "nosquare" font variant.
+# In the original AT2 font, the Y is also like the Sygnetics and 3270, with
+# a long vertical bar and a shortened top, which actually forks at the proper
+# alignment point but still can look unbalanced.  This variant compromises
+# with a shorter vertical bar and a larger top.  It still looks imbalanced.
+
+65
+.......
+..OOO..
+.O...O.
+.O...O.
+.OOOOO.
+.O...O.
+.O...O.
+.O...O.
+.......
+.......
+.......
+
+89
+.......
+.O...O.
+.O...O.
+.O...O.
+..O.O..
+...O...
+...O...
+...O...
+.......
+.......
+.......
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation-ansi.txt.gz b/mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation-ansi.txt.gz
new file mode 100644 (file)
index 0000000..88dcec0
Binary files /dev/null and b/mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation-ansi.txt.gz differ
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation.txt b/mmsoftware/analogterm2/fonts/7x11/at2-even-boldpunctuation.txt
new file mode 100644 (file)
index 0000000..461d109
--- /dev/null
@@ -0,0 +1,132 @@
+# More visible common punctuation characters.
+# Can optionally be loaded on top of another font.
+
+33
+.......
+...O...
+..OOO..
+..OOO..
+...O...
+...O...
+.......
+...O...
+.......
+.......
+.......
+
+34
+.......
+.OO.OO.
+.OO.OO.
+..O..O.
+.O..O..
+.......
+.......
+.......
+.......
+.......
+.......
+
+39
+.......
+...OO..
+...OO..
+....O..
+...O...
+.......
+.......
+.......
+.......
+.......
+.......
+
+44
+.......
+.......
+.......
+.......
+.......
+.......
+..OO...
+..OO...
+...O...
+..O....
+.......
+
+46
+.......
+.......
+.......
+.......
+.......
+.......
+..OO...
+..OO...
+.......
+.......
+.......
+
+58
+.......
+.......
+..OO...
+..OO...
+.......
+.......
+..OO...
+..OO...
+.......
+.......
+.......
+
+59
+.......
+.......
+..OO...
+..OO...
+.......
+.......
+..OO...
+..OO...
+...O...
+..O....
+.......
+
+96
+.......
+..OO...
+..OO...
+..O....
+...O...
+.......
+.......
+.......
+.......
+.......
+.......
+
+8220
+.......
+.OO.OO.
+.OO.OO.
+.O..O..
+..O..O.
+.......
+.......
+.......
+.......
+.......
+.......
+
+8221
+.......
+.OO.OO.
+.OO.OO.
+..O..O.
+.O..O..
+.......
+.......
+.......
+.......
+.......
+.......
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero-ansi.txt.gz b/mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero-ansi.txt.gz
new file mode 100644 (file)
index 0000000..fcaa8b2
Binary files /dev/null and b/mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero-ansi.txt.gz differ
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero.txt b/mmsoftware/analogterm2/fonts/7x11/at2-even-dashedzero.txt
new file mode 100644 (file)
index 0000000..4269795
--- /dev/null
@@ -0,0 +1,15 @@
+# Restore an Apple ][/Signetics like dashed-zero.
+# May be loaded on top of other fonts of compatible size.
+
+48
+.......
+..OOO..
+.O...O.
+.O..OO.
+.O.O.O.
+.OO..O.
+.O...O.
+..OOO..
+.......
+.......
+.......
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant-ansi.txt.gz b/mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant-ansi.txt.gz
new file mode 100644 (file)
index 0000000..f15ecf8
Binary files /dev/null and b/mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant-ansi.txt.gz differ
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant.txt b/mmsoftware/analogterm2/fonts/7x11/at2-even-f-variant.txt
new file mode 100644 (file)
index 0000000..89a56af
--- /dev/null
@@ -0,0 +1,16 @@
+# This "f" has a more natural shape, with a lower bar, that no longer aligns
+# with the horizontal bar of "t" and with the top of lowercase characters,
+# with a less even result.
+
+102
+.......
+...OOO.
+..O....
+..O....
+.OOOO..
+..O....
+..O....
+..O....
+.......
+.......
+.......
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved-ansi.txt.gz b/mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved-ansi.txt.gz
new file mode 100644 (file)
index 0000000..4847601
Binary files /dev/null and b/mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved-ansi.txt.gz differ
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved.txt b/mmsoftware/analogterm2/fonts/7x11/at2-even-widecurved.txt
new file mode 100644 (file)
index 0000000..448e2a7
--- /dev/null
@@ -0,0 +1,96 @@
+# Wide variants that fill more evenly.
+# Also see the "wideserif" variant.
+# For this to be complete, accented variants would also need to be
+# implemented.
+
+49
+.......
+...O...
+..OO...
+.O.O...
+...O...
+...O...
+...O...
+.OOOOO.
+.......
+.......
+.......
+
+73
+.......
+.OOOOO.
+...O...
+...O...
+...O...
+...O...
+...O...
+.OOOOO.
+.......
+.......
+.......
+
+74
+.......
+...OOO.
+.....O.
+.....O.
+.....O.
+.....O.
+.O...O.
+..OOO..
+.......
+.......
+.......
+
+105
+.......
+...O...
+.......
+..OO...
+...O...
+...O...
+...O...
+....OO.
+.......
+.......
+.......
+
+106
+.......
+....O..
+.......
+..OOO..
+....O..
+....O..
+....O..
+....O..
+.O..O..
+..OO...
+.......
+
+108
+.......
+.OOO...
+...O...
+...O...
+...O...
+...O...
+...O...
+....OO.
+.......
+.......
+.......
+
+# More compatible with l and i.
+116
+.......
+.......
+...O...
+.OOOOO.
+...O...
+...O...
+...O...
+....OO.
+.......
+.......
+.......
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif-ansi.txt.gz b/mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif-ansi.txt.gz
new file mode 100644 (file)
index 0000000..ad9eee8
Binary files /dev/null and b/mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif-ansi.txt.gz differ
diff --git a/mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif.txt b/mmsoftware/analogterm2/fonts/7x11/at2-even-wideserif.txt
new file mode 100644 (file)
index 0000000..d249192
--- /dev/null
@@ -0,0 +1,111 @@
+# Wide variants that fill more evenly.
+# For this to be complete, accented variants would also need to be
+# implemented.
+# Also see the "widecurved" variant.
+
+49
+.......
+...O...
+..OO...
+.O.O...
+...O...
+...O...
+...O...
+.OOOOO.
+.......
+.......
+.......
+
+73
+.......
+.OOOOO.
+...O...
+...O...
+...O...
+...O...
+...O...
+.OOOOO.
+.......
+.......
+.......
+
+74
+.......
+...OOO.
+.....O.
+.....O.
+.....O.
+.....O.
+.O...O.
+..OOO..
+.......
+.......
+.......
+
+105
+.......
+...O...
+.......
+.OOO...
+...O...
+...O...
+...O...
+.OOOOO.
+.......
+.......
+.......
+
+106
+.......
+....O..
+.......
+..OOO..
+....O..
+....O..
+....O..
+....O..
+.O..O..
+..OO...
+.......
+
+# This l is very nice but can easily be confused with a 1.
+#108
+#.......
+#.OOO...
+#...O...
+#...O...
+#...O...
+#...O...
+#...O...
+#.OOOOO.
+#.......
+#.......
+#.......
+#
+# This compromise looks less like an 1 while still being wide.
+108
+.......
+.OOO...
+...O...
+...O...
+...O...
+...O...
+...O...
+....OO.
+.......
+.......
+.......
+
+# Slightly wider at the bottom.
+116
+.......
+.......
+...O...
+.OOOOO.
+...O...
+...O...
+...O...
+...OOO.
+.......
+.......
+.......
index e1ca7c0..1504e57 100644 (file)
@@ -396,7 +396,7 @@ draw_lines(state_t *st, screen_t *sc, int low, int high)
                            !st->cursor_disabled && st->cursor_y == row &&
                            st->cursor_x == col &&
                            (! ((draw_cursor_blink_state && sc->focus) &&
-                           cursor_waitnext == 0))) {
+                           cursor_waitnext == 0))) { /* XXX == 0 vs > 0 ?? */
                                if (cursor_waitnext > 0 &&
                                    state->cursor_blink) {
                                        if (cursor_laststate !=
index 2248c2a..b52eac2 100644 (file)
@@ -259,8 +259,8 @@ usage(void)
            "      [?658467;65543[;<n>]h and [?658467;65544h respectively,\n"
            "      where the optional <n> specifies the number of vertical\n"
            "      pixels to jump per frame (1-4).\n"
-           " -I - If the cursor is blinking, do not reset its state to \"on\""
-           "      at user input.\n"
+           " -I - If the cursor is blinking, do not reset its state to\n"
+           "      \"on\" at user input.\n"
            " -P - If the cursor is blinking, reset its timer for printing.\n"
            "      By default, it is only reset \"on\" by user input.\n"
            " -m - Set default cursor style (0 = block, 1 = line, 2 = bar).\n"
index e1ccaa3..6d529fa 100644 (file)
@@ -417,6 +417,7 @@ write_utf8_char(int fd, unsigned char c)
        const int32_t *ucptr = uc, *uceptr = &ucptr[1];
 
        uc[0] = (int32_t)c;
+       uc[1] = 0;
        if (utf8_encode(&utfptr, utfeptr, &ucptr, uceptr) ==
            UTF8_CHARS_ARRAY_EMPTY)
                return write(fd, utf, utfptr - utf);
index 0226688..c14a763 100755 (executable)
@@ -122,6 +122,8 @@ alias atintreverse="printf '\033[?658467;65539;0;85h\033[?658467;65539;1;5h\033[
 
 # Font
 alias atdashedzero="printf '\033[?658467;65540;48;0;0h\033[?658467;65540;48;1;28h\033[?658467;65540;48;2;34h\033[?658467;65540;48;3;38h\033[?658467;65540;48;4;42h\033[?658467;65540;48;5;50h\033[?658467;65540;48;6;34h\033[?658467;65540;48;7;28h\033[?658467;65540;48;8;0h'"
+alias athight="printf '\033[?658467;65540;116;1;8h'"
+alias atlowt="printf '\033[?658467;65540;116;1;0h'"
 alias atfontreset="printf '\033[?658467;65540h'"
 alias atfontblank="printf '\033[?658467;65540;0h'"