GtkEntry change font size, can it be done in the XML?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, here's additional info about the app. Because it accesses GPIO, it needs to be run with sudo, unless I can figure out the right priviledge to run it as normal user. So, maybe the sudo causes it to not use the regular user's .gtkrc-2.0 file. I tried to put these files in the /root directory, but that didn't seem to have an effect. Gtk does not permit you to make the program owned by root:root and set for u+s file permissions.
I have split another app into two parts and have them communicate via rpc, but that was quite complicated.
Another issue is that the system seems to have at least part of gtk3.0 installed, In /usr/lib, I see such files as libseed-gtk3.so.0 and seed-gtk3
but I don't see libgtk-3.0 (or libgtk-2.0 either) so I must be looking in the wrong place.
I do not have strace on this system, or at least, don't know how to use it.
This is a Beagle Board running :
3.2.19-x13 #1 SMP Tue Jun 5 08:48:31 UTC 2012 armv7l armv7l armv7l GNU/Linux
At one point I did get it to change the fonts of the toolbar in emacs, but now that is not happening. I think it was one of the .gtkrc-3.0 files that did that. I'm guessing that the font I am calling out with gtk-font-name = is the wrong syntax. Can you suggest how to format what you get with fc-list to make a good .gtkrc-2.0 file?
Here's what fc-list gives :
DejaVu Sans:style=Bold
DejaVu Sans:style=Book
DejaVu Sans Mono:style=Book
DejaVu Sans Mono:style=Bold
DejaVu Serif:style=Book
DejaVu Serif:style=Bold
Thanks much for your help so far!
Jon
strace would make debugging this problem trivial.
Ed
Astonishingly, this did nothing. I created files /usr/share/gtk-2.0/gtkrc and .gtkrc with gtk-font-name = "DejaVu Sans 32"
in them, and there is no change! I also put the same files under /usr/share/gtk-3.0, still no difference.
OK, one thing to note is that the embedded system is NOT running an X windows server. I connect to it either with a MS Windows system with putty and xming, or a Linux system that IS running X Windows. Maybe the issue is all on those X server systems.
The system does have :/usr/lib/arm-linux-gnueabihf/libgtk-3-0:
total 64
drwxr-xr-x 2 root root 4096 Jun 18 2012 .
drwxr-xr-x 35 root root 24576 Jun 18 2012 ..
-rwxr-xr-x 1 root root 9808 May 21 2012 gtk-query-immodules-3.0
-rwxr-xr-x 1 root root 22556 May 21 2012 gtk-update-icon-cache-3.0
but I'm not sure that is the whole gtk-3.0 library.
There is also :
usr/lib/arm-linux-gnueabihf/libgtk-3.so.0.400.2 which is a 3 mb file, so it looks like gtk-3 is available. I just have to
hack the Makefile to link to it.
OK, so now I am trying to build the app with gtk-3.0
Previously, I had this in the Makefile:
COMMONSW = -c -D__unix__ `pkg-config --cflags --libs gtk+-2.0 libglade-2.0` -export-dynamic
OPTSW = -g $(COMMONSW)
LDFLAGS = -Wall -g `pkg-config --cflags --libs gtk+-2.0 libglade-2.0` -export-dynamic
clean:
rm -f *.o
[/code]
But, I get this error:
Package gtk-3.0 was not found in the pkg-config search path.
OK, so this gtk+-2.0 syntax must be something special for make, when I put in gtk+-3.0 it started pulling in the gtk 3.0 files, but then I run into lots of version compatabilty errors. Looks like a HUGE mess. I'm not sure I can handle that big a conversion.
Any suggestions to make it easier?
Thanks,
Jon
Well, here's some new info, now that the app is linked with gtk3.0 :
scaler:884): Gtk-WARNING **: Failed to parse /root/.config/gtk-3.0/settings.ini: Key file contains line 'style "user-font"' which is not a key-value pair, group, or comment
(scaler:884): Gtk-WARNING **: Theme parsing error: gtk.css:6:17: Junk at end of value
New, I have this in /root/.config/gtk-3.0/settings.ini :
[Settings]
gtk-application-prefer-dark-theme = false
gtk-theme-name = Zukitwo
gtk-fallback-icon-theme = gnome
gtk-icon-theme-name = Faenza-Dark
gtk-font-name = DejaVu Sans 36
And, it gets rid of the first 2 warning messages, but the 3rd one about gtk-keys.css remains. So far, I have not found this file.
But, it still doesn't change the font size of the app.
Thanks,
Well, I have not solved anything yet. To make it simpler, I am running the app logged directly into root, so as to avoid any effects that sudo might cause. I have put this is the /root/.config/gtk-3.0/settings.ini file :
[Settings]
gtk-font-name = DejaVu Sans 36
I don't get any error on this, but it seems to have no effect on anything. If I do botch the syntax, I do get an error, but if I put gibberish in the font name, there is no error.
If I could just set all displayed fonts to be larger, that would solve the issue, this embedded computer is just to run one program and serve a GUI over ssh.
The program gsettings DOES exist there, but I am still trying to find where the default font/size is set.
Thanks for any hints,
Jon
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.