diff options
| author | Nikita Langer <nikitalanger@icloud.com> | 2026-05-31 15:33:29 +0200 |
|---|---|---|
| committer | Nikita Langer <nikitalanger@icloud.com> | 2026-05-31 15:33:29 +0200 |
| commit | 066416f76425a2784ef880826f47ad7b5fac7d43 (patch) | |
| tree | 3b0ccd97f400b03dd1847011b975238be64fa402 /x.c | |
| parent | 22c5f5f866d967d3d41f651c14f3a2fd11da0038 (diff) | |
| download | st-066416f76425a2784ef880826f47ad7b5fac7d43.tar.gz st-066416f76425a2784ef880826f47ad7b5fac7d43.tar.bz2 st-066416f76425a2784ef880826f47ad7b5fac7d43.tar.xz st-066416f76425a2784ef880826f47ad7b5fac7d43.zip | |
Cycle Fonts
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -60,6 +60,7 @@ static void zoom(const Arg *); static void zoomabs(const Arg *); static void zoomreset(const Arg *); static void ttysend(const Arg *); +static void cyclefonts(const Arg *); /* config.h for applying patches and the configuration. */ #include "config.h" @@ -337,11 +338,7 @@ void zoomreset(const Arg *arg) { Arg larg; - - if (defaultfontsize > 0) { - larg.f = defaultfontsize; - zoomabs(&larg); - } + zoomabs(&larg); } void @@ -350,6 +347,17 @@ ttysend(const Arg *arg) ttywrite(arg->s, strlen(arg->s), 1); } +void +cyclefonts(const Arg *arg) +{ + currentfont++; + currentfont %= (sizeof fonts / sizeof fonts[0]); + usedfont = fonts[currentfont]; + Arg larg; + larg.f = usedfontsize; + zoomabs(&larg); +} + int evcol(XEvent *e) { @@ -1299,7 +1307,7 @@ xinit(int cols, int rows) if (!FcInit()) die("could not init fontconfig.\n"); - usedfont = (opt_font == NULL)? font : opt_font; + usedfont = (opt_font == NULL)? fonts[currentfont] : opt_font; xloadfonts(usedfont, 0); /* colors */ |
