]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Unix PuTTY/pterm: Ctrl-< / Ctrl-> to change font size.
authorSimon Tatham <anakin@pobox.com>
Sun, 13 Nov 2016 13:53:42 +0000 (13:53 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 13 Nov 2016 14:06:43 +0000 (14:06 +0000)
commit1a51771720f8263e138e67ba68b97549361ed340
treef542ae6a29c94e0a3853272016d1f9df4396a12e
parentd9c68d236bf501bb66d2da0bcebc34279690986b
Unix PuTTY/pterm: Ctrl-< / Ctrl-> to change font size.

Each gtkfont back end now provides a routine that will return the name
of a similar font to the current one but one notch larger or smaller.
For Pango, this is just a matter of incrementing the font size field
in a standard way; for X11 server-side fonts, we have to go and do an
XListFonts query with a wildcard that requests fonts that vary only in
the size fields from the current one, and then iterate over the result
looking for the best one.

(I expect this will be more useful to Pango scalable-font users than
to X11 fonts, but it seemed a shame not to give the X11 side my best
shot while I was at it.)

Choice of hotkey: I know I'm being inconsistent with gnome-terminal's
use of Ctrl-plus and Ctrl-minus. I thought that was because I was
already using Ctrl-minus as a more convenient synonym for
Ctrl-underscore (which sends the actual control code 0x1F), but now I
actually try it, apparently I'm not. However, Ctrl-plus and Ctrl-minus
are quite horrible as a keystroke pair anyway (one has to be typed
with shift and one without!), and I feel as if the 'less' and
'greater' signs are more specific anyway, in that they specifically
indicate _size_ rather than just 'unspecified numerical value'.
unix/gtkcompat.h
unix/gtkfont.c
unix/gtkfont.h
unix/gtkwin.c