text-renderingglyphfontconfig

preferred glyph fallback font


[Problem] When rendering a string of multiple languages, the font selected might not support all glyphs. Is it possible to specify a list of fonts to test the glyph through?

[Context] The system is Pango + Fontconfig, my first guess this is something to address at fontconfig level. However from fontconfig spec, I don't see something directly relevant.

[Questions]

  1. Is this something to be addressed at fontconfig level?
  2. I tried to add the below in /etc/fonts/local.conf, and then use "fc-match "FreightSans Pro" -s" to test. It seems working because of seeing Noto fonts right after FreigSanPro. However, the rendering system with Pango doesn't seem to use Noto fonts. What could be the reason?
<alias>
    <family>FreightSans Pro</family> 
    <prefer>
        <family>Noto Sans</family>
        <family>Noto Emoji</family>
        <family>Noto Sans Armenian</family>
        <family>Noto Sans Avestan</family>
        <family>Noto Sans Balinese</family>
        <family>Noto Sans Bamum</family>
        ......
    </prefer>
</alias>

Thanks for any thought. :)


Solution

  • Just got it working. It looks the build of fontconfig I have isn't looking /etc/fonts/ for config files. Therefore by adding the environment variable below the system is picking up my customized conf file and work as expected.

    export FONTCONFIG_PATH=/etc/fonts/