box-drawing: use an a8 buffer when primary font is antialiased

This causes relevant box drawing characters (diagonals, arcs etc) to
be antialiased as well.
This commit is contained in:
Daniel Eklöf 2021-05-05 22:08:35 +02:00
parent 9264d6695c
commit c0bd152218
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -2415,7 +2415,9 @@ box_drawing(const struct terminal *term, wchar_t wc)
{
int width = term->cell_width;
int height = term->cell_height;
pixman_format_code_t fmt = PIXMAN_a1; /* TODO: use a8 when antialiasing=true */
pixman_format_code_t fmt =
term->fonts[0]->antialias ? PIXMAN_a8 : PIXMAN_a1;
int stride = stride_for_format_and_width(fmt, width);
uint8_t *data = xcalloc(height * stride, 1);