]> git.madduck.net Git - etc/zsh.git/blob - .zsh/zshrc/85_termfonts

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

fix symlink creation for cdt.latest
[etc/zsh.git] / .zsh / zshrc / 85_termfonts
1 # zshrc/80_termfonts
2 #
3 # provide helper methods to increase/decrease fonts from the command line
4 #
5 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
7 #
8 # Source repository: git://git.madduck.net/etc/zsh.git
9 #
10
11 typeset -ga _XTERM_FONTS
12 #_XTERM_FONTS+=-misc-fixed-medium-r-normal--6-60-75-75-c-40-iso10646-1
13 #_XTERM_FONTS+=-misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1
14 #_XTERM_FONTS+=-misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1
15 #_XTERM_FONTS+=-misc-fixed-medium-r-normal--9-90-75-75-c-60-iso10646-1
16 #_XTERM_FONTS+=-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
17 _XTERM_FONTS+=-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
18 #_XTERM_FONTS+=-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1
19 _XTERM_FONTS+=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
20 #_XTERM_FONTS+=-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
21 _XTERM_FONTS+=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
22 _XTERM_FONTS+=-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
23 _XTERM_FONTS+='-*-lucidatypewriter-*-*-*-*-26-*-*-*-*-*-iso10646-1'
24 _XTERM_FONT=${_XTERM_FONT:=1}
25
26 _set_xterm_font() {
27   if [ $1 -lt 1 ]; then
28     warn "no smaller font available"
29     _XTERM_FONT=1
30     return 1
31   elif [ $1 -gt $#_XTERM_FONTS ]; then
32     warn "no larger font available"
33     _XTERM_FONT=$#_XTERM_FONTS
34     return 1
35   fi
36   _XTERM_FONT=$1
37   info "selecting font: $_XTERM_FONTS[$_XTERM_FONT]"
38   echo -en "\033]50;$_XTERM_FONTS[$1]\007"
39 }
40 #_set_xterm_font $_XTERM_FONT 2>/dev/null
41
42 f++() { _set_xterm_font $((_XTERM_FONT + 1)) }
43 f--() { _set_xterm_font $((_XTERM_FONT - 1)) }
44 f0() { _set_xterm_font 1 }
45 fx() { _set_xterm_font $#_XTERM_FONTS }
46
47 # vim:ft=zsh