[Lazarus] Cairo library usage

Andrew Haines AndrewD207 at aol.com
Sat May 17 20:09:13 CEST 2008


Mattias Gaertner wrote:
> On Sat, 17 May 2008 12:45:47 -0300
> "Felipe Monteiro de Carvalho" <felipemonteiro.carvalho at gmail.com> wrote:
> 
>> On Sat, May 17, 2008 at 12:19 PM, Luiz Americo Pereira Camara
>> <luizmed at oi.com.br> wrote:
>>> For text, is still necessary to use pango (unlike LCL writes your
>>> own wrapper around FreeType/FontConfig, Win32 fonts, CGFont
>>> systems). Gdk text functions are deprecated/unmaintaned.
>> In the dev mailling list someone took a look at gedit code and said it
>> uses gdk to draw it's text.
> 
> I took a quick look: pango is used to allocate fonts,
> but drawing text seems to be only done by gdk/gtk functions.
> 
> 
>> Whatever we are doing now in gtk2 text (which is used pango) is very
>> wrong, because the performance is horrible. There must be a solution,
>> or are you saying that there is no solution to improve the text
>> drawing speed of gtk2 intf?
> 
> It depends.
> Andrew compared pango vs gdk text drawing and the gdk was 5 times
> faster.



Attached is the test project I did. The text is assigned to the
PangoLayout one time only; after *_layout_render is used.

Hope you like the particularly verbose way to render pascal code :)

Avg time for 5000 paint cycles ms:

Pango: 12920
GDK:    2785

Regards,

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gtktext.lpi
Type: text/xml
Size: 1247 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080517/a1600bea/attachment-0007.xml>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gtktext.lpr
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080517/a1600bea/attachment-0007.ksh>


More information about the Lazarus mailing list