On Sun, 19 Feb 2012 at 15:43:15 +0100, Andreas Tscharner wrote: > On 18.02.2012 01:21, Carlos R. Mafra wrote: > >diff --git a/WINGs/wfont.c b/WINGs/wfont.c > >index 245cdcc..62dd7d3 100644 > >--- a/WINGs/wfont.c > >+++ b/WINGs/wfont.c > >@@ -144,17 +144,9 @@ WMFont *WMCreateFont(WMScreen * scrPtr, char *fontName) > > > > font->font = XftFontOpenName(display, scrPtr->screen, fname); > > if (!font->font) { > >- printf("Font named %s doesn't exist.\n", fname); > >- printf("Please check your system configuration.\n"); > >- printf("Will try default font %s.\n", DEFAULT_FONT); > >- font->font = XftFontOpenName(display, scrPtr->screen, > >DEFAULT_FONT); > >- if (!font->font) { > > Why do you remove these lines trying to load the default font?
The application asked for a particular font. If that font could not be returned for some reason it's a bad idea to return another one and go on just like nothing has happened. So we just return NULL and let the app decide what to do instead. Note that the above uglyness is my fault. When wmaker-crm was just a folder in the computer in my institute that was the first patch I wrote (and I'm not proud of it): ee28b0257ab5d The underlying problem with WPrefs not checking for null still exists, btw. But wmaker proper does indeed check for !font. If someone wants to write the patch for WPrefs, I'd gladly accept it. > >- printf("Unrecoverable font error! I must die!\n"); > >- wfree(font); > >- wfree(fname); > >- exit(1); > >- } else > >- printf("Default font loading succeded.\n"); > >+ wfree(font); > >+ wfree(fname); > >+ return NULL; > > } > > > > font->height = font->font->ascent + font->font->descent; > > Best regards > Andreas > -- > ("`-''-/").___..--''"`-._ > `o_ o ) `-. ( ).`-.__.`) > (_Y_.)' ._ ) `._ `. ``-..-' > _..`--'_..-_/ /--'_.' .' > (il).-'' (li).' ((!.-' > > Andreas Tscharner a...@vis.ethz.ch ICQ-No. 14356454 > > > -- > To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org. -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.