Re: [Gimp-developer] blocking fonts enumeration



This is enormously helpful. Thanks so much. I never knew about global fonts.conf settings for fontconfig, and apparently like many things GIMP observes and prioritizes separate configs in its local folder. Studying fontconfig XML properties, I came up with:

<fontconfig>
    <selectfont>
        <rejectfont>
            <pattern>
                <match target="glob">
                    <dir>/usr/share/fonts/*</dir>
                </match>
            </pattern>
        </rejectfont>
    </selectfont>
</fontconfig>

Which successfully prevents GIMP from loading system fonts.

Great!

However, this somehow prevents fonts installed in the GIMP folder from loading as well. In other words, all the custom fonts are useless.

I therefore tried to do:

<fontconfig>
    <selectfont>
        <rejectfont>
            <pattern>
                <match target="glob">
                    <dir>/usr/share/fonts/*</dir>
                </match>
            </pattern>
        </rejectfont>
        <acceptfont>
            <pattern>
                <match target="glob">
                    <dir>/home/exampleuser/.gimp-2.8/fonts/*</dir>
                </match>
            </pattern>
        </acceptfont>
    </selectfont>
</fontconfig>

For some reason, this negated the rejectfont attribute entirely and all system fonts reappeared as if there were no fonts.conf file in the GIMP directory at all, as before.

Thoughts?


On 2018-07-15 04:49, Liam R E Quin wrote:
On Sat, 2018-07-14 at 12:05 +0000, 1980_underground insiberia net
wrote:
Thanks for this!

The Linux in question is Debian.

Your solution sounds painstaking but functional.

Can I get a link to an appropriate example of a fonts.conf that does
this?

This will get rid of Helvetica:

<fontconfig>
    <selectfont>
        <rejectfont>
            <pattern>
                <patelt name="family">
                    <string>Helvetica</string>
                </patelt>
            </pattern>
        </rejectfont>
    </selectfont>
</fontconfig>

You might also be able to do it based on the directory containing the
font file, i'm not sure.

Liam (slave ankh)


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