GTKMan Font Size

If you have any suggestions or ideas about improving Salix, here's the place to post them.
Post Reply
User avatar
jayseye
Posts: 233
Joined: 24. Jul 2011, 17:22
Location: Brownsmead, Oregon (Center of the Universe)

GTKMan Font Size

Post 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
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: GTKMan Font Size

Post 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.
Image
Image
User avatar
jayseye
Posts: 233
Joined: 24. Jul 2011, 17:22
Location: Brownsmead, Oregon (Center of the Universe)

Re: GTKMan Font Size

Post 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. :?:
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: GTKMan Font Size

Post by gapan »

Something like:

Code: Select all

gtk-font-name = "DejaVu Sans 10"
Image
Image
User avatar
jayseye
Posts: 233
Joined: 24. Jul 2011, 17:22
Location: Brownsmead, Oregon (Center of the Universe)

Re: GTKMan Font Size

Post 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
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: GTKMan Font Size

Post by gapan »

If you can supply such a patch to introduce a font selection dialog, by all means, go ahead.
Image
Image
Post Reply