Fix bold-italic variant not being auto-selected on macOS
This commit is contained in:
parent
b603d7abb7
commit
289cfe7584
@ -69,9 +69,9 @@ font_descriptor_from_python(PyObject *src) {
|
|||||||
PyObject *t = PyDict_GetItemString(src, "traits");
|
PyObject *t = PyDict_GetItemString(src, "traits");
|
||||||
if (t == NULL) {
|
if (t == NULL) {
|
||||||
symbolic_traits = (
|
symbolic_traits = (
|
||||||
(PyDict_GetItemString(src, "bold") == Py_True) ? kCTFontBoldTrait : 0 |
|
(PyDict_GetItemString(src, "bold") == Py_True ? kCTFontBoldTrait : 0) |
|
||||||
(PyDict_GetItemString(src, "italic") == Py_True) ? kCTFontItalicTrait : 0 |
|
(PyDict_GetItemString(src, "italic") == Py_True ? kCTFontItalicTrait : 0) |
|
||||||
(PyDict_GetItemString(src, "monospace") == Py_True) ? kCTFontMonoSpaceTrait : 0);
|
(PyDict_GetItemString(src, "monospace") == Py_True ? kCTFontMonoSpaceTrait : 0));
|
||||||
} else {
|
} else {
|
||||||
symbolic_traits = PyLong_AsUnsignedLong(t);
|
symbolic_traits = PyLong_AsUnsignedLong(t);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,7 +202,9 @@ dealloc(Face* self) {
|
|||||||
static PyObject *
|
static PyObject *
|
||||||
repr(Face *self) {
|
repr(Face *self) {
|
||||||
return PyUnicode_FromFormat(
|
return PyUnicode_FromFormat(
|
||||||
"Face(path=%S, index=%d, is_scalable=%S, units_per_EM=%u, ascender=%i, descender=%i, height=%i, max_advance_width=%i max_advance_height=%i, underline_position=%i, underline_thickness=%i)",
|
"Face(family=%s, style=%s, ps_name=%s, path=%S, index=%d, is_scalable=%S, units_per_EM=%u, ascender=%i, descender=%i, height=%i, underline_position=%i, underline_thickness=%i)",
|
||||||
|
self->face->family_name ? self->face->family_name : "", self->face->style_name ? self->face->style_name : "",
|
||||||
|
FT_Get_Postscript_Name(self->face),
|
||||||
self->path, self->index, self->is_scalable ? Py_True : Py_False,
|
self->path, self->index, self->is_scalable ? Py_True : Py_False,
|
||||||
self->ascender, self->descender, self->height, self->max_advance_width, self->max_advance_height, self->underline_position, self->underline_thickness
|
self->ascender, self->descender, self->height, self->max_advance_width, self->max_advance_height, self->underline_position, self->underline_thickness
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user