1
0
mirror of https://github.com/gryf/urxvt-font.git synced 2026-03-19 04:13:31 +01:00
gryf 6b4622e55d Support for X11 bitmap font.
This change will introduce support for fixed, bitmap fonts. Unlike in
outline fonts, amount of sizes for bitmap fonts is declared up front.
Because of that fact, increasing/decreasing bitmap font size might look
awkward or even have no effect at all, depending on used font face.

This patch was successfully used against font-misc-misc from X.Org
package.
2020-01-18 17:38:00 +01:00
2020-01-18 17:38:00 +01:00

h2. About

urxvt is a great terminal emulator, but spending time on a mac made me miss the ability (in iTerm!) to dynamically resize text using ⌘+Plus and ⌘+Minus.  I was also thinking that it would be be nice if resizing the terminal font could be persisted to @Xresources@.  Turns out this was pretty easy to accomplish.

bc. urxvt.perl-lib:                     /path/to/urxvt-font
urxvt.keysym.Control-Shift-Up:      perl:font:increment
urxvt.keysym.Control-Shift-Down:    perl:font:decrement
urxvt.perl-ext-common:              font

Now, @Ctrl+Shift+<Up>@ and @Ctrl+Shift+<Down>@ will, respectively, enlarge and decrease the text size in a running urxvt window, *and* save the new font size to @~/.Xresources@, so that it's there for the next time you open a terminal window.  With the Monaco font, it's a poor man's iTerm.

h2. Modular font directives

I keep my fonts in a separate xresources file, which gets include by @~/.Xresources@.  This way I can version @~/.Xdefaults@ without dirtying the repository every time I change the terminal font size.  For this to work, the path defined by @X_RESOURCES@ in @font@ must contain something like this:

bc.  /* Fonts */
urxvt*boldColors: on
urxvt*font:     xft:Monaco:pixelsize=20:antialias=true:hinting=true:medium
urxvt*boldFont: xft:Monaco:pixelsize=20:antialias=true:hinting=true:bold
! vim:ft=xdefaults
Description
Resize fonts in a running urxvt process; save changes to $HOME/.Xresources
Readme 44 KiB
Languages
Perl 100%