From 83d3625e1a500550eb12862a746ecda24942b081 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 30 Nov 2002 02:13:36 +0000 Subject: [PATCH] - Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings panel. (Temporary until the Font Settings panel in WPrefs is finished). - Added a check that only %d is used in a font specification in WMGLOBAL and at most once for each font in a fontset (eliminates a possible security exploit) - Added README.antialiasing describing the steps needed to get antialiased fonts working with WINGs/Window Maker. - Added Sample.XftConfig --- ChangeLog | 5 +++++ Makefile.am | 10 ++++----- NEWS | 29 ++++++++++++++++++++++++++ WINGs/ChangeLog | 2 ++ WINGs/Tests/wtest.c | 2 +- WINGs/configuration.c | 56 +++++++++++++++++++++++++++++++++++++++++++++------ WPrefs.app/Expert.c | 10 ++++++++- 7 files changed, 101 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 296827cc..56243bc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,11 @@ Changes since version 0.80.1: - Fixed sloppy focus bug (Pawel S. Veselov ) - Applied Xinerama patch (after fixes) from (Peter Zijlstra ) +- Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings + panel. (Temporary until the Font Settings panel in WPrefs is finished). +- Added a check that only %d is used in a font specification in WMGLOBAL and at + most once for each font in a fontset (eliminates a possible security exploit) + Changes since version 0.80.0: ............................. diff --git a/Makefile.am b/Makefile.am index dc5db54e..fff83e2d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,11 +3,11 @@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\ contrib -EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \ - Install INSTALL.pt README.pt FAQ.I18N.cs INSTALL.cs\ - mkpatch README.KDE README.GNOME WindowMaker.lsm.in\ - README.definable-cursor \ - FAQ.I18N.sk INSTALL.sk INSTALL.es INSTALL.fr +EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N FAQ.I18N.cs FAQ.I18N.sk \ + Install INSTALL.cs INSTALL.fr INSTALL.es INSTALL.pt INSTALL.sk \ + README.antialiasing README.definable-cursor README.pt \ + README.KDE README.GNOME Sample.XftConfig \ + MIRRORS COPYING.WTFPL mkpatch WindowMaker.lsm.in # libwmfun-0.0.3.tar.gz WindowMaker.lsm: WindowMaker.lsm.in diff --git a/NEWS b/NEWS index b7b975bb..b00e6c83 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,35 @@ NEWS for veteran Window Maker users ----------------------------------- +--- 0.81.0 + +Antialiased font support +------------------------ + +With the addition of support for antialiased fonts in the WINGs library, now +Window Maker can also support antialiased fonts. However enabling them may +prove not to be a trivial task to do. This is because enabling antialiased +fonts doesn't depend solely on Window Maker and its configuration files. It +also depends on the X server, the X server extension modules and their +specific configuration files. + +For a description of all the steps required to get antialiased fonts on +screen please check the README.antialiasing file which describes all the +things you need to do on a step by step basis. In addition it has extra +useful hints and idea to make your antialiased fonts look nice in different +contexts. + +After you have done all the steps described there, you can enable antialiased +fonts either by adding AntialiasedText = Yes; in ~/GNUstep/Defaults/WindowMaker +or by launching WPrefs and checking the "Smooth font edges" in the Expert User +Preferences panel. + +As a general note you should always use a True Type font for your fonts if +antialiasing is enabled, or alias a normal font to a True Type in the Xft +configuration (read the details in README.antialiasing). Else you may get +unepleasant results in the look of your screen :P + + --- 0.80.0 Shading/Unshading windows using mouse wheel on their titlebar diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 72a56a86..283578b5 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -45,6 +45,8 @@ Changes since wmaker 0.80.1: - Added WMGetWidgetBackgroundColor() - Code cleanup in wtext.c - Fixed a memory leak in wfontpanel.c +- Added a check that only %d is used in a font specification in WMGLOBAL and at + most once for each font in a fontset (eliminates a possible security exploit) Changes since wmaker 0.80.0: diff --git a/WINGs/Tests/wtest.c b/WINGs/Tests/wtest.c index 7a55f459..871081a9 100644 --- a/WINGs/Tests/wtest.c +++ b/WINGs/Tests/wtest.c @@ -1303,7 +1303,6 @@ main(int argc, char **argv) */ - testTextField(scr); testText(scr); testFontPanel(scr); @@ -1324,6 +1323,7 @@ main(int argc, char **argv) testSlider(scr); testSplitView(scr); testTabView(scr); + testTextField(scr); #endif /* * The main event loop. diff --git a/WINGs/configuration.c b/WINGs/configuration.c index b568c35a..51e13720 100644 --- a/WINGs/configuration.c +++ b/WINGs/configuration.c @@ -45,6 +45,51 @@ getButtonWithName(const char *name, unsigned defaultButton) } +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 if (xlfd == WINGsConfiguration.antialiasedSystemFont) { + ptr = "antialiased system font"; + } else if (xlfd == WINGsConfiguration.antialiasedBoldSystemFont) { + ptr = "antialiased 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) { @@ -133,17 +178,16 @@ W_ReadConfigurations(void) WMGetUDIntegerForKey(defaults, "DefaultFontSize"); } - - if (!WINGsConfiguration.systemFont) { - WINGsConfiguration.systemFont = SYSTEM_FONT; + if (missingOrInvalidXLFD(WINGsConfiguration.systemFont)) { + WINGsConfiguration.systemFont = SYSTEM_FONT; } - if (!WINGsConfiguration.boldSystemFont) { + if (missingOrInvalidXLFD(WINGsConfiguration.boldSystemFont)) { WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT; } - if (!WINGsConfiguration.antialiasedSystemFont) { + if (missingOrInvalidXLFD(WINGsConfiguration.antialiasedSystemFont)) { WINGsConfiguration.antialiasedSystemFont = XFTSYSTEM_FONT; } - if (!WINGsConfiguration.antialiasedBoldSystemFont) { + if (missingOrInvalidXLFD(WINGsConfiguration.antialiasedBoldSystemFont)) { WINGsConfiguration.antialiasedBoldSystemFont = XFTBOLD_SYSTEM_FONT; } if (!WINGsConfiguration.floppyPath) { diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 929db6df..1640fd35 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -54,6 +54,8 @@ showData(_Panel *panel) WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling")); WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill")); WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking")); + if (WMHasAntialiasingSupport(WMWidgetScreen(panel->box))) + WMSetButtonSelected(panel->swi[7], GetBoolForKey("AntialiasedText")); } @@ -66,7 +68,7 @@ createPanel(Panel *p) panel->box = WMCreateBox(panel->parent); WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2); - for (i=0; i<7; i++) { + for (i=0; i<8; i++) { panel->swi[i] = WMCreateSwitchButton(panel->box); WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25); WMMoveWidget(panel->swi[i], 20, 20+i*25); @@ -79,6 +81,10 @@ createPanel(Panel *p) WMSetButtonText(panel->swi[4], _("Use Windoze style cycling.")); WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command.")); WMSetButtonText(panel->swi[6], _("Disable selection animation for selected icons.")); + WMSetButtonText(panel->swi[7], _("Smooth font edges (needs restart).")); + + if (!WMHasAntialiasingSupport(WMWidgetScreen(panel->box))) + WMSetButtonEnabled(panel->swi[7], False); WMRealizeWidget(panel->box); WMMapSubwidgets(panel->box); @@ -101,6 +107,8 @@ storeDefaults(_Panel *panel) SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling"); SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill"); SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking"); + if (WMHasAntialiasingSupport(WMWidgetScreen(panel->box))) + SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "AntialiasedText"); } -- 2.11.4.GIT