From e2ff23080cc9613172d26cd8c84f35e278f3565c Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Wed, 7 Feb 2024 18:03:23 +0100 Subject: [PATCH] TextView: enable tabular numbers by default Some apps like Gravity Defied expect the default font to have monospaced numbers --- src/api-impl-jni/widgets/android_widget_TextView.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api-impl-jni/widgets/android_widget_TextView.c b/src/api-impl-jni/widgets/android_widget_TextView.c index 171e28bb..823d646f 100644 --- a/src/api-impl-jni/widgets/android_widget_TextView.c +++ b/src/api-impl-jni/widgets/android_widget_TextView.c @@ -19,6 +19,12 @@ JNIEXPORT jlong JNICALL Java_android_widget_TextView_native_1constructor(JNIEnv gtk_label_set_xalign(GTK_LABEL(label), 0.f); gtk_label_set_yalign(GTK_LABEL(label), 0.f); wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), label); + + PangoAttrList* pango_attrs = pango_attr_list_new(); + pango_attr_list_insert(pango_attrs, pango_attr_font_features_new("tnum")); + gtk_label_set_attributes(GTK_LABEL(label), pango_attrs); + pango_attr_list_unref(pango_attrs); + return _INTPTR(label); }