blocking fonts enumeration

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

blocking fonts enumeration

1980_underground
Hi everyone, this is my first post to this list.

I've hunted all over the internet, but can't find any way to do what I
need.

My question is, is there a way to prevent GIMP from reading system
fonts, and to only read fonts from it's own folder?

Explanation:

I do a lot of flyer work that involves fonts. I have dozens if not
hundreds of fonts installed for this.

I use an obscure plugin called GIMP Font Manager by Sean Bogie (modifed
by MareroQ) to manage them, and it works great.

My problem is that no matter what options I use in the Font Manager,
system fonts are *always* shown. I've tried deleting the bulk of them
that aren't needed for system display, but even after that enough of
them are persistent that it makes my font tab overrun with irrelevant
fonts.

Thanks in advance for any knowledge!


_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

Liam R E Quin
On Fri, 2018-06-29 at 23:35 +0000, [hidden email]
wrote:
>
> My question is, is there a way to prevent GIMP from reading system
> fonts, and to only read fonts from it's own folder?

Which Linux distribution are you using? Or, what operating system?
Which GIMP version exactly?

> My problem is that no matter what options I use in the Font Manager,
> system fonts are *always* shown.

On Linux at least you can a fonts.conf file in your gimp data dir or
fonts folder that excludes specific fonts. This probably also works on
MacOS and Windows but i don't know for sure.

In other words exactly how best to do this may depend on your operating
system and in some cases, where you downloaded gimp from (i.e. which
exact build).

slave ankh / Liam



--
Liam Quin - web slave for https://www.fromoldbooks.org/
with fabulous vintage art and fascinating texts to read.
Click here to have the slave chained up overnight.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

Ofnuts-2
On 06/30/18 02:24, Liam R E Quin wrote:

> On Fri, 2018-06-29 at 23:35 +0000, [hidden email]
> wrote:
>> My question is, is there a way to prevent GIMP from reading system
>> fonts, and to only read fonts from it's own folder?
> Which Linux distribution are you using? Or, what operating system?
> Which GIMP version exactly?
>
>> My problem is that no matter what options I use in the Font Manager,
>> system fonts are *always* shown.
> On Linux at least you can a fonts.conf file in your gimp data dir or
> fonts folder that excludes specific fonts. This probably also works on
> MacOS and Windows but i don't know for sure.
>
> In other words exactly how best to do this may depend on your operating
> system and in some cases, where you downloaded gimp from (i.e. which
> exact build).

AFAIK the font.conf also works on Windows, but its exact location eludes me.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

1980_underground
In reply to this post by Liam R E Quin
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? I understand it needs to be tailored to my specific system's
fonts. I just need to know the syntax.

Thanks again!



On 2018-06-30 00:24, Liam R E Quin wrote:

> On Fri, 2018-06-29 at 23:35 +0000, [hidden email]
> wrote:
>>
>> My question is, is there a way to prevent GIMP from reading system
>> fonts, and to only read fonts from it's own folder?
>
> Which Linux distribution are you using? Or, what operating system?
> Which GIMP version exactly?
>
>> My problem is that no matter what options I use in the Font Manager,
>> system fonts are *always* shown.
>
> On Linux at least you can a fonts.conf file in your gimp data dir or
> fonts folder that excludes specific fonts. This probably also works on
> MacOS and Windows but i don't know for sure.
>
> In other words exactly how best to do this may depend on your operating
> system and in some cases, where you downloaded gimp from (i.e. which
> exact build).
>
> slave ankh / Liam
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

Liam R E Quin
On Sat, 2018-07-14 at 12:05 +0000, [hidden email]
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)


--
Liam Quin - web slave for https://www.fromoldbooks.org/
with fabulous vintage art and fascinating texts to read.
Click here to have the slave beaten.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

1980_underground
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, [hidden email]
> 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)
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

1980_underground
I also played around with entering different file paths under the
acceptfont property and the results were the same. It appears that
having any acceptfont attribute at all negates the rejectfont property
alltogether.


On 2018-07-15 12:20, [hidden email] wrote:

> 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, [hidden email]
>> 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)
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

Liam R E Quin
In reply to this post by 1980_underground
On Sun, 2018-07-15 at 12:20 +0000, [hidden email]
wrote:

>
> I therefore tried to do:
>
> <fontconfig>
>      <selectfont>
>          <rejectfont>
>
>          </rejectfont>
>          <acceptfont>
>
>          </acceptfont>
>      </selectfont>
> </fontconfig>
>
You need two separate selectfont sections, one after the other. Also
look for messages on the console when gimp starts (start gimp from the
commandline in a terminal)

An error in fonts.conf can break lots of stuff.

Liam


--
Liam Quin - web slave for https://www.fromoldbooks.org/
with fabulous vintage art and fascinating texts to read.
Click here to have the slave beaten.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

1980_underground
Hm. I don't think I needed <acceptfont>. I was just getting the <glob>
element wrong.

Here's what works on my current system:

<fontconfig>
     <selectfont>
         <rejectfont>
             <glob>/usr/share/fonts/*</glob>
         </rejectfont>
     </selectfont>
</fontconfig>

This empties all fonts except the ones in GIMP's own folder.

An odd thing is that even with using font manager, when a font is
selected through it and subsequently displayed in the fonts tab, it
automatically adds defaults like "Monospace Italic" and Sans Bold
Italic". This isn't a big deal, but any ideas on how to block those as
well?

I'm super happy about all this, thanks.

Oh, and here's where I got the correct glob element from:

https://wiki.archlinux.org/index.php/font_configuration#Whitelisting_and_blacklisting_fonts



On 2018-07-15 16:32, Liam R E Quin wrote:

> On Sun, 2018-07-15 at 12:20 +0000, [hidden email]
> wrote:
>>
>> I therefore tried to do:
>>
>> <fontconfig>
>>      <selectfont>
>>          <rejectfont>
>>
>>          </rejectfont>
>>          <acceptfont>
>>
>>          </acceptfont>
>>      </selectfont>
>> </fontconfig>
>>
> You need two separate selectfont sections, one after the other. Also
> look for messages on the console when gimp starts (start gimp from the
> commandline in a terminal)
>
> An error in fonts.conf can break lots of stuff.
>
> Liam
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: blocking fonts enumeration

Liam R E Quin
On Sun, 2018-07-15 at 22:24 +0000, [hidden email]
wrote:
>
> An odd thing is that even with using font manager, when a font is
> selected through it and subsequently displayed in the fonts tab, it
> automatically adds defaults like "Monospace Italic" and Sans Bold
> Italic". This isn't a big deal, but any ideas on how to block those
> as well?
i don't think you can.

> I'm super happy about all this, thanks.
i'm glad it worked out.

Thanks to the link to the archlinux wiki ;age.

slave ankh


--
Liam Quin - web slave for https://www.fromoldbooks.org/
with fabulous vintage art and fascinating texts to read.
Click here to have the slave beaten.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list