Log an error for unknown box drawing chars

This commit is contained in:
Kovid Goyal 2024-12-20 08:33:28 +05:30
parent fdb9b17943
commit 9f0a3611cb
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View file

@ -598,6 +598,8 @@ render_box_char(char_type ch, uint8_t *buf, unsigned width, unsigned height, dou
#define S(ch, func, ...) case ch: SS(func(c, __VA_ARGS__))
switch(ch) {
default: log_error("Unknown box drawing character: U+%x rendered as blank", ch); break;
C(L'─', hline, 1);
C(L'━', hline, 3);
C(L'│', vline, 1);

View file

@ -1038,7 +1038,7 @@ render_box_cell(FontGroup *fg, RunFont rf, CPUCell *cpu_cell, GPUCell *gpu_cell,
FontCellMetrics scaled_metrics = fg->fcm;
unsigned width = fg->fcm.cell_width, height = fg->fcm.cell_height;
if (scale != 1) apply_scale_to_font_group(fg, NULL);
RAII_PyObject(ret, NULL); uint8_t *alpha_mask = NULL;
uint8_t *alpha_mask = NULL;
ensure_canvas_can_fit(fg, num_glyphs + 1, rf.scale);
if (num_glyphs == 1) {
render_box_char(ch, fg->canvas.alpha_mask, width, height, fg->logical_dpi_x, fg->logical_dpi_y);