some minor changes allowing pango and xft to work together

This commit is contained in:
speedie 2023-03-08 21:19:38 +01:00
parent 21d75d806e
commit a988dc7108
6 changed files with 10 additions and 10 deletions

View file

@ -163,7 +163,11 @@ readargs(int argc, char *argv[])
else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */ else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
prompt = argv[++i]; prompt = argv[++i];
else if (!strcmp(argv[i], "-fn")) /* font or font set */ else if (!strcmp(argv[i], "-fn")) /* font or font set */
strcpy(font, argv[++i]); /* font[0] = argv[++i]; */ #if USEPANGO
strcpy(font, argv[++i]);
#else
strcpy(font[0], argv[++i]);
#endif
else if (!strcmp(argv[i], "-nmt")) /* normal mode text */ else if (!strcmp(argv[i], "-nmt")) /* normal mode text */
strcpy(normtext, argv[++i]); strcpy(normtext, argv[++i]);
else if (!strcmp(argv[i], "-imt")) { /* insert mode text */ else if (!strcmp(argv[i], "-imt")) { /* insert mode text */

View file

@ -96,14 +96,14 @@ xfont_free(Fnt *font)
} }
Fnt* Fnt*
drw_font_create(Drw* drw, const char font[], size_t fontcount) drw_font_create(Drw* drw, const char *font[], size_t fontcount)
{ {
Fnt *fnt = NULL; Fnt *fnt = NULL;
if (!drw || !font) if (!drw || !font)
return NULL; return NULL;
fnt = xfont_create(drw, font); fnt = xfont_create(drw, *font);
return (drw->font = fnt); return (drw->font = fnt);
} }

View file

@ -33,7 +33,7 @@ void drw_resize(Drw *drw, unsigned int w, unsigned int h);
void drw_free(Drw *drw); void drw_free(Drw *drw);
/* Fnt abstraction */ /* Fnt abstraction */
Fnt *drw_font_create(Drw* drw, const char font[], size_t fontcount); Fnt *drw_font_create(Drw* drw, const char *font[], size_t fontcount);
void drw_font_free(Fnt* set); void drw_font_free(Fnt* set);
unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup); unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup);
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup); void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup);

View file

@ -34,7 +34,7 @@ static int borderwidth = 2; /* Width of the border */
static int bordercentered = 1; /* Draw border only when centered */ static int bordercentered = 1; /* Draw border only when centered */
/* Font options */ /* Font options */
static char font[] = "Noto Sans Mono 8"; /* Font to draw text and Pango markup with. */ static char *font[] = "Noto Sans Mono 8"; /* Font to draw text and Pango markup with. */
/* Symbol options */ /* Symbol options */
static char *leftarrow = "<"; /* Left arrow, used to indicate you can move to the left */ static char *leftarrow = "<"; /* Left arrow, used to indicate you can move to the left */

View file

@ -2,7 +2,7 @@
# See LICENSE file for copyright details. # See LICENSE file for copyright details.
# spmenu version # spmenu version
VERSION = 0.2.1 VERSION = 0.2.2
# includes and libs # includes and libs
INCS = -I$(X11INC) -I$(FREETYPEINC) $(BDINC) `pkg-config --cflags xft $(PANGO_CONF) $(PANGO_XFT_CONF)` INCS = -I$(X11INC) -I$(FREETYPEINC) $(BDINC) `pkg-config --cflags xft $(PANGO_CONF) $(PANGO_XFT_CONF)`

View file

@ -5,10 +5,6 @@
* If you're looking for functions used to draw images, see 'libs/img.c' * If you're looking for functions used to draw images, see 'libs/img.c'
* If you're looking for the .Xresources array, see 'libs/xresources.h' * If you're looking for the .Xresources array, see 'libs/xresources.h'
* *
* To disable certain features, pass one or more of the following to the compiler:
*
* NOXINERAMA, NORTL, NOIMAGE
*
* You don't need to edit spmenu.c if you aren't making big changes to the software. * You don't need to edit spmenu.c if you aren't making big changes to the software.
* *
* After making changes, run 'make clean install' to install and 'make' to attempt a compilation. * After making changes, run 'make clean install' to install and 'make' to attempt a compilation.