Re: Font selection algorithm?



On 01/18/2010 12:50 AM, Robert Siemer wrote:
> Hello everyone,
> 
> I assume that most Pango-using apps let Pango choose how to layout text,
> especially which _mix_ of fonts to use.
> 
> To debug font-mix selection in multi-script texts I want to know the
> algorithm used by Pango to pick the secondary fonts (for chars not
> covered by the current font).

Hi,

Basically Pango uses fonts returned by FcFontSort for the language in question
to determine what font to use for which codepoint.

> Can someone point me to the documentation or code where this is done?

The code is in pangofc-fontmap.c and pango-context.c.  Not very easy to follow
without learning how things work first.


> It is really hard to improve the configuration (through fontconfig),
> without knowing which font request pattern to intercept. -- Even in a
> specific app with FC_DEBUG set it is hard fish the right request chain.

Something like:

$ fc-match --sort "sans:lang=fa"

is all you need to check.

> Does Pango cache fontconfig responses?

Yes.

behdad


> Thanks,
> Robert
> _______________________________________________
> gtk-i18n-list mailing list
> gtk-i18n-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]