Author Topic: LXpanel's Digital Clock Font  (Read 2659 times)

Offline princethrash

  • Jr. Member
  • **
  • Posts: 22
LXpanel's Digital Clock Font
« on: February 05, 2012, 01:07:33 PM »
You can change the Digital Clock applet settings in LXpanel by changing the font for the entire LXpanel.  This effects the task bar AND the clock. 

I was wondering if anyone knows how to *only* change the clock font, and not anything else.

Offline JNibski

  • Full Member
  • ***
  • Posts: 154
Re: LXpanel's Digital Clock Font
« Reply #1 on: February 05, 2012, 09:19:15 PM »
..........I believe the actual font is set to "BOLD" in the digital clock settings GUI....

Right clik on the time> Digital Clock Settings>(left clik)

To see am/pm time use this exact code:  %l:%M %P

There might be a place in the OPENBOX 'code' to change the actual FONT TYPE.

Maybe Leiche , Melanie, or somebody else knows where exactly that is....

I for one would also like to know how to make it (just the time font) - 'larger'.....for those of us with vision problems...

JN.
"Don't stare at an OJ can just because it says 'concentrate'..."

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXpanel's Digital Clock Font
« Reply #2 on: February 06, 2012, 03:56:42 AM »
JNibski,     
lxdecc > Configure Openbox >>> Appearance     

Offline princethrash

  • Jr. Member
  • **
  • Posts: 22
Re: LXpanel's Digital Clock Font
« Reply #3 on: February 06, 2012, 08:01:56 AM »
Yes, it can be set to bold, but this is not a true change of font type.

Clock codes are not font types.

I could be wrong, but I do not believe openbox settings will effect lxpanel, and if they do, they will change all of lxpanel (such as the task bar) and not just the clock.

 

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXpanel's Digital Clock Font
« Reply #4 on: February 06, 2012, 08:05:27 AM »
Clock font is the same as the other panel font. Obconf sets system fonts.     

Offline JNibski

  • Full Member
  • ***
  • Posts: 154
Re: LXpanel's Digital Clock Font
« Reply #5 on: February 06, 2012, 11:08:41 AM »
JNibski,    
lxdecc > Configure Openbox >>> Appearance    

..........Thank you NMB...I think i came across this scenario before.  This is on an old install with "clearlooks" as the theme, and i set all the fonts to #14, but the CLOCK font did'nt budge....I think its in the actual code {i had to change before}  not just the obconf GUI. :-\

To view the files - i saw the document tree in : file:///home/name/.config/openbox/lxde-rc.xml

and it states: " Do not edit this file, it will be overwritten on install.
        Copy the file to $HOME/.config/openbox/ instead. "

fyi : ObConf 2.0.4 version.  ... This install is completely updated to today.  

Its not that important, but princethrash had asked also.

..Neal, you say CLOCK FONT is the same as the other panel font = WHICH is "the other panel font"?  I tried them all {at #14} with the default "sans"... ???

....Maybe the login name SIZE can be changed in a way also?

JN
« Last Edit: February 06, 2012, 11:10:58 AM by JNibski »
"Don't stare at an OJ can just because it says 'concentrate'..."

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXpanel's Digital Clock Font
« Reply #6 on: February 06, 2012, 11:11:43 AM »
Oops. I meant system font. ::)     

BTW, newest obconf is not 2.0.4. It is 2.0.3.     
« Last Edit: February 06, 2012, 11:15:09 AM by Neal ManBear »

Offline JNibski

  • Full Member
  • ***
  • Posts: 154
Re: LXpanel's Digital Clock Font
« Reply #7 on: February 06, 2012, 10:19:21 PM »

Thank you Neal, for your rapid reply...
........on my laptop (stock lxde install)  shows this :

----BUT in synaptic says : 2.0.3-9pclos2011-366kb...etc.   

{Don"t want to get off topic, but my senior buddy's desktop shows the same.}

In LXDE i hav'nt found a GUI to change the clock font size... :-\

...maybe thats what princethrash is referring to, also...

I recall in other distros (eg; mepis) the clock fonts could be easily customized/changed...maybe even in the pclos KDE version -I'll have to download the newest, to see -i'm a little behind in my life, and have limited internet access.

BUT I also realize that LXDE is called 'LIGHTWEIGHT' for certain reasons, and not quite as full featured...it is a very decent o/s though, for the elderly -who just check email and you tubes... ;)

JN

"Don't stare at an OJ can just because it says 'concentrate'..."

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LXpanel's Digital Clock Font
« Reply #8 on: February 06, 2012, 10:32:34 PM »
Right click the clock - clock settings - bold font. That's the extent of it.     

Offline princethrash

  • Jr. Member
  • **
  • Posts: 22
Re: LXpanel's Digital Clock Font
« Reply #9 on: February 07, 2012, 09:11:44 AM »
Looking at the lxpanel source code, in dclock.c, I see:

Code: [Select]
gchar * utf8 = g_locale_to_utf8(((newlines_converted != NULL) ? newlines_converted : output), -1, NULL, NULL, NULL);
        if (utf8 != NULL)
        {
            panel_draw_label_text(dc->plugin->panel, dc->clock_label, utf8, dc->bold, TRUE);
            g_free(utf8);
        }
        g_free(newlines_converted);


And then I see from this tutorial at http://developer.gnome.org/gtk/2.24/gtk-question-index.html


Quote
1.12.

How do I draw text ?

To draw a piece of text, use a Pango layout and gdk_draw_layout(), using code like the following:

layout = gtk_widget_create_pango_layout (widget, text);
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
pango_layout_set_font_description (layout, fontdesc);
gdk_draw_layout (..., layout);
pango_font_description_free (fontdesc);
g_object_unref (layout);
Do not use the deprecated GdkFont and gdk_draw_text().


It is possible that setting the font can be done easily from within the source code, because that program is so very short.  I am only associated with Python, and only at a novice level.  But I wouldn't be surprised if this is doable with 1 to 3 lines of code.

I'm concerned I haven't provided the beginnings of an answer, though, because there is no mention of "pango" elsewhere in the code.
« Last Edit: February 07, 2012, 09:14:52 AM by princethrash »

Offline JNibski

  • Full Member
  • ***
  • Posts: 154
Re: LXpanel's Digital Clock Font
« Reply #10 on: February 07, 2012, 10:16:25 AM »
Princethrash,.....I see you are determined.  I believe there is a way to "manipulate' the code, as in OPENBOX...but i sort of remember while working with an immature OPENBOX that this question came up....

ka9yhd, and melodie were working on it, but i gravitated to LXDE due to the more complete product at the time...

I will contac them to see if it was POSSIBLE, and if they ever found a solution, and report it here.

I did a search of : 'LXDE clock size font' and saw this older post with MANY interested....(over 1000)...  this info may not apply to our newest version , though. :-\

JN
"Don't stare at an OJ can just because it says 'concentrate'..."

Offline princethrash

  • Jr. Member
  • **
  • Posts: 22
Re: LXpanel's Digital Clock Font
« Reply #11 on: February 07, 2012, 10:42:24 AM »
Interesting, this needs a whole font interface, but if the size is played with it may do odd things since it is linked with tray/bar icon size.  Then again, strange things are good.

The clock inherits everything from somewhere else:  its color and size from lxpanel, its font from Openbox (system-wide).  The fact the only control it has over itself is whether or not to bold the font is strange. 

But, since we know it can be exclusively bolded without effecting the rest of the bar, we can certainly exclusively change its other properties. 

Thanks for your help, JNibski, I'm going to continue looking at the source

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: LXpanel's Digital Clock Font
« Reply #12 on: February 07, 2012, 10:53:15 AM »
Hi,
JNibski, no way... sorry to deceive you but it is not possible, as far as I know. I just started a Lxde test I have and looked into the configuration file, and tried to add a parameter, then change the size of the panel and icons. What Neal says is the only known possibility.

See here:
http://wiki.lxde.org/en/LXPanel

However, what about the future ? I am registered at the LXDE devel list, to keep aware of what is going on there. I appears that Lxpanel is very buggy, that several distros have patched it, without ever providing their patches upstream. This has been discussed on the list, then at a later post pcman said he is going to rework the code, and create a Lxpanel2 at some point in the future. This is where you can do something : you can go to the place where there are feature requests, and ask for a re-sizable clock as plugin for Lxpanel. Or for a separate clock which can  be added and could allow tweaking it at will.

What about installing a clock on the desktop in the meanwhile ? Maybe it would allow seeing what time is it ? bigger ? Some of them : oclock, sunclock, xclock, tzclock... (list extracted from the output of the command "apt-cache search clock").

Regards,
Mélodie

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline JNibski

  • Full Member
  • ***
  • Posts: 154
Re: LXpanel's Digital Clock Font
« Reply #13 on: February 07, 2012, 08:01:53 PM »
Melodie.........THANK YOU VERY MUCH FOR THAT IMPORTANT SPECIFIC INFORMATION!  :-* I knew you were familiar with the particulars, and to have you explain here was very helpful.
Now I/we have a reference for the LXDE "FILE LOCATIONS", and it's limitations... ;)
Its not that i'm in disagreement with Neal, but i had tried to work on this clock font scenario in Openbox many moons ago- and thought maybe something was compiled differently by now... :-\
Maybe princethrash and i can put in a request...
Quote
---pcman said he is going to rework the code, and create a Lxpanel2 at some point in the future....................you can go to the place where there are feature requests
 
Are you talking about LXDE.org or HERE at pclos? ???

Thanks for the reply - keep up the great work!

JN.
« Last Edit: February 07, 2012, 08:13:08 PM by JNibski »
"Don't stare at an OJ can just because it says 'concentrate'..."

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: LXpanel's Digital Clock Font
« Reply #14 on: February 07, 2012, 08:50:30 PM »
Hi Jon,
pcman is the nick of PCManFM's developer and main head of the Lxde project. So I am talking about "at LXDE". :)

upstream if you like it better. Here is the page for feature requests, if you want to give it a try.
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode