1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-06 16:25:50 +01:00

- Changed fallback font to 'sans serif:pixelsize=12'

- Fixed convertfonts to account for $LANG
- Fixed convertfonts logic a bit and no longer output slant and weight if
  they are the default ones (medium and roman)
- Applied Pascal's fix for GNUstep menus (modified to also include submenus)
  Still this is not the proper fix, as it can't differentiate between
  submenus and other windows at the floating window level. Correct fix needs
  some extra hints to be set by GNUstep on menus.
This commit is contained in:
dan
2004-10-22 22:27:11 +00:00
parent 08e811aae7
commit d08691d5a5
7 changed files with 75 additions and 92 deletions

View File

@@ -10,9 +10,9 @@ _WINGsConfiguration WINGsConfiguration;
#define SYSTEM_FONT "sans:pixelsize=12"
#define BOLD_SYSTEM_FONT "sans:bold:pixelsize=12"
#define SYSTEM_FONT "Trebuchet MS,Luxi Sans"
#define BOLD_SYSTEM_FONT "Trebuchet MS,Luxi Sans:bold"
#define DEFAULT_FONT_SIZE 12
#define FLOPPY_PATH "/floppy"
@@ -41,48 +41,6 @@ getButtonWithName(const char *name, unsigned defaultButton)
}
// fix this
static Bool
missingOrInvalidXLFD(char *xlfd)
{
char *ptr = xlfd;
Bool broken = False;
int count = 0;
if (!xlfd)
return True;
while (*ptr) {
if (*ptr=='%') {
ptr++;
if ((*ptr=='d' || *ptr=='i') && count==0) {
count++;
} else {
broken = True;
break;
}
} else if (*ptr==',') {
count = 0;
}
ptr++;
}
if (broken) {
if (xlfd == WINGsConfiguration.systemFont) {
ptr = "system font";
} else if (xlfd == WINGsConfiguration.boldSystemFont) {
ptr = "bold system font";
} else {
ptr = "Unknown System Font";
}
wwarning(_("Invalid %s specification: '%s' (only %%d is allowed and "
"at most once for each font in a fontset)."), ptr, xlfd);
}
return broken;
}
void
W_ReadConfigurations(void)
{
@@ -139,12 +97,15 @@ W_ReadConfigurations(void)
WMGetUDIntegerForKey(defaults, "DefaultFontSize");
}
if (missingOrInvalidXLFD(WINGsConfiguration.systemFont)) {
if (!WINGsConfiguration.systemFont) {
WINGsConfiguration.systemFont = SYSTEM_FONT;
}
if (missingOrInvalidXLFD(WINGsConfiguration.boldSystemFont)) {
if (!WINGsConfiguration.boldSystemFont) {
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
}
if (WINGsConfiguration.defaultFontSize == 0) {
WINGsConfiguration.defaultFontSize = DEFAULT_FONT_SIZE;
}
if (!WINGsConfiguration.floppyPath) {
WINGsConfiguration.floppyPath = FLOPPY_PATH;
}
@@ -157,9 +118,6 @@ W_ReadConfigurations(void)
if (WINGsConfiguration.mouseWheelDown == 0) {
WINGsConfiguration.mouseWheelDown = Button5;
}
if (WINGsConfiguration.defaultFontSize == 0) {
WINGsConfiguration.defaultFontSize = 12;
}
}

View File

@@ -13,7 +13,7 @@
#include <X11/Xlocale.h>
#define DEFAULT_FONT "sans-serif:pixelsize=12"
#define DEFAULT_FONT "sans serif:pixelsize=12"
#define DEFAULT_SIZE WINGsConfiguration.defaultFontSize
@@ -38,7 +38,7 @@ xlfdToFcPattern(char *xlfd, int size)
wfree(fname);
if (!pattern) {
wwarning(_("invalid font: %s. Using default %s"), xlfd, DEFAULT_FONT);
wwarning(_("invalid font: %s. Trying '%s'"), xlfd, DEFAULT_FONT);
pattern = FcNameParse(DEFAULT_FONT);
}