It is currently Wed Apr 24, 2024 7:27 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 8:37 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Bother You with too many system fonts in Gimp?
In Gimp for Windows, You can disable/enable fonts by editing the ...\etc\fonts\fonts.conf file.

This plugin will do it for You.
Only fonts listed in Preferences -> Folders -> Fonts can work.
Only You will probably need to grant write permission for file fonts.conf.
This probably does not apply to all portable versions Gimp.

A lot of guides on this matter, e.g.:
Access is denied Windows 10
https://windowsreport.com/access-is-denied-windows-10/

In brief:
To change the permissions of a file or folder, follow these steps.
Important You must be logged on as an administrator to change permissions on files and folders.
Press and hold or right-click the file or folder, and then tap or click Properties.
Tap or click the Security tab.
Under Group or user names, tap or click your name to see the permissions that you have.
Tap or click Edit, tap or click your name, select the check boxes for the permissions that you must have, and then click OK.


For safety, make a backup of the fonts.conf file (I just zip the file in the same directory).

The idea for the plugin to automatically search for a file comes from Ofnuts. :tyspin


Attachments:
In menu Fonts.png
In menu Fonts.png [ 12.79 KiB | Viewed 4717 times ]
Fonts Windows ON-OFF.zip [1.15 KiB]
Downloaded 204 times

_________________
Image

Slava
Ukraini!
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 9:45 am  (#2) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13016
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
I've always wanted to simply use just the fonts I install into my GIMP user resources.
Seems that this will do the trick.

:tyspin

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 10:25 am  (#3) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4045
I guess there are fonts that refuse to be disabled. For those, I can always access the font folder and DELETE them.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 10:40 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Mahvin.

To be well understood - this plugin doesn't disable anything on Your system - it just lets You control their display in the Gimp menu.
As Wallace wrote - I want to use only the selected ones, not the ones that are additionally borrowed by Windows.

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 10:47 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
It would be great if there were a linux version also. I have way too many fonts showing up.


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 11:04 am  (#6) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13016
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
MareroQ wrote:
Hi Mahvin.

To be well understood - this plugin doesn't disable anything on Your system - it just lets You control their display in the Gimp menu.
As Wallace wrote - I want to use only the selected ones, not the ones that are additionally borrowed by Windows.

Exactly!
:coolthup

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 11:40 am  (#7) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2424
racer-x wrote:
It would be great if there were a linux version also. I have way too many fonts showing up.


Co-incidence, I was tidying up my new-ish kubuntu 20.04 installation on my old desktop computer yesterday and one task was to install the font manager (it is in the'buntu repo) and prune the fonts down from 300+ to around 50 https://i.imgur.com/HPhqrKh.jpg

_________________
Image


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 11:45 am  (#8) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4045
MareroQ wrote:
Hi Mahvin.

To be well understood - this plugin doesn't disable anything on Your system - it just lets You control their display in the Gimp menu.
As Wallace wrote - I want to use only the selected ones, not the ones that are additionally borrowed by Windows.


I understand this. I have fonts that refuse to go away in GIMP, and since they refuse to go away (disabled) I will remove them from my font manager. I get sick of seeing them every time I use text in my images. I never thought the plugin would remove them from my Windows system, but I DID expect them to not show up in my font menu in GIMP.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 2:06 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Racer-X.

You talk and You have - and that's no problem (easier than for Windows :hehe ).

For Linux Ubuntu 20.04 there are more directories where fonts can be stored.
I chose those from the catalog: /usr/share/fonts

Image

This can be easily changed.

I only tested for Ubuntu 20.04 and in Gimp-2.10.20 (own compilation and appimage)

The files must be executable.
/etc/fonts/fonts.conf
Fonts Linux ON-OFF.py

After positive testing, I can combine these two plugins (for Windows and Linux) into one.


@Mahvin

Perhaps they are fonts that are not physically found in the Windows/fonts directories or ... GIMP\2.10\fonts \ or ... \share\gimp\2.0\fonts\?
After disabling Windows fonts, I installed only one font in Gimp: Comfortaa Regular.ttf - and 12 additional ones are displayed - because they are contained in ... \ etc \ fonts \ conf.d \.
There is much more to Linux. :hehe

Image

Edit: removed the attachment after a negative test of this solution for Linux.

_________________
Image

Slava
Ukraini!


Last edited by MareroQ on Tue Sep 08, 2020 1:41 am, edited 1 time in total.

Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 2:33 pm  (#10) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4045
MareroQ wrote:
@Mahvin

Perhaps they are fonts that are not physically found in the Windows/fonts directories or ... GIMP\2.10\fonts \ or ... \share\gimp\2.0\fonts\?
After disabling Windows fonts, I installed only one font in Gimp: Comfortaa Regular.ttf - and 12 additional ones are displayed - because they are contained in ... \ etc \ fonts \ conf.d \.
There is much more to Linux. :hehe

[ Image ]


Alas! You were correct, somehow I overlooked that darned font conf file (not sure how the fonts got there since I have never activated or used GIMP's font filing system). But kudos to the script actually working against the system fonts. :yes

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Mon Sep 07, 2020 4:39 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
Hi MareroQ. I believe you posted the Windows version in the Linux plugin. It doesn't seem to work.

Attachment:
fonts.png
fonts.png [ 141.35 KiB | Viewed 2866 times ]


whoops, I spoke too soon. It does work, but it also messes up the system wide fonts when fonts are disabled. Not good. Oh well, thanks for trying.


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Tue Sep 08, 2020 1:37 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Hi Racer-X.

On Windows, fonts.conf is only created for Gimp.
There is only one fonts.conf on Linux - and as you can see from your tests, it is common to OS and Gimp.
Sorry - but I didn't notice anything changing in the way the system works. :oops:
Thanks for the test and sorry for the inconvenience and disappointment with this Linux solution. :geek

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Tue Jan 26, 2021 10:21 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 26, 2021
Posts: 6
This is exactly what I've been after for ages... but how do I install it ?

I tried unzipping the 'Fonts Windows ON-OFF.py' file to C:\Users\MyUserName\.gimp-2.8\plug-ins\ and restarting GIMP, but I don't see the 'Windows Font Disable/Enable' options when I right-click in the dockable Fonts dialogue

(I'm using GIMP 2.8 on Windows 10 - the local account I'm using does NOT have admin rights, but I should be able to see those two options shouldn't I?)


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Wed Jan 27, 2021 2:51 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Sorry I didn't test it with Gimp-2.8. :oops:
Make a simple edit to the Windows Fonts ON-OFF.py file
Replace the first line:
#!/usr/bin/env python2

on:
#!/usr/bin/env python

Now the plugin should appear in the Gimp-2.8 menu.

However, you will have a problem with granting write permissions (without administrator rights - when Gimp is installed on the "C" drive) for the file:
c: \ Program Files \ GIMP 2 \ etc \ fonts \ fonts.conf
In this case, this plugin is useless because it works by changing line 26 in fonts.conf:
for "Windows font Disable"
<dir>WINDOWSFONTDIR</dir>

for something else, e.g.
<dir>NOT-WINDOWSFONTDIR</dir>

and vice versa for "Windows font Enable".

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Wed Jan 27, 2021 5:48 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 26, 2021
Posts: 6
Thanks for the very quick response.

I changed the first line as stated and the Windows font Enable/Disable options now appear.

Although my normal Windows account does not have admin rights, the computer is mine and I do have access to the admin account.

So I gave my normal account full read-modify-write-execute privelege for the C:\Program Files\GIMP 2-8\etc\fonts\fonts.conf file.

However, when I click the Windows font Enable/Disable options the C:\Program Files\GIMP 2-8\etc\fonts\fonts.conf file does not get modified.


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Wed Jan 27, 2021 6:54 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: Jan 26, 2021
Posts: 6
I also tried changing my account to an admin account - but the C:\Program Files\GIMP 2-8\etc\fonts\fonts.conf file still does not get modified when I click the Windows font Enable/Disable options.

I then tried manually editing the C:\Program Files\GIMP 2-8\etc\fonts\fonts.conf to change '<dir>WINDOWSFONTDIR</dir>' to '<dir>NOT-WINDOWSFONTDIR</dir>'.

When I rescanned the font list it was empty - the folders listed in Preferences > Folders > Fonts are empty, so this seems correct.

I copied a single TTF font file into C:\Users\MyUserName\.gimp-2.8\fonts\ and rescanned the font list - it now contains the font I added, plus three that I hadn't (Monospace, Sans, Serif) which is exactly what you said in post #9.

I think I'm happy to leave it like this. I can simply put any fonts I want to use in GIMP into my C:\Users\MyUserName\.gimp-2.8\fonts\ folder as needed


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Wed Jan 27, 2021 7:24 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Jan 26, 2021
Posts: 6
I've just noticed that the fonts I did NOT add (Monospace, Sans, Serif) all display using the font I DID add. It's the same for the screenshot in post #9.

And that's how they appear if I add Monospace, Sans or Serif text to my image - it's using the wrong font.


Attachments:
AllTheSameFont.jpg
AllTheSameFont.jpg [ 34.45 KiB | Viewed 1865 times ]
Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Wed Jan 27, 2021 10:31 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
You're right - the plugin couldn't work because I forgot that Python in Gimp-2.8 is 32 bit.
I don't know if it's worth playing, but there are two possible solutions:
1. Move Gimp to another disk (but for Python to work, you need to edit the file ... \lib\gimp\2.0\interpreters\pygimp.interp).
2. Try the version for Gimp-2.8 (attached) - but you have to run Gimp by clicking on gimp-2.8.exe or via the shortcut with administrator privileges.
For an additional 12 fonts, I don't know how to remove it.

Personally, I use the GIMP-2.10 Portable Samj version (because at least subsequent Windows10 updates restore the old settings and I do not want to constantly fight for access to the "C" drive :hehe )


Attachments:
Fonts Windows ON-OFF Gimp-2.8.zip [1.21 KiB]
Downloaded 77 times
Shortcut.png
Shortcut.png [ 28.19 KiB | Viewed 1852 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Thu Jan 28, 2021 7:50 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Jan 26, 2021
Posts: 6
Thanks again MareroQ,

The modified GIMP 2.8 version works fine for me. And since I've already given myself read/write priveleges for the fonts.conf file I didn't need to run GIMP with admin rights.

I just have to remember not to select any of the 12 Monospace, Sans or Serif fonts when I have Windows fonts disabled !


Top
 Post subject: Re: Disable/Enable Windows fonts
PostPosted: Thu Jan 28, 2021 9:11 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jan 26, 2021
Posts: 6
Regarding those 12 Monospace, Sans and Serif fonts that magically appear, I just found this statement in xenoid's answer to a "Where does GIMP/Fontconfig store built-in fonts on Windows?" StackOverflow query

"...In addition, the Sans, Serif and Monospace fonts do not correspond to specific fonts, they are really just a way to name a default font of the corresponding type: on Windows Sans is likely Arial while on Linux it would be Liberation. They make good default values (for scripts, etc...) since they are always there, whatever the OS and version."


Top
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) [HELP] How do i disable pen button?

7

No new posts Fonts Disapeared

4

No new posts Attachment(s) Reregister fonts?

3

No new posts Attachment(s) Gizmo's Free Fonts

10

No new posts Attachment(s) [ solved] fonts's choice

10


cron

* Login  



Powered by phpBB3 © phpBB Group