mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 10:12:17 +02:00
Merge branch 'fix-text_rendering_strategy-ref' of https://github.com/jwoos/kitty
This commit is contained in:
@@ -435,7 +435,7 @@ box_drawing_scale(PyObject *val, Options *opts) {
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
text_composition_strategy(PyObject *val, Options *opts) {
|
text_composition_strategy(PyObject *val, Options *opts) {
|
||||||
if (!PyUnicode_Check(val)) { PyErr_SetString(PyExc_TypeError, "text_rendering_strategy must be a string"); return; }
|
if (!PyUnicode_Check(val)) { PyErr_SetString(PyExc_TypeError, "text_composition_strategy must be a string"); return; }
|
||||||
opts->text_old_gamma = false;
|
opts->text_old_gamma = false;
|
||||||
opts->text_gamma_adjustment = 1.0f; opts->text_contrast = 0.f;
|
opts->text_gamma_adjustment = 1.0f; opts->text_contrast = 0.f;
|
||||||
if (PyUnicode_CompareWithASCIIString(val, "platform") == 0) {
|
if (PyUnicode_CompareWithASCIIString(val, "platform") == 0) {
|
||||||
@@ -448,7 +448,7 @@ text_composition_strategy(PyObject *val, Options *opts) {
|
|||||||
} else {
|
} else {
|
||||||
RAII_PyObject(parts, PyUnicode_Split(val, NULL, 2));
|
RAII_PyObject(parts, PyUnicode_Split(val, NULL, 2));
|
||||||
int size = PyList_GET_SIZE(parts);
|
int size = PyList_GET_SIZE(parts);
|
||||||
if (size < 1 || 2 < size) { PyErr_SetString(PyExc_ValueError, "text_rendering_strategy must be of the form number:[number]"); return; }
|
if (size < 1 || 2 < size) { PyErr_SetString(PyExc_ValueError, "text_composition_strategy must be of the form 'number [number]'"); return; }
|
||||||
|
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
RAII_PyObject(ga, PyFloat_FromString(PyList_GET_ITEM(parts, 0)));
|
RAII_PyObject(ga, PyFloat_FromString(PyList_GET_ITEM(parts, 0)));
|
||||||
|
|||||||
Reference in New Issue
Block a user