Home » Developing U++ » U++ Developers corner » Another new ubuntu problem...
Another new ubuntu problem... [message #15916] |
Thu, 15 May 2008 22:51 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
There is an issue (were, actually there are two, but I am stuck at first) in new ubuntu that prevents me to make "2008.1" green and which I have hard times to resolve.
The problem is that in new ubuntu, fonts look inapropriate - they do not have the same hinting style etc.. as the rest of gtk.
In previous ubuntu, gtk/gnome cared about setting default fontconfig configuration to a degree, so all we needed to do was to leave values at default.
This is no longer true. So I have found a way how to read gtk's settings concerning font rendering. Anyway, XFT (or FC) does not seem to respond to my calls adjusting font rendering method.
In 7.10 everything seems to work....
The problem can be reduced to this:
Draw/DrawTextXft.cpp 154
XftFont *Draw::CreateXftFont(Font font, int angle)
{
LTIMING("CreateXftFont");
XftFont *xftfont;
double sina, cosa;
int hg = abs(font.GetHeight());
if(hg == 0) hg = 10;
int i = font.GetFace();
if(i < 0 || i >= XFTFontFace().GetCount())
i = 0;
const char *face = i < 7 ? basic_fonts[i] : ~XFTFontFace().GetKey(i);
FcPattern *p = FcPatternCreate();
FcPatternAddString(p, FC_FAMILY, (FcChar8*)face);
FcPatternAddInteger(p, FC_SLANT, font.IsItalic() ? 110 : 0);
FcPatternAddInteger(p, FC_PIXEL_SIZE, hg);
FcPatternAddInteger(p, FC_WEIGHT, font.IsBold() ? 200 : 100);
FcPatternAddBool(p, FC_MINSPACE, 1);
if(angle) {
FcMatrix mx;
SinCos(angle, sina, cosa);
mx.xx = cosa;
mx.xy = -sina;
mx.yx = sina;
mx.yy = cosa;
FcPatternAddMatrix(p, FC_MATRIX, &mx);
}
FcPatternAddBool(p, FC_ANTIALIAS, FcBool(0)); // note this line (1)
XftResult result;
xftfont = XftFontOpenPattern(Xdisplay, XftFontMatch(Xdisplay, Xscreenno, p, &result));
XftPatternDestroy(p);
return xftfont;
}
The pressence of (1) line should switch off all antialiasing for fonts (means they should look ugly . It does on 7.10, it does not on 8.04.....
I have tried to browse internet, spy on other opensource etc... even tried to figure this out in gtk. No success so far...
Any help appreciated, this really drives me craze (and I am starting to hate 8.04...)
Mirek
[Updated on: Thu, 15 May 2008 23:00] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 16:05:23 CEST 2024
Total time taken to generate the page: 0.02966 seconds
|