[Lazarus] TCanvas, Qt, device context, TextOut(), anti-aliasing

zeljko zeljko at holobit.net
Sun Apr 1 08:07:13 CEST 2012


On Saturday 31 of March 2012 15:35:32 Bernd Kreuss wrote:
> Hello widgetset and Qt experts, I need some explanations to better
> understand what is going on. I recently posted a thread
> "TCanvas.TextRect, subpixel antialiasing with Qt4" that also included a
> small demo application and screenshots to demonstrate my problem.
> 
> I have tried to step through the LCL and widgetset code to see what is
> actually going on, the problem is when outputting text to some offscreen
> TCanvas, like for example the TCanvas of the bitmap of a TImage then it
> will use different text anti-aliasing settings than when doing the same
> for the TCanvas of the form during the paint event. I have observed this
> with Qt on Linux.
> 
> When painting to the canvas of the form during paint it will respect the
> subpixel antialiasing settings from my .fonts.conf file and text will be
> subpixel-antialiased but when outputting text to the canvas of a bitmap
> it will only use "normal" antialiasing (which looks quite ugly and
> inconsistent when you see such text appearing right next to the other
> properly antialiased text in the same application).
> 
> I have tried to step through it and it seems it will ask Qt to create a
> bitmap(?) and a device context for the bitmap and then use Qt to paint
> on this bitmap and I tried to patch some of the Qt units trying to
> change font settings and dc settings and renderhints immediately before
> QPainter_drawText() is called but nothing has the desired effect but I
> also did not see any obvious flags or constants whose names would
> suggest that they have anything to do with it.
> 
> What is going on here and is it even *possible* to solve this problem?
> The main reason for me is to use the html panel from turbopower_ipro
> which seems to be rendering its content to such an offscreen canvas and
> is producing really really ugly font rendering compared to the rest of
> the application.
> 
> The problem does *not* occur with GTK2. I have not tried Windows yet.

No idea, maybe best would be to open an issue about it and attach good 
example, so I can take a look into.

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120401/72f84b6f/attachment-0002.html>


More information about the Lazarus mailing list