Home » U++ Library support » Look and Chameleon Technology » Font drawing in linux
Font drawing in linux [message #33014] |
Thu, 30 June 2011 13:10 |
Zbych
Messages: 327 Registered: July 2009
|
Senior Member |
|
|
Hi,
I am writing an application that shows information on small (44x16 pixel) LED display. The problem is that ttf fonts in NOGTK version of UPP look worse that in GTK. I thought that font rendering is the same in GTK and NOGTK version. Any ideas how to correct font drawing?
Test code:
#include <CtrlLib/CtrlLib.h>
#include <Draw/Draw.h>
using namespace Upp;
GUI_APP_MAIN
{
Size sz(55,24);
Font fnt(Font::FindFaceNameIndex("Impact"), 14);
fnt.NonAntiAliased();
ImageDraw id(sz);
id.DrawRect(0, 0, sz.cx, sz.cy, Black());
id.DrawText(0, -4, "PO LINE1", fnt, White());
id.DrawText(0, 8, "PO LINE2", fnt, White());
PNGEncoder png;
png.SaveFile("FontTest.png", Image(id));
}
|
|
|
Re: Font drawing in linux [message #33015 is a reply to message #33014] |
Thu, 30 June 2011 15:06 |
|
Hi Zbych,
Wild guess before someone competent answers: Have you tried using Painter? It generally creates much nicer images than Draw. Also, you might try rendering a bigger image and then scaling it down. Of course, this doesn't answer the question why there is a difference between NOGTK and regular...
Anyway, it sounds like an interesting project
Best regards,
Honza
|
|
|
Re: Font drawing in linux [message #33016 is a reply to message #33015] |
Thu, 30 June 2011 16:04 |
Zbych
Messages: 327 Registered: July 2009
|
Senior Member |
|
|
With painter it looks great. How can I turn off antialiasing?
Ok. I've found how to turnoff AA. MODE_NOAA must be added to ImagePainter initialization. But IMHO it's a pity that ImagePainter doesn't respect font properties (NonAntiAliased flag) like ImageDraw does.
[Updated on: Thu, 30 June 2011 17:06] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Dec 14 13:57:04 CET 2024
Total time taken to generate the page: 0.03173 seconds
|