mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-12 10:47:05 +02:00
Linux: Dont fail on systems with fonts that have non-UTF-8 names. Fixes #1281
This commit is contained in:
@@ -24,11 +24,12 @@ pyspacing(int val) {
|
|||||||
#undef S
|
#undef S
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline PyObject*
|
static inline PyObject*
|
||||||
pattern_as_dict(FcPattern *pat) {
|
pattern_as_dict(FcPattern *pat) {
|
||||||
PyObject *ans = PyDict_New();
|
PyObject *ans = PyDict_New();
|
||||||
if (ans == NULL) return NULL;
|
if (ans == NULL) return NULL;
|
||||||
#define PS(x) PyUnicode_FromString((char*)x)
|
#define PS(x) PyUnicode_Decode((const char*)x, strlen((const char*)x), "UTF-8", "replace")
|
||||||
#define G(type, get, which, conv, name) { \
|
#define G(type, get, which, conv, name) { \
|
||||||
type out; PyObject *p; \
|
type out; PyObject *p; \
|
||||||
if (get(pat, which, 0, &out) == FcResultMatch) { \
|
if (get(pat, which, 0, &out) == FcResultMatch) { \
|
||||||
|
|||||||
Reference in New Issue
Block a user