[cairo] Early Initialization?
Johannes Schmid
johannes.schmid at openismus.com
Fri Mar 23 09:39:28 PDT 2007
Hi Owen, Behdad!
Thanks for your help! I think I found a quite good solution now. I still
have to bother with the default font but the rest seems to give me a
nice speed-up.
See https://maemo.org/bugzilla/show_bug.cgi?id=952 for details!
Thanks,
Johannes
Owen Taylor schrieb:
> On Wed, 2007-03-21 at 14:28 +0100, Johannes Schmid wrote:
>> Hi Behded!
>>
>> Behdad Esfahbod schrieb:
>>>> Create an image surface and render something in the default language and
>>>> default font ("Sans"?) to it using pangocairo.
>>> For extra, do it for all font-descriptions that your UI uses (all
>>> "default" font face+size combinations).
>> I am not very familiar to cairo but I tried this without any speed-up:
>>
>> context = pango_cairo_font_map_create_context (
>> PANGO_CAIRO_FONT_MAP(pango_cairo_font_map_get_default()));
>> pango_context_load_font (context,
>> pango_font_description_from_string("Sans"));
>
> Hmm, I would have actually thought that this would work, but I'd
> certainly trust Behdad's suggestion - "render something" - more.
>
>> Maybe someone could point me to the methods I should use to render
>> something to the pango image surface because I could not figure out yet
>> with the reference documentation.
>
> http://svn.gnome.org/viewcvs/pango/trunk/examples/cairosimple.c?view=markup
>
> may help. (Obviously, it can get a lot simpler than that, but it shows
> the basics of rendering to an image surface)
>
> It could just be that the fontconfig memmap'ed cache stuff has dropped
> startup overhead low enough that the advantage of pre-initializing
> things is small.
> - Owen
>
>
More information about the cairo
mailing list