mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-29 20:32:38 +00:00
fonts: preserve the font matrix when specializing a descriptor
specialize_font_descriptor() re-resolves a descriptor by file, index,
size and dpi to pick up size dependent fields. The re-match carries no
slant request, so fontconfig cannot re-derive a synthetic italic matrix,
and only index, named_style and axes were copied back from the base
descriptor. Any FC_MATRIX on the descriptor was therefore lost on every
sized face build, so the face was constructed without it and
FT_Set_Transform was never called, rendering the glyphs upright.
Descriptors can carry FC_MATRIX since b3e7c3e ("Read FC_MATRIX from
fontconfig"). Copy the matrix back like the other selection derived
fields the re-match cannot reproduce.
This commit is contained in:
parent
79a768ed55
commit
779a49acde
1 changed files with 4 additions and 0 deletions
|
|
@ -458,6 +458,10 @@ specialize_font_descriptor(PyObject *base_descriptor, double font_sz_in_pts, dou
|
|||
if (axes) {
|
||||
if (PyDict_SetItemString(ans, "axes", axes) != 0) return NULL;
|
||||
}
|
||||
PyObject *matrix = PyDict_GetItemString(base_descriptor, "matrix");
|
||||
if (matrix) {
|
||||
if (PyDict_SetItemString(ans, "matrix", matrix) != 0) return NULL;
|
||||
}
|
||||
PyObject *ff = PyDict_GetItemString(ans, "fontfeatures");
|
||||
if (ff && PyList_GET_SIZE(ff)) {
|
||||
for (Py_ssize_t i = 0; i < PyList_GET_SIZE(ff); i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue