[Fontconfig] Tutorial or guidance for using fontconfig
Jesper L. Nielsen
jln at locatel.dk
Fri Jan 9 02:06:08 PST 2009
> Jesper L. Nielsen wrote:
>
>> I do have a various number of fonts for different languages and other
>> things, so the first performance hit is when fontconfig builds it's
>> cache on startup, if there is a way to disable this, I haven't
>> found it.
>
> Sure, building caches is slow. The first question is why is it
> building the
> cache on each startup.
>
Because it is on an embedded system and no place to save the caching
database after each reboot. However I can work past that using some
NFS trickery.
>> I have been running sysprof and the majority of time spend while
>> rendering fonts seems to be in fontconfig.
>>
>> I don't know how to dump Sysprof output to text, so I've attached a
>> screendump.
>
> The screenshot shows nothing really. The fontconfig functions you
> are showing
> in the shot are taking only 3% of the total time.
>
True, I'll get some better numbers on the embedded system soon. But
the screenshot only shows a simple test program I produced to profile
the pango calls. So the times should be regarded as relativ, and
kernel time used disregarded.
>> So what I mean is that there a references to FcPattern, PangoFcFont
>> and
>> other things defined in the Fontconfig specific source files. So
>> taking
>> out just the Fontconfig part for the pangoft2.c would require some
>> work.
>
> pantoft2 subclasses pangofc. So, you are pretty much talking about
> writing a
> new pango backend. And then, the pango shapers also depend on
> pangofc. So
> you have to modify those too. Really, your fighting the wrong
> battle. Just
> focus on getting fontconfig working for you.
>
I was mustering myself to write a whole new backend, but if the shaper
also uses FontConfig, I think I'll better give FontConfig another shot.
Jesper
More information about the Fontconfig
mailing list