From fb8e2339cee8ee8731cbedf6d05fdf2196b33754 Mon Sep 17 00:00:00 2001 From: Hans Koch Date: Sat, 19 Mar 2022 17:27:44 +0100 Subject: [PATCH] Added fallback XLFD font name, Removed dead code --- configure.h | 1 - mlvwm/config.c | 19 ++++++++++++++++--- mlvwm/event.c | 2 -- mlvwm/mlvwm.c | 3 +++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/configure.h b/configure.h index f6fedc4..3834a09 100644 --- a/configure.h +++ b/configure.h @@ -46,7 +46,6 @@ XCOMM #if HasLocale Locale_DEFINES = -DUSE_LOCALE - Loacle_INCLUDES = #if defined(FreeBSDArchitecture) && OSMajorVersion>1 && OSMinorVersion>1 Locale_LIBRARIES = -lxpg4 #endif /* End FreeBSD */ diff --git a/mlvwm/config.c b/mlvwm/config.c index 3fcfca6..9a6bd09 100644 --- a/mlvwm/config.c +++ b/mlvwm/config.c @@ -31,6 +31,8 @@ struct configure key_modifiers[]= {0,0} }; +#define FALLBACK_FONT "-*-*-*-r-*-*-*-*-*-*-*-*-*-*" + char *NoTitleStyle( styles *tmp_style, char *str ) { tmp_style->flags &= ~TITLE; @@ -577,10 +579,21 @@ XFontStruct **font, #endif #ifdef USE_LOCALE + asprintf(&fontname, "%s, %s", fontname, FALLBACK_FONT); newfont = XCreateFontSet( dpy, fontname, &miss, &n_miss, &def ); - if( n_miss>0 ){ - for( lp=0; lp0 ) { + if( Scr.flags & DEBUGOUT ) + { + fprintf( stderr, "Missing font encodings" ); + for( lp=0; lp -#define MAX_NAME_LEN 200L /* truncate to this many */ - extern int ShapeEventBase; extern void handle_expose( XEvent * ); diff --git a/mlvwm/mlvwm.c b/mlvwm/mlvwm.c index b39be9f..aae7d61 100644 --- a/mlvwm/mlvwm.c +++ b/mlvwm/mlvwm.c @@ -98,6 +98,9 @@ void LoadDefaultFonts( void ) char **miss, *def; int n_miss, lp; + if( Scr.flags & DEBUGOUT ) + fprintf( stderr, "Locale: %s\n", setlocale(LC_ALL, NULL)); + Scr.MenuBarFs = XCreateFontSet( dpy, DEFAULTFS, &miss, &n_miss, &def ); if( n_miss>0 ){ for( lp=0; lp