From c8b7b49d5601dadb45b344bf6a8853f3ba3498d2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 Nov 2017 10:34:30 +0530 Subject: [PATCH] Ensure underline_position is viable --- kitty/fonts/render.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kitty/fonts/render.py b/kitty/fonts/render.py index 613add3c3..c23d18ad9 100644 --- a/kitty/fonts/render.py +++ b/kitty/fonts/render.py @@ -135,6 +135,7 @@ def render_special(underline=0, strikethrough=False, missing=False): s = set_font_family.state cell_width, cell_height, baseline = s.cell_width, s.cell_height, s.baseline underline_position, underline_thickness = s.underline_position, s.underline_thickness + underline_position = min(underline_position, cell_height - underline_thickness) CharTexture = ctypes.c_ubyte * (cell_width * cell_height) ans = CharTexture if missing else CharTexture()