diff --git a/kitty/core_text.m b/kitty/core_text.m index 86fa9415f..48108b395 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -1070,10 +1070,16 @@ get_variable_data(CTFace *self) { static PyObject* identify_for_debug(CTFace *self) { - return PyUnicode_FromFormat("%V: %V", self->postscript_name, "[psname]", self->path, "[path]"); + RAII_PyObject(features, PyTuple_New(self->font_features.count)); if (!features) return NULL; + char buf[128]; + for (unsigned i = 0; i < self->font_features.count; i++) { + hb_feature_to_string(self->font_features.features + i, buf, sizeof(buf)); + PyObject *f = PyUnicode_FromString(buf); if (!f) return NULL; + PyTuple_SET_ITEM(features, i, f); + } + return PyUnicode_FromFormat("%V: %V\nFeatures: %S", self->postscript_name, "[psname]", self->path, "[path]", features); } - // }}} diff --git a/kitty/debug_config.py b/kitty/debug_config.py index 75cc15b0b..cbcb6743d 100644 --- a/kitty/debug_config.py +++ b/kitty/debug_config.py @@ -261,7 +261,10 @@ def debug_config(opts: KittyOpts) -> str: p(green('Fonts:')) for k, font in current_fonts().items(): if hasattr(font, 'identify_for_debug'): - p(yellow(f' {k}:'), font.identify_for_debug()) + flines = font.identify_for_debug().splitlines() + p(yellow(f'{k.rjust(8)}:'), flines[0]) + for fl in flines[1:]: + p(' ' * 9, fl) p(green('Paths:')) p(yellow(' kitty:'), os.path.realpath(kitty_exe())) p(yellow(' base dir:'), kitty_base_dir) diff --git a/kitty/freetype.c b/kitty/freetype.c index 7bd91d9fc..d28ffee0e 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -747,7 +747,14 @@ identify_for_debug(PyObject *s, PyObject *a UNUSED) { Face *self = (Face*)s; FaceIndex instance; instance.val = self->face->face_index; - return PyUnicode_FromFormat("%s: %V:%d", FT_Get_Postscript_Name(self->face), self->path, "[path]", instance.val); + RAII_PyObject(features, PyTuple_New(self->font_features.count)); if (!features) return NULL; + char buf[128]; + for (unsigned i = 0; i < self->font_features.count; i++) { + hb_feature_to_string(self->font_features.features + i, buf, sizeof(buf)); + PyObject *f = PyUnicode_FromString(buf); if (!f) return NULL; + PyTuple_SET_ITEM(features, i, f); + } + return PyUnicode_FromFormat("%s: %V:%d\nFeatures: %S", FT_Get_Postscript_Name(self->face), self->path, "[path]", instance.val, features); } static PyObject*