summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/font.c14
-rw-r--r--src/screen.c5
3 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 9702426..c0ace53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3042,3 +3042,8 @@ Fri Jan 14 16:34:13 PST 2000 Michael Jennings <mej@eterm.org>
keypad thanks to a patch from Marius Gedminas <mgedmin@takas.lt>.
-------------------------------------------------------------------------------
+Mon Jan 17 13:09:37 PST 2000 Michael Jennings <mej@eterm.org>
+
+ Fixed the faulty assumption that font->per_char is always non-NULL.
+
+-------------------------------------------------------------------------------
diff --git a/src/font.c b/src/font.c
index 38e1412..2d0748e 100644
--- a/src/font.c
+++ b/src/font.c
@@ -436,7 +436,7 @@ change_font(int init, const char *fontname)
TermWin.fprop = 0; /* Mono-spaced (fixed width) font */
else
TermWin.fprop = 1; /* Proportional font */
- if (TermWin.fprop == 1)
+ if (TermWin.fprop == 1 && TermWin.font->per_char)
for (i = TermWin.font->min_char_or_byte2; i <= TermWin.font->max_char_or_byte2; i++) {
cw = TermWin.font->per_char[i].width;
MAX_IT(fw, cw);
@@ -459,11 +459,13 @@ change_font(int init, const char *fontname)
if (fw != boldFont->max_bounds.width)
fw = -1;
} else {
- for (i = 0; i < 256; i++) {
- if (!isprint(i))
- continue;
- cw = boldFont->per_char[i].width;
- MAX_IT(fw, cw);
+ if (boldFont->per_char) {
+ for (i = 0; i < 256; i++) {
+ if (!isprint(i))
+ continue;
+ cw = boldFont->per_char[i].width;
+ MAX_IT(fw, cw);
+ }
}
}
diff --git a/src/screen.c b/src/screen.c
index 92cc8be..409aa79 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2072,8 +2072,11 @@ scr_refresh(int type)
if (MONO_BOLD(lastrend)) {
if (col < ncols - 1) {
drp[col + 1] |= RS_Dirty;
- if (wbyte || (TermWin.font->per_char[lasttext - TermWin.font->min_char_or_byte2].width == TermWin.font->per_char[lasttext - TermWin.font->min_char_or_byte2].rbearing))
+ if (wbyte || ((TermWin.font->per_char == NULL) ?
+ (TermWin.font->max_bounds.width == TermWin.font->max_bounds.rbearing) :
+ (TermWin.font->per_char[lasttext - TermWin.font->min_char_or_byte2].width == TermWin.font->per_char[lasttext - TermWin.font->min_char_or_byte2].rbearing))) {
drp[col + 1] |= RS_Dirty;
+ }
} else
boldlast = 1;
}