From 414d0f6d92aba6dedbe9d2ee1f5e1e3a78e9d355 Mon Sep 17 00:00:00 2001 From: 2387skju <2387skju@users.noreply.github.com> Date: Sat, 2 May 2026 15:35:27 +0200 Subject: applet clock: fix proportional fonts by font-feature tabular numbers Fixes #1338: The clock-time was jumping (and also the rest of the panel), due to different width of the digits. The font must support this feature, otherwise this fix will not work: Example: Font "Cantarell" OK ; Font "Quicksand" still buggy. --- applets/clock/clock.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/applets/clock/clock.c b/applets/clock/clock.c index 2aff3878..0c104f31 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -1546,6 +1546,16 @@ create_main_clock_label (ClockData *cd) GtkWidget *label; label = gtk_label_new (NULL); + + // Fix proportional font by font feature tabular numbers (tnum) (if supported by the font) + PangoAttribute *attr; + PangoAttrList *alist; + attr = pango_attr_font_features_new ("tnum=1"); + alist = pango_attr_list_new (); + pango_attr_list_insert (alist, attr); + gtk_label_set_attributes (GTK_LABEL (label), alist); + pango_attr_list_unref (alist); + /*Fixme-this is invalid for labels with any recent GTK3 version, maybe all of them*/ /* g_signal_connect (label, "size-request", -- cgit v1.2.1