dwm

git clone git://mattcarlson.org/repos/dwm.git
Log | Files | Refs

commit 01506fa73236a0857d49919d19193ca0172a40aa
parent 3bc9a3613d7fc4abec4c5955d4e2a1bc37d6d10c
Author: Matthew Carlson <matt@mcarlson.xyz>
Date:   Tue, 27 Jul 2021 21:08:24 -0400

emoji support

Diffstat:
Mconfig.h | 50+++++++++++++++++++++++++-------------------------
Mdrw.c | 13-------------
2 files changed, 25 insertions(+), 38 deletions(-)

diff --git a/config.h b/config.h @@ -23,7 +23,7 @@ static int sidepad = 10; // fonts static char font[] = "monospace:size=10"; -static const char *fonts[] = { font }; +static const char *fonts[] = { font, "Noto Color Emoji:style=Regular:size=16" }; // colors static char normbgcolor[] = "#222222"; @@ -116,32 +116,32 @@ static const char *termcmd[] = { TERM, NULL }; // xresources ResourcePref resources[] = { - { "font", STRING, &font }, - { "normbgcolor", STRING, &normbgcolor }, + { "font", STRING, &font }, + { "normbgcolor", STRING, &normbgcolor }, { "normbordercolor", STRING, &normbordercolor }, - { "normfgcolor", STRING, &normfgcolor }, - { "selbgcolor", STRING, &selbgcolor }, - { "selbordercolor", STRING, &selbordercolor }, - { "selfgcolor", STRING, &selfgcolor }, - { "borderpx", INTEGER, &borderpx }, - { "snap", INTEGER, &snap }, - { "showbar", INTEGER, &showbar }, - { "topbar", INTEGER, &topbar }, - { "nmaster", INTEGER, &nmaster }, - { "resizehints", INTEGER, &resizehints }, - { "mfact", FLOAT, &mfact }, + { "normfgcolor", STRING, &normfgcolor }, + { "selbgcolor", STRING, &selbgcolor }, + { "selbordercolor", STRING, &selbordercolor }, + { "selfgcolor", STRING, &selfgcolor }, + { "borderpx", INTEGER, &borderpx }, + { "snap", INTEGER, &snap }, + { "showbar", INTEGER, &showbar }, + { "topbar", INTEGER, &topbar }, + { "nmaster", INTEGER, &nmaster }, + { "resizehints", INTEGER, &resizehints }, + { "mfact", FLOAT, &mfact }, { "swallowfloating", INTEGER, &swallowfloating }, - { "gappih", INTEGER, &gappih }, - { "gappiv", INTEGER, &gappiv }, - { "gappoh", INTEGER, &gappoh }, - { "gappov", INTEGER, &gappov }, - { "smartgaps", INTEGER, &smartgaps }, - { "vertpad", INTEGER, &vertpad }, - { "sidepad", INTEGER, &sidepad }, - { "ulinepad", INTEGER, &ulinepad }, - { "ulinestroke", INTEGER, &ulinestroke }, - { "ulinevoffset", INTEGER, &ulinevoffset }, - { "ulineall", INTEGER, &ulineall }, + { "gappih", INTEGER, &gappih }, + { "gappiv", INTEGER, &gappiv }, + { "gappoh", INTEGER, &gappoh }, + { "gappov", INTEGER, &gappov }, + { "smartgaps", INTEGER, &smartgaps }, + { "vertpad", INTEGER, &vertpad }, + { "sidepad", INTEGER, &sidepad }, + { "ulinepad", INTEGER, &ulinepad }, + { "ulinestroke", INTEGER, &ulinestroke }, + { "ulinevoffset", INTEGER, &ulinevoffset }, + { "ulineall", INTEGER, &ulineall }, }; // keys diff --git a/drw.c b/drw.c @@ -136,19 +136,6 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) die("no font specified."); } - /* Do not allow using color fonts. This is a workaround for a BadLength - * error from Xft with color glyphs. Modelled on the Xterm workaround. See - * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 - * https://lists.suckless.org/dev/1701/30932.html - * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 - * and lots more all over the internet. - */ - FcBool iscol; - if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { - XftFontClose(drw->dpy, xfont); - return NULL; - } - font = ecalloc(1, sizeof(Fnt)); font->xfont = xfont; font->pattern = pattern;