Merge pull request #31 from Hammster/fallback-font-loading

"Added fallback XLFD font name, Removed dead code" by Hans Koch
This commit is contained in:
Morgan Aldridge 2024-08-25 12:11:31 -04:00 committed by GitHub
commit 6bcb838940
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 6 deletions

View File

@ -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 */

View File

@ -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; lp<n_miss; lp++ )
DrawErrMsgOnMenu( "Load miss font ", miss[lp] );
if( Scr.flags & DEBUGOUT )
fprintf( stderr, "Loading fontset %s\n", fontname );
if( n_miss>0 ) {
if( Scr.flags & DEBUGOUT )
{
fprintf( stderr, "Missing font encodings" );
for( lp=0; lp<n_miss; lp++ )
fprintf( stderr, "%s;", miss[lp] );
fprintf( stderr, "\n" );
}
XFreeStringList( miss );
}
if( newfont==NULL )

View File

@ -52,8 +52,6 @@
#include <X11/extensions/shape.h>
#define MAX_NAME_LEN 200L /* truncate to this many */
extern int ShapeEventBase;
extern void handle_expose( XEvent * );

View File

@ -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<n_miss; lp++ )