Fix resizing of fonts
This commit is contained in:
parent
e15bc71930
commit
7a0b649cbd
@ -207,7 +207,7 @@ python_send_to_gpu(unsigned int x, unsigned int y, unsigned int z, uint8_t* buf)
|
||||
|
||||
static inline PyObject*
|
||||
update_cell_metrics(float pt_sz, float xdpi, float ydpi) {
|
||||
#define CALL(f) { if ((f)->face) { if(!set_size_for_face((f)->face, pt_sz, xdpi, ydpi)) return NULL; clear_sprite_map(f); (f)->hb_font = harfbuzz_font_for_face((f)->face); } }
|
||||
#define CALL(f) { if ((f)->face) { if(!set_size_for_face((f)->face, pt_sz, xdpi, ydpi)) return NULL; (f)->hb_font = harfbuzz_font_for_face((f)->face); } clear_sprite_map((f)); }
|
||||
CALL(&medium_font); CALL(&bold_font); CALL(&italic_font); CALL(&bi_font); CALL(&box_font);
|
||||
for (size_t i = 0; fallback_fonts[i].face != NULL; i++) {
|
||||
CALL(fallback_fonts + i);
|
||||
|
||||
@ -91,6 +91,7 @@ def resize_fonts(new_sz, xdpi=None, ydpi=None):
|
||||
s.family, new_sz, xdpi, ydpi, cell_width, cell_height, baseline,
|
||||
underline_position, underline_thickness
|
||||
)
|
||||
return cell_width, cell_height
|
||||
|
||||
|
||||
def add_line(buf, cell_width, position, thickness, cell_height):
|
||||
|
||||
@ -1599,7 +1599,7 @@ static PyMethodDef methods[] = {
|
||||
MND(cursor_forward, METH_VARARGS)
|
||||
{"wcswidth", (PyCFunction)screen_wcswidth, METH_O, ""},
|
||||
{"index", (PyCFunction)xxx_index, METH_VARARGS, ""},
|
||||
MND(refresh_sprite_positions, METH_O)
|
||||
MND(refresh_sprite_positions, METH_NOARGS)
|
||||
MND(tab, METH_NOARGS)
|
||||
MND(backspace, METH_NOARGS)
|
||||
MND(linefeed, METH_NOARGS)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user