Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Installation, Compiling and Running of theide » segmentation fault on Ubuntu Feisty
Re: segmentation fault on Ubuntu Feisty [message #11381 is a reply to message #11368] Mon, 10 September 2007 18:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 12949
Registered: November 2005
Ultimate Member
Can you check this little bit more evolved fix, please

static int sCheckComposed(const char *face)
{
	XftFont *xftfont = XftFontOpen(Xdisplay, Xscreenno,
	                               XFT_FAMILY, XftTypeString, (char *)face,
	                               XFT_PIXEL_SIZE, XftTypeInteger, 20,
	                               (void *)0);
	if(xftfont == NULL )
		return -1;
	int n = 0;
	for(int c = 0; c < 128; c++)
		if(!XftCharExists(Xdisplay, xftfont, c + 256))
			n++;
	XftFontClose(Xdisplay, xftfont);
	return n > 10;
}

void Draw::InitPlatformFonts()
{
	for(int i = 0; i < __countof(basic_fonts); i++) {
		XFTFontFaceInfo& f = XFTFontFace().Add(basic_fonts[i]);
		f.name = basic_fonts[i];
		f.scaleable = true;
		f.fixed = i == 3 || i == 6;
		f.compose = sCheckComposed(basic_fonts[i]);
	}
	FcFontSet *fs = XftListFonts(Xdisplay, Xscreenno, (void *)0, XFT_FAMILY, XFT_SPACING,
	                             XFT_SCALABLE, (void *)0);
	for(int i = 0; i < fs->nfont; i++) {
		FcChar8 *family = NULL;
		if(FcPatternGetString(fs->fonts[i], FC_FAMILY, 0, &family) == 0 && family) {
			int comp = sCheckComposed(face);
			if(comp >= 0) {
				XFTFontFaceInfo& f = XFTFontFace().GetAdd((char *)family);
				int spacing;
				if(FcPatternGetInteger(fs->fonts[i], FC_SPACING, 0, &spacing) == 0 && spacing == XFT_MONO)
					f.fixed = true;
				FcBool scaleable;
				if(FcPatternGetBool(fs->fonts[i], FC_SCALABLE, 0, &scaleable) == 0 && scaleable)
					f.scaleable = true;
				f.compose = comp;
			}
		}
	}
	FcFontSetDestroy(fs);
}


(The point is to not include fonts that fail into the list of fonts..)

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: library sources missing on mandriva
Next Topic: Error compiling uvs sources on Ubuntu
Goto Forum:
  


Current Time: Fri Nov 27 03:12:02 CET 2020

Total time taken to generate the page: 0.01567 seconds