[Lazarus] Lazarus IDE (GTK2) - flicker and slow redraws
Luiz Americo Pereira Camara
luizmed at oi.com.br
Sat Apr 26 19:40:27 CEST 2008
Mattias Gaertner wrote:
> On Sat, 26 Apr 2008 08:33:28 +0200
> "Graeme Geldenhuys" <graemeg.lists at gmail.com> wrote:
>
>
>> OK, that would definitely explain the slowness I experience. Why
>> don't you use Xft directly? fpGUI uses Xft and unicode support is
>> perfect. That way you will get unicode support in the editor, should
>> have faster redraws and might even give GTK1 widgetset a unicode (and
>> truetype fonts enabled) Editor as well.
>>
>
> AFAIK Cairo works on more gtk platforms than XFT, so Cairo can
> reduce IFDEFs and maintenance work.
>
Yes and no. See below.
> I have to test, how much faster XFT is and how complicated Cairo is.
>
Cairo is not complicated at all. But, as i said early, the text
rendering api provided with the cairo core is not suited for what LCL need.
Quote from cairo doc about cairo_show_text :
"The |cairo_show_text()|
<http://cairographics.org/manual/cairo-Text.html#cairo-show-text>
function call is part of what the cairo designers call the "toy" text
API. It is convenient for short demos and simple programs, but it is not
expected to be adequate for serious text-using applications. See
|cairo_show_glyphs()|
<http://cairographics.org/manual/cairo-Text.html#cairo-show-glyphs> for
the "real" text display API in cairo"
Yes you can play with cairo_show_glyphs but you would to make all
manually: clipping, multiline, bidi, underline.
What Behdad Esfahbod has to say about it:
http://article.gmane.org/gmane.comp.lib.cairo/12247
What Carl Worth has to say:
http://article.gmane.org/gmane.comp.lib.cairo/12607
Now the funniest part: the system font selection. Cairo provides another
"toy" api for that:
http://cairographics.org/manual/cairo-Text.html#cairo-select-font-face
It provides basic options. For integration with the system fonts you
would need to deal with the font backends: win32, FreeType + FontConfig
for linux, ATSUI/CGFont for MacOSX.
So you loose the "no ifdef" advantage.
Yes, you could abstract that in OOP fashion with a descendant for each
OS. I already tried that but give up when i found that FreeType binding
is incomplete and the FontConfig one does not exists at all.
Definitely is a lot of work. And not for kids.
*
*Luiz
More information about the Lazarus
mailing list