[Fontconfig] Disabling automatic font substitution

Akira TAGOH akira at tagoh.org
Thu Sep 26 20:12:49 PDT 2013


On Fri, Sep 27, 2013 at 11:17 AM, Shriramana Sharma <samjnaa at gmail.com> wrote:
> Hello. I have two requirements re fontconfig:
>
> 1) To be able to specify the font used for a particular script like in Firefox.
>
> The "User configuration file" example under
> http://www.freedesktop.org/software/fontconfig/fontconfig-user.html
> seems to provide mechanism to do per-*language* font selection. I
> would like to have per-script font selection. For instance, I want
> Lohit Devanagari to be always used for Devanagari whether the language
> is Hindi, Marathi, Sanskrit etc. Is this possible?

Not at this moment. as you may know the rendering libraries has a
trick to do that these days. e.g. they know what clusters of
characters has a script and querying a font with the different pattern
including the language which is most likely.
Well, it can be improved if fontconfig supports that right. in fact I
have an idea to do that with the language tag though, it isn't a
short-term plan so far.

> 2) To be able to switch off automatic font substitutions entirely,
> either system-wide or per-application.
>
> Due to automatic substitutions, character picker utilities are unable
> to indicate whether a font has the glyph for a particular character or
> not. Fine, given that their purpose is *character* picking, but still
> I'd like to know whether a particular glyph is really coming from a
> particular font or not to prevent stylistic inconsistencies when I
> create documents using those fonts (but suddenly one glyph is inserted
> from another font). It would be good if character pickers are able to
> have an option whether to do automatic font substitution or not, but I
> guess ultimately it is upto fontconfig to do this or not and the
> higher level applications do not have any say in this (correct me if
> I'm wrong).

That sounds like not a fault of fontconfig. how it behaves depends on
rendering libraries or applications. fontconfig just gives an idea of
the better font against the request. if they simply do follow that and
it doesn't contain the certain glyphs say, it won't be renderred
properly like applications without using fontconfig open a font
directly.
Speaking of pango, you can stop that fallback with
pango_attr_fallback_new(FALSE).

>
> So I'd like to know how to achieve the above two requirements. Thank you.
>
> --
> Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fontconfig



-- 
Akira TAGOH


More information about the Fontconfig mailing list