diff options
-rw-r--r-- | Makefile | 25 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | config.def.h | 2 | ||||
-rw-r--r-- | contrib/logo/wterm.svg | 6 | ||||
-rw-r--r-- | include/wld/wld-private.h | 11 | ||||
-rw-r--r-- | include/wld/wld.h | 1 | ||||
-rw-r--r-- | src/st.c | 2 | ||||
-rw-r--r-- | src/wld/font.c | 6 |
8 files changed, 42 insertions, 19 deletions
@@ -32,6 +32,8 @@ SOURCES += $(WAYLAND_SRC) OBJECTS = $(SOURCES:.c=.o) +BIN_PREFIX = $(PREFIX) +SHARE_PREFIX = $(PREFIX) all: wterm @@ -52,7 +54,24 @@ wterm: $(OBJECTS) clean: rm -f $(OBJECTS) $(HDRS) $(WAYLAND_SRC) include/config.h -install: wterm +install-icons: + mkdir -p $(SHARE_PREFIX)/share/icons/hicolor/scalable/apps/ + cp contrib/logo/wterm.svg $(SHARE_PREFIX)/share/icons/hicolor/scalable/apps/wterm.svg + mkdir -p $(SHARE_PREFIX)/share/icons/hicolor/128x128/apps/ + cp contrib/logo/wterm.png $(SHARE_PREFIX)/share/icons/hicolor/128x128/apps/wterm.png + +install-bin: wterm tic -s wterm.info - mkdir -p $(PREFIX)/bin/ - cp wterm $(PREFIX)/bin/ + mkdir -p $(BIN_PREFIX)/bin/ + cp wterm $(BIN_PREFIX)/bin/ + +install: install-bin install-icons + +uninstall-icons: + rm -f $(SHARE_PREFIX)/share/icons/hicolor/128x128/apps/wterm.png + rm -f $(sHARE_PREFIX)/share/icons/hicolor/scalable/apps/wterm.svg + +uninstall-bin: + rm -f $(BIN_PREFIX)/bin/wterm + +uninstall: uninstall-bin uninstall-icons @@ -16,9 +16,13 @@ originally made by suckless. * pixman * libdrm -## Install +## build - make clean install + make + +## install + + sudo make install See the man page for additional details. diff --git a/config.def.h b/config.def.h index 8c6f41c..b55e34c 100644 --- a/config.def.h +++ b/config.def.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false"; +static char font[] = "Ubuntu Mono:pixelsize=14:antialias=true:hinting=true:hintstyle=hintfull"; static int borderpx = 2; /* diff --git a/contrib/logo/wterm.svg b/contrib/logo/wterm.svg index 8387c4d..a9359ac 100644 --- a/contrib/logo/wterm.svg +++ b/contrib/logo/wterm.svg @@ -9,14 +9,14 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - height="512" - width="512" + height="64" + width="64" id="svg3164" version="1.1" inkscape:version="0.91 r13725" viewBox="0 0 64 64" sodipodi:docname="wterm.svg" - inkscape:export-filename="/home/jeff/git/wterm/wterm-logo.svg.png" + inkscape:export-filename="/home/jeff/git/wterm/contrib/logo/wterm.png" inkscape:export-xdpi="180" inkscape:export-ydpi="180"> <defs diff --git a/include/wld/wld-private.h b/include/wld/wld-private.h index e812b11..dd25984 100644 --- a/include/wld/wld-private.h +++ b/include/wld/wld-private.h @@ -34,12 +34,8 @@ #include FT_BITMAP_H #define ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0]) -#if ENABLE_DEBUG -# define DEBUG(format, ...) \ - fprintf(stderr, "# %s: " format, __func__, ## __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif + +#define DEBUG(...) if(getenv("WTERM_DEBUG")) { fprintf(stderr, "%s:%d ", __FILE__, __LINE__); fprintf(stderr, __VA_ARGS__); } #define EXPORT __attribute__((visibility("default"))) #define CONTAINER_OF(ptr, type, member) \ @@ -53,7 +49,8 @@ struct wld_font_context { - FT_Library library; + FT_Library library; + FcConfig * config; }; struct glyph diff --git a/include/wld/wld.h b/include/wld/wld.h index c36081c..23daee7 100644 --- a/include/wld/wld.h +++ b/include/wld/wld.h @@ -28,6 +28,7 @@ #include <stdint.h> #include <pixman.h> #include <fontconfig/fontconfig.h> +#include <stdio.h> #define WLD_USER_ID (0xff << 24) @@ -2850,7 +2850,7 @@ tputc(Rune u) void tresize(int col, int row) { - int i; + int i; int minrow = MIN(row, term.row); int mincol = MIN(col, term.col); int *bp; diff --git a/src/wld/font.c b/src/wld/font.c index a43c3e6..23992fc 100644 --- a/src/wld/font.c +++ b/src/wld/font.c @@ -35,6 +35,8 @@ struct wld_font_context * wld_font_create_context() if (!context) goto error0; + context->config = FcInitLoadConfigAndFonts(); + if (FT_Init_FreeType(&context->library) != 0) { DEBUG("Failed to initialize FreeType library\n"); @@ -67,10 +69,10 @@ struct wld_font * wld_font_open_name(struct wld_font_context * context, DEBUG("Opening font with name: %s\n", name); pattern = FcNameParse((const FcChar8 *) name); - FcConfigSubstitute(NULL, pattern, FcMatchPattern); + FcConfigSubstitute(context->config, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); - match = FcFontMatch(NULL, pattern, &result); + match = FcFontMatch(context->config, pattern, &result); if (!match) return NULL; |