Page 1 of 1

GTKMan Font Size

Posted: 26. Sep 2011, 08:24
by jayseye
A convenient enhancement to GTKMan, Salix's manpage reader, would be the ability to select the font size.

Currently the system 'monospace' font family is used. In Salix Fluxbox 13.37 I've yet to find a way to configure the system's default font size. As a first try, around line 299 in the /usr/bin/gtkman python script, this patch works for me:

Code: Select all

-		self.textview_manpage.modify_font(pango.FontDescription('monospace'))
+		self.textview_manpage.modify_font(pango.FontDescription('monospace 14'))
YMMV for the particular font size and, of course, an interactive font selection dialog might be the best long-term solution.

Meanwhile it might be quicker to add logic to check the config file for a [Font] section and, if present, use the settings found there. Then users could manually edit ~/.config/gtkman instead of hacking the code itself. Is there a more appropriate (system-wide) solution?

If anyone else is interested, I'd be willing to take on the task, unless the devs have the time and energy.

jayseye

Re: GTKMan Font Size

Posted: 26. Sep 2011, 11:49
by gapan
There is no "monospace" font family. "monospace" is just an alias for the system default monospace font (which in salix defaults to dejavu sans mono) and that's exactly what gtkman uses. The default font and font size are set in your ~/.gtkrc-2.0 file. You'll need to restart X for any changes to take place.

Re: GTKMan Font Size

Posted: 26. Sep 2011, 12:06
by jayseye
Thanks, gapan -

The ~/.gtkrc-2.0 file under Salix 13.37 Fluxbox contains just 3 lines:

Code: Select all

gtk-print-preview-command = "epdfview %f"
gtk-theme-name = "Clearlooks"
gtk-icon-theme-name = "gnome-brave"
gapan wrote:The default font and font size are set in your ~/.gtkrc-2.0 file.
More detail about setting the default font / size would be great. :?:

Re: GTKMan Font Size

Posted: 26. Sep 2011, 12:25
by gapan
Something like:

Code: Select all

gtk-font-name = "DejaVu Sans 10"

Re: GTKMan Font Size

Posted: 26. Sep 2011, 15:32
by jayseye
Yes, that's a great solution to the side question of how to control the default font. Menus etc. will be easier for blurry eyes to navigate at 11- or 12-point type instead of 10. Much appreciated, gapan. 8-)

More fine-grained control of font size is helpful for reading through a lot of text, such as the display of man pages in GTKMan. The added flexibility of an even larger font (14-point in my case) for text blocks keeps menus, and other widgets, down to a reasonable size.

If other users have a similar need, I'd submit a small patch to support font selection, as mentioned in the first post. Otherwise the original hack there works well enough for me. ;)

Thanks again,
jayseye

Re: GTKMan Font Size

Posted: 26. Sep 2011, 16:28
by gapan
If you can supply such a patch to introduce a font selection dialog, by all means, go ahead.