Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-07-13 00:25:59

lbndwomy
Member
Registered: 2018-07-12
Posts: 1

Problem with text size in Genmon plugin

I noticed that my genmon plugin's text sizes weren't being affected by my system font size settings (I have it set to size 11 SF Pro Text in XFCE's Appearance settings). I realized it is set by the right click options on the genmon plugin; however, if I set it to the same font & size 11 as my system settings, it is smaller than it should be.

I was testing to try and see what size it was outputting if I chose a font size with pango markup AND the same text with no pango and just inheriting the size from genmon's right click settings, and I found that if I set it to 9.2 with Pango markup it would roughly match the "size 11" font set via right click options.

<span font='SF Pro Text 9.2'>Test Text</span><span font='SF Pro Text'>Test Text</span>

Screenshot_2018_07_12_20_03_37.png
^ So the left string is set to size 9.2 with pango, and the right is inheriting "size 11" from the right click settings in Genmon

Setting it to 11 with Pango markup would make it match the system settings, and, for example, the digital clock which seems to inherit sizing from system settings as well.

Could the right click option for text size be using px instead of pt (or whatever the system settings use as a unit of measurement)? That's the only thing I could think of that would be causing these discrepancies.

Edit: Here is another example, choosing px, pt, and just size# values in pango, as well as right click options in Genmon.

Screenshot_2018_07_12_20_39_48.png

It appears that instead of using the unit value from system settings the genmon size is indeed 'px' size values. I think it would be better to change the unit size to match the system setting unit size, or at least specify that it's using 'px' as units and give the option to change size units.

Last edited by lbndwomy (2018-07-13 00:52:15)

Offline

#2 2018-07-13 01:25:43

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,492

Re: Problem with text size in Genmon plugin

Hello and welcome.

I will have a look into this. In the meantime, what version of the plugin are you using?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-07-14 12:56:50

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,492

Re: Problem with text size in Genmon plugin

Are you able to build from source and test out this patch? It changes the font to use pt instead of px.

diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 0eba91c..18e9900 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -537,7 +537,7 @@ static int SetMonitorFont (void *p_pvPlugin)
   font = pango_font_description_from_string(poConf->acFont);
   if (G_LIKELY (font))
   {
-    css = g_strdup_printf("label { font-family: %s; font-size: %dpx; font-style: %s; font-weight: %s }",
+    css = g_strdup_printf("label { font-family: %s; font-size: %dpt; font-style: %s; font-weight: %s }",
                           pango_font_description_get_family (font),
                           pango_font_description_get_size (font) / PANGO_SCALE,
                           (pango_font_description_get_style(font) == PANGO_STYLE_ITALIC ||

Note that the plugin doesn't have any capability for noticing system-wide font changes and adjusting it's own font usage. You need to make the change manually.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.006 seconds, 8 queries executed - Memory usage: 530.36 KiB (Peak: 531.64 KiB) ]