bool cfg_stderr;
bool cfg_sleep;
bool cfg_slowscroll;
+int cfg_leading;
void
cfg_stderr = false;
cfg_sleep = false;
cfg_slowscroll = SLOW_SCROLL;
+
+ cfg_leading = EXTRA_LEADING;
}
int
/*
- *
+ * Reset cursor timer when printing, not only for user input.
*/
#define CURSOR_PRINTRESET false
/*
+ * Add extra leading between lines in pixels.
+ * This will affect the vertical connection of graphics characters but can
+ * also improve the readability of normal text.
+ */
+#define EXTRA_LEADING 0
+
+extern int cfg_leading;
+
+
+/*
* The XShm extention allows to accelerate graphics when the client is running
* on the same system as the X11 server.
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/time.h>
#include <state.h>
static bool *row_selected = NULL;
static int scanjmp = 0;
static int blink_ticks = 0;
+static uint8_t empty[FONT_WIDTH];
/* Exported as a general utility */
bool draw_blink_state = true;
struct sigaction act;
struct itimerval itv;
+ (void)memset(empty, 0, FONT_WIDTH);
+
state = st;
screen = sc;
color = cfg_color;
sc->update_w = scanjmp;
/* XXX May want to adjust instead of always resetting */
- sc->update_y = low * FONT_HEIGHT * 2;
- sc->update_h = ((high + 1) * (FONT_HEIGHT * 2)) - sc->update_y;
+ sc->update_y = low * (FONT_HEIGHT + cfg_leading) * 2;
+ sc->update_h = ((high + 1) * ((FONT_HEIGHT + cfg_leading) * 2))
+ - sc->update_y;
/* scanptr2 points to the odd scanline below scanptr1 */
scanptr1 = &sc->pixels[sc->update_y * scanjmp];
else
row_selected[col] = false;
}
- for (grow = 0; grow < FONT_HEIGHT; grow++) {
+ for (grow = 0; grow < (FONT_HEIGHT + cfg_leading); grow++) {
bool lastbg = false;
scanptr1_next = &scanptr1[scanjmp * 2];
for (col = 0; col < cfg_text_width; col++) {
uint8_t (*cf)[FONT_WIDTH] = row_glyphs[col],
- *cb = cf[grow], rev, last = 0;
+ *cb = (grow < FONT_HEIGHT ? cf[grow] :
+ empty),
+ rev, last = 0;
uint32_t m = row_modes[col];
int bit, level, olevel, iblink, fgcolor,
bgcolor;
}
/* Inverse for XOR cursor */
- if (cursor_xor == col &&
+ if (cursor_xor == col && grow < FONT_HEIGHT &&
((st->cursor_mode == CMODE_BLOCK) ||
(st->cursor_mode == CMODE_LINE &&
grow >= (FONT_HEIGHT - 2)) ||
"\nUsage: %s [-8|-u] [-w <cols>] [-h <rows>] [-E <n>] [-s]\n"
" [-C <color>] [-c] [-W] [-b] [-B <microseconds>] [-P]\n"
" [-m <mode>] [-M] [-d] [-D] [-S] [-p <parameters>]\n"
- " [-e <command> [<arguments>]]\n\n"
+ " [-l <pixels>] [-e <command> [<arguments>]]\n\n"
"Where:\n"
" -8 / -u - 8-bit mode (Latin-1), unicode+UTF-8. 8-bit mode is\n"
" automatically enabled by default if the LANG\n"
" before exiting. This is useful to view the output of\n"
" custom commands.\n"
" -p - Analog scanline parameters. These are described below.\n"
+ " -l - Add extra leading pixels between lines. This will also\n"
+ " affect the vertical connectivity of graphics characters.\n"
" -e - Execute command and its arguments instead of $SHELL.\n"
" Must be the last AnalogTerm2 argument if used, because\n"
" other arguments will be passed to the command.\n"
cfg_unicode = !locale_8bit();
progname = strdup(argv[0]);
- while ((ch = getopt(argc, argv, "?8uw:h:E:scC:Wr:bB:Pm:MdDSp:e:"))
+ while ((ch = getopt(argc, argv, "?8uw:h:E:scC:Wr:bB:Pm:MdDSp:l:e:"))
!= -1) {
switch (ch) {
case '8':
case 'p':
cfg_setparams(optarg);
break;
+ case 'l':
+ if ((i = atoi(optarg)) >= -1 && i <= FONT_HEIGHT)
+ cfg_leading = i;
+ break;
case 'e':
{
int l;
else
width = ((cfg_text_width * FONT_WIDTH) * 2) + 1;
#ifdef EXPAND_Y
- height = ((int)((cfg_text_height * FONT_HEIGHT) * 2.5) + 1);
+ height = ((int)((cfg_text_height * (FONT_HEIGHT + cfg_leading)) * 2.5)
+ + 1);
#else
- height = (cfg_text_height * FONT_HEIGHT) * 2;
+ height = (cfg_text_height * (FONT_HEIGHT + cfg_leading)) * 2;
#endif
s->pixels_width = width;