Font in LXPANEL too big

The standard panel of LXDE - http://wiki.lxde.org/en/LXPanel
canci
Posts: 6
Joined: Sat Mar 13, 2010 10:15 am

Font in LXPANEL too big

Post by canci »

Hi everyone! First of all, great compliments to this DE! It's the best out there at the moment!
Very snappy and responsive!

I have all my fonts changed to 7pt Sans, but the Lxpanel font is just too big and doesn't change.
I haven't seen an option anywhere, not in the wiki and not on this forum. Can any1 help me?
If it's not available at the moment, please tell me so I can report a wishlist in the Debian bug tracker.

Thank you all for your work and time!

EDIT: Also, if you consider introducing font sizes, it'd be cool if the clock font type and size could be set separately.

EDIT: Forgot the screenshot:

Image
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: Font in LXPANEL too big

Post by Marty Jack »

At the moment, the font scales with the icon size set in Panel Preferences/Geometry. Let me think about this a little and see if there is a way to take better account of the theme's font size in this calculation.

One of the ways of remaining lightweight is not to have too many options.
phillipe
Posts: 41
Joined: Mon Apr 27, 2009 4:12 pm

Re: Font in LXPANEL too big

Post by phillipe »

I don't know if you know how to compile the programs on your distro.
But I use the below command to patch the lxpanel ( panel.c ) source code.
With that, the fonts don't get bigger until you determine a value above of 36px.

Code: Select all

sed 's/p->icon_size < 26/p->icon_size <= 36/' -i src/panel.c
==> Phillipe Smith ( SmithuX ) <==
Email: phillipe@archlinux.com.br
WebSite: http://www.smithux.com
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: Font in LXPANEL too big

Post by Marty Jack »

I am starting to have misgivings about when we introduced font scaling before 0.5.0. This was shortly after we introduced the icon size control. The feedback was that if you turned the icon size up, the text size looked strange. My thinking was that if you turned the icon size up because you don't see well, you want the text to be bigger. But, it would be reasonable that you would then change the font size in your theme to be bigger, so all your text would be readable.

The other factor, of course, is that if you crush your panel down to 16 pixels, you want smaller text so it still fits in the panel.

Please help me understand what the right behavior is.
canci
Posts: 6
Joined: Sat Mar 13, 2010 10:15 am

Re: Font in LXPANEL too big

Post by canci »

Thank you all for your replies! I will definitely patch the panel, seems like a trivial thing.

As for the option, what about you test the supplied patch for 1 version and see if ppl complain?
I mean, it will still scale after 36px.

I knew the scaling wasn't there before! :D For a moment there I thought I was going crazy...

Thank you so much!
zebbeman
Posts: 1
Joined: Mon Mar 15, 2010 11:00 am

Re: Font in LXPANEL too big

Post by zebbeman »

Hi,
I am having the same problem. On three computers I have 3 behaviors, where one is perfect; one is way too big; and one too small. It would be great to have a font size setting exclusively for the panel.

Part from that, great panel!
canci
Posts: 6
Joined: Sat Mar 13, 2010 10:15 am

Re: Font in LXPANEL too big

Post by canci »

@phillipe: Thanks for your workaround, but it didn't help. Then I looked at panel.c and found out why. Here's the default one:

Code: Select all

        /* Compute an appropriate size so the font will scale with the panel's icon size. */
        int font_desc;
        if (p->icon_size < 20) 
            font_desc = 9;
        else if (p->icon_size >= 20 && p->icon_size < 26)
            font_desc = 10;
        else
            font_desc = 12;
As you can see, the minimum font size was too big, so I've changed them to these values:

Code: Select all

        /* Compute an appropriate size so the font will scale with the panel's icon size. */
        int font_desc;
        if (p->icon_size < 20) 
            font_desc = 7;
        else if (p->icon_size >= 20 && p->icon_size < 26)
            font_desc = 8;
        else
            font_desc = 12;
This way it will still resize, but be more compatible with desktops with smaller fonts.

Wow, I just did C... I feel soooooooo l33t now! ;)

Screenshot:

Image
phillipe
Posts: 41
Joined: Mon Apr 27, 2009 4:12 pm

Re: Font in LXPANEL too big

Post by phillipe »

Very nice canci!
The configuration that I posted is perfect for me.
But It's good to see that you made your own patch. ;)
==> Phillipe Smith ( SmithuX ) <==
Email: phillipe@archlinux.com.br
WebSite: http://www.smithux.com
rockdoctor
Posts: 116
Joined: Tue Nov 11, 2008 4:51 pm

Re: Font in LXPANEL too big

Post by rockdoctor »

Marty Jack wrote:I am starting to have misgivings about when we introduced font scaling before 0.5.0. This was shortly after we introduced the icon size control. The feedback was that if you turned the icon size up, the text size looked strange. My thinking was that if you turned the icon size up because you don't see well, you want the text to be bigger. But, it would be reasonable that you would then change the font size in your theme to be bigger, so all your text would be readable.

The other factor, of course, is that if you crush your panel down to 16 pixels, you want smaller text so it still fits in the panel.

Please help me understand what the right behavior is.
My vote is for an optional fontsize parameter in the lxpanel config file; if no fontsize parameter is present, default as is presently done.

Looking at the code in lxpanel-0.5.5-2.fc13.src.rpm, it appears that this will require:
1. modification of the Panel structure (panel.h) to accommodate the new parameter
2. some code to read fontsize (panel_parse_global() in panel.c)
3. modification of the code that currently sets font_desc (panel_draw_label_text() in panel.c) to bypass this code block if fontsize is explicitly given.
Geology - It's not rocket science, it's rock science!
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: Font in LXPANEL too big

Post by Marty Jack »

I have decided to go with the independent font size control. It does add an additional option, but I think it gives everyone a way to be happy. The default will be 10 pt. Thank you all for your opinions.

I have this working, but I cannot promise when it will come out. Because we have lots of language translations, we have to batch up new features that add strings to the user interface.
Locked