• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

LICENSEH A D24-Sep-20171.2 KiB2419

README.markdownH A D24-Sep-20173.9 KiB11288

font-sizeH A D24-Sep-201714.9 KiB485280

README.markdown

1urxvt-font-size
2===============
3
4This is a perl extension for
5[rxvt-unicode](http://software.schmorp.de/pkg/rxvt-unicode.html) that allows
6changing the font size on the fly with keyboard shortcuts. It has the
7following features:
8
9-   Supports both xft and X11 fonts; X11 fonts work in both full form and as
10    aliases.
11-   Supports all four font settings: `font`, `boldFont`, `italicFont` and
12    `boldItalicFont` and changes them in accordance with the base font (the
13    first one from `font`).
14-   Can apply the font change globally for the whole server, so that new
15    terminals will inherit the same size, and even save it to `~/.Xresources`
16    to be able to survive a reboot.
17-   Should work even with complicated font setups like the example in the
18    urxvt man-page.
19
20Installation
21------------
22
23Put the `font-size` script into `$HOME/.urxvt/ext/` and add it to the list of
24enabled perl-extensions in `~/.Xresources`:
25
26```
27URxvt.perl-ext-common: ...,font-size
28```
29
30Note: if your urxvt version is older than 9.14 you will have to add the path
31to the script to the `URxvt.perl-lib` resource.
32
33The extension automatically binds Ctrl++ to the 'increase' function,
34Ctrl+- to 'decrease', and Ctrl+0 to 'reset'. To use the other available functions
35or change the keys, add some keybindings of your own:
36
37
38```
39URxvt.keysym.C-Up:     font-size:increase
40URxvt.keysym.C-Down:   font-size:decrease
41URxvt.keysym.C-S-Up:   font-size:incglobal
42URxvt.keysym.C-S-Down: font-size:decglobal
43URxvt.keysym.C-equal:  font-size:reset
44URxvt.keysym.C-slash:  font-size:show
45```
46Then load your new `~/.Xresources` to see the changes in the next terminal you open:
47
48```
49$ xrdb -merge ~/.Xresources
50```
51
52Note that for urxvt versions older than 9.21 the resources have to look like this:
53
54```
55URxvt.keysym.C-Up:     perl:font-size:increase
56URxvt.keysym.C-Down:   perl:font-size:decrease
57URxvt.keysym.C-S-Up:   perl:font-size:incglobal
58URxvt.keysym.C-S-Down: perl:font-size:decglobal
59URxvt.keysym.C-equal:  perl:font-size:reset
60URxvt.keysym.C-slash:  perl:font-size:show
61```
62
63The following functions are supported:
64
65-   `increase`/`decrease`: Increase or decrease the font size of the current
66    terminal.
67-   `incglobal`/`decglobal`: Same as above and also adjust the X server values
68    so all newly started terminals will use the same fontsize.
69-   `incsave`/`decsave`: Same as incglobal/decglobal and also modify the
70    `~/.Xresources` file so the changed font sizes will persist over a restart
71    of the X server or a reboot.
72-   `reset`: Reset the font size to the value of the resource when starting
73    the terminal.
74-   `show`: Show the current value of the `font` resource in a popup.
75
76You can also change the step size that the script will use to increase the
77font size:
78
79```
80URxvt.font-size.step: 4
81```
82
83The default step size is 1. This means that with this setting a size change
84sequence would be for example 8->12->16->20 instead of 8->9->10->11->12 etc.
85Please note that many X11 fonts are only available in specific sizes, though,
86and odd sizes are often not available, resulting in an effective step size of
872 instead of 1 in that case.
88
89Troubleshooting
90---------------
91
92At its core urxvt-font-size is just a fancy wrapper around the `ESC ] 710;Pt
93ST` (and 711/712/713 for bold, italic, and bold-italic) escape sequences. So
94if you are having trouble with this script please try the escape sequence
95directly like this (outside of a terminal multiplexer like screen or tmux):
96
97```
98$ echo -e "\033]710;fixed\033\\"
99```
100
101You can exchange `fixed` for any (single) font that you want to try, like for
102example `-xos4-terminus-medium-r-normal--12-120-72-72-c-60-iso10646-1`:
103
104```
105$ echo -e "\033]710;-xos4-terminus-medium-r-normal--12-120-72-72-c-60-iso10646-1\033\\"
106```
107
108If you can reproduce the problem this way then the problem does not lie with
109the urxvt-font-size script, but either directly with urxvt or some other
110component that may interfere (like for example a window manager). Please
111report the bug to those projects in that case.
112