Font Selector - dynamic Font management inside viewport and sequencer #63962

Closed
opened 2019-04-28 17:45:33 +02:00 by tonton · 21 comments

Hello,

Here's an update of the previous submitting of Font Selector (https://developer.blender.org/T54436). The addon has been updated for blender 2.8

I would like to submit a simple addon i wrote to help with font system in blender. Instead of browsing it through file browser, it imports "on-the-fly" fonts through a previously created list. It allows you to dynamically see the font applied to a text object by selecting it. It is basically the way other graphic applications (such as after effect) works which i try to recreate !

The fonts are refreshed with a modal operator, creating the list as a txt external file.

You can select your font folders from user prefs and save them also as external files.

The source folder of each font is also kept in the list, you can use it to filter the fonts

There is also a favorite system to easily find the font that you use frequently. These favorites are exportable as a zip file through the file/export menu. Additionally, you can toggle the fake user for fonts when imported, this allows to create a kind of "per-project favorites".

The addon works this way :

On startup, it looks for changes in font folders (if this is setup in the preferences).
If there is any, a modal refresh starts, then the resulting list is loaded.

When the user click on a font in the fontselector panel, an update function import the font in a font datablock and apply it to the selected font object.
Pretty simple, but works quite all right

The same logic is also applied to VSE text strip

Here is an overview video of it :
https://youtu.be/EnGb2wVCDCA

Here the link to the github :
https://github.com/samytichadou/FontSelector_blender_addon

and the BA thread
https://blenderartists.org/t/font-selector-blender-2-8-font-management/

the addon had been tested by a few users through blender artists forum and blender nation, for the current version, no issues were find yet (v2.0)

Thanks and have a good day ! :)

Hello, Here's an update of the previous submitting of Font Selector (https://developer.blender.org/T54436). The addon has been updated for blender 2.8 I would like to submit a simple addon i wrote to help with font system in blender. Instead of browsing it through file browser, it imports "on-the-fly" fonts through a previously created list. It allows you to dynamically see the font applied to a text object by selecting it. It is basically the way other graphic applications (such as after effect) works which i try to recreate ! The fonts are refreshed with a modal operator, creating the list as a txt external file. You can select your font folders from user prefs and save them also as external files. The source folder of each font is also kept in the list, you can use it to filter the fonts There is also a favorite system to easily find the font that you use frequently. These favorites are exportable as a zip file through the file/export menu. Additionally, you can toggle the fake user for fonts when imported, this allows to create a kind of "per-project favorites". The addon works this way : On startup, it looks for changes in font folders (if this is setup in the preferences). If there is any, a modal refresh starts, then the resulting list is loaded. When the user click on a font in the fontselector panel, an update function import the font in a font datablock and apply it to the selected font object. Pretty simple, but works quite all right The same logic is also applied to VSE text strip Here is an overview video of it : https://youtu.be/EnGb2wVCDCA Here the link to the github : https://github.com/samytichadou/FontSelector_blender_addon and the BA thread https://blenderartists.org/t/font-selector-blender-2-8-font-management/ the addon had been tested by a few users through blender artists forum and blender nation, for the current version, no issues were find yet (v2.0) Thanks and have a good day ! :)
Author

Added subscriber: @tonton

Added subscriber: @tonton
Member

Added subscriber: @BrendonMurphy

Added subscriber: @BrendonMurphy
Member

hi, does this work on all os?

hi, does this work on all os?
Author

hi, yes it should, i've personally tested with windows and linux (pop os and ubuntu) but i don't own a mac computer. However, some users from first version have mac os and it worked, the logic of the addon didn't change from this version, so it should work !

hi, yes it should, i've personally tested with windows and linux (pop os and ubuntu) but i don't own a mac computer. However, some users from first version have mac os and it worked, the logic of the addon didn't change from this version, so it should work !
Author

hi, the addon just confirmed working on all OS :)

hi, the addon just confirmed working on all OS :)
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brendon Murphy self-assigned this 2019-12-09 04:50:08 +01:00
Member

hi, I've tested this out very briefly, if only to make it break, which was easily achievable. All I needed to do was set the font folder to C:\Windows\Fonts\ and it broke. I can see however this is a little outside the design of the addon, but hey, people will do that and it needs to not error. Reading the thread on BA it seems your still solving some issues? I did a more realistic test and made a custom fonts folder in my downloads folder and everything worked fine. I guess the use for this is to set up a custom fonts folder or a couple of folders for easy access. This is ok presuming the user knows what font they are looking for or familiar with the font's names in their custom list.
I think in theory this is quite good but still not quite a nice as what's built in. I can easily set a fonts folder in the file paths preferences and browse the fonts in the font panel which gives auto thumbs when browsing. What's the difference here? Built in you browse the folder you set in file paths preferences, with the addon you set preferences then return a list and then need to click on each font to browse in the 3d view?
Don't get me wrong here, I do see the value of the multiple/custom font folders, it's quite good for a per project font list.
If you try to address some of the issues we can look at this again soon.
Unfortunately, for now it's not accepted.
Archiving.

hi, I've tested this out very briefly, if only to make it break, which was easily achievable. All I needed to do was set the font folder to C:\Windows\Fonts\ and it broke. I can see however this is a little outside the design of the addon, but hey, people will do that and it needs to not error. Reading the thread on BA it seems your still solving some issues? I did a more realistic test and made a custom fonts folder in my downloads folder and everything worked fine. I guess the use for this is to set up a custom fonts folder or a couple of folders for easy access. This is ok presuming the user knows what font they are looking for or familiar with the font's names in their custom list. I think in theory this is quite good but still not quite a nice as what's built in. I can easily set a fonts folder in the file paths preferences and browse the fonts in the font panel which gives auto thumbs when browsing. What's the difference here? Built in you browse the folder you set in file paths preferences, with the addon you set preferences then return a list and then need to click on each font to browse in the 3d view? Don't get me wrong here, I do see the value of the multiple/custom font folders, it's quite good for a per project font list. If you try to address some of the issues we can look at this again soon. Unfortunately, for now it's not accepted. Archiving.
Member

hi, I may have been too quick here without enough explanation.
The error was related to run as administrator on windows. I tested on nightly build. I had not seen that error for a long long time. I've tested again running as admin and it did successfully refresh the folder. I did not have the same issue with a custom fonts folder in an open directory. I also have no issue with admin using the built in default font path, I can see and load fonts easily. It must be the .json write? Could this write to the addon folder instead? would that work better?

Traceback (most recent call last):
  File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\operators\modal_refresh.py", line 178, in modal
    path, subdir, name = self.font_list[count]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\operators\modal_refresh.py", line 227, in modal
    self.finish(context)
  File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\operators\modal_refresh.py", line 293, in finish
    create_json_file(datas, self.json_output)
  File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\functions\json_functions.py", line 9, in create_json_file
    with open(path, "w") as write_file :
PermissionError: [Errno 13] Permission denied: 'C:\\Windows\\Fonts\\fontselector.json'

location: <unknown location>:-1

The more I use the addon the more I understand it's usefulness, I can imagine in production setting a path just to your project fonts could be very useful.
If you can look at the admin path issue we could re-open the task and possibly look at nightly builds contrib section.
What I was trying to look at was does the addon do enough different from what's built in. In some ways it's good, in others maybe could be improved.
It might be nice also to have an open font button similar to built in but looking at user directory so there's an option for quick visual browse and select?
Thanks. Let me know what you think.

hi, I may have been too quick here without enough explanation. The error was related to run as administrator on windows. I tested on nightly build. I had not seen that error for a long long time. I've tested again running as admin and it did successfully refresh the folder. I did not have the same issue with a custom fonts folder in an open directory. I also have no issue with admin using the built in default font path, I can see and load fonts easily. It must be the .json write? Could this write to the addon folder instead? would that work better? ``` Traceback (most recent call last): File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\operators\modal_refresh.py", line 178, in modal path, subdir, name = self.font_list[count] IndexError: list index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\operators\modal_refresh.py", line 227, in modal self.finish(context) File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\operators\modal_refresh.py", line 293, in finish create_json_file(datas, self.json_output) File "C:\Users\Dell\Downloads\blender-2.82-01_12_19-windows64\2.82\scripts\addons_contrib\FontSelector_blender_addon-master\functions\json_functions.py", line 9, in create_json_file with open(path, "w") as write_file : PermissionError: [Errno 13] Permission denied: 'C:\\Windows\\Fonts\\fontselector.json' location: <unknown location>:-1 ``` The more I use the addon the more I understand it's usefulness, I can imagine in production setting a path just to your project fonts could be very useful. If you can look at the admin path issue we could re-open the task and possibly look at nightly builds contrib section. What I was trying to look at was does the addon do enough different from what's built in. In some ways it's good, in others maybe could be improved. It might be nice also to have an open font button similar to built in but looking at user directory so there's an option for quick visual browse and select? Thanks. Let me know what you think.
Author

Hi, thanks for taking the time to explain yourself !

About the error, i do think you misread the preference panel of the addon, here's a little explanatory :
fontselector_preferences.png

The first path is for the preferences of the addon, by default it goes to the data folder of blender. I think you set it to a font path and that's what get you the error, i could be wrong here.

Second is the operator to add font folder, you can add a few of them then have (beside you also have a save/load operators which allow you to externallly save your fonts and reload them in case of a new addon/blender install)

The third is the font folder path (may be several here) you set here your path to a folder containing fonts (Windows/Font in your case)

Does this explanation solve the issue ? If it doesn't i'll dig further in the code, but from the error, i think that's the case. The json is supposed to go in your external preferences path. So if there is any administrator right issues, the user can re define this easily.

About your suggestion, i do think that could be a good idea, select a font folder through the font selector panel, then open it in blender builtin browser with preview enabled ! Is that how you saw this ?

Cheers !

Hi, thanks for taking the time to explain yourself ! About the error, i do think you misread the preference panel of the addon, here's a little explanatory : ![fontselector_preferences.png](https://archive.blender.org/developer/F8204827/fontselector_preferences.png) The first path is for the preferences of the addon, by default it goes to the data folder of blender. I think you set it to a font path and that's what get you the error, i could be wrong here. Second is the operator to add font folder, you can add a few of them then have (beside you also have a save/load operators which allow you to externallly save your fonts and reload them in case of a new addon/blender install) The third is the font folder path (may be several here) you set here your path to a folder containing fonts (Windows/Font in your case) Does this explanation solve the issue ? If it doesn't i'll dig further in the code, but from the error, i think that's the case. The json is supposed to go in your external preferences path. So if there is any administrator right issues, the user can re define this easily. About your suggestion, i do think that could be a good idea, select a font folder through the font selector panel, then open it in blender builtin browser with preview enabled ! Is that how you saw this ? Cheers !
Member

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
Member

hi, possibly this is the case, i did make changes to the paths, I've figured out how to make it work but the error is easily achievable using the windows folder, I'll test again in a few days. I still think that the saved .json should write to the addons folder automatically and the preferences option could be removed? It would be good to know if this works.
Yes, your right how I envisioned the suggestion, It would look pretty good and easy to browse/select the fonts. The list format is ok up to a point and does still remain useful, I've tested with materials, sheer. extrusion, switching fonts fast in the 3d view to preview their look real time can be a time saver.
opening task again so we can continue to look at.

hi, possibly this is the case, i did make changes to the paths, I've figured out how to make it work but the error is easily achievable using the windows folder, I'll test again in a few days. I still think that the saved .json should write to the addons folder automatically and the preferences option could be removed? It would be good to know if this works. Yes, your right how I envisioned the suggestion, It would look pretty good and easy to browse/select the fonts. The list format is ok up to a point and does still remain useful, I've tested with materials, sheer. extrusion, switching fonts fast in the 3d view to preview their look real time can be a time saver. opening task again so we can continue to look at.
Author

Hi, great, i'll take a look at this as soon as i have some spare time ! Only downside of this "builtin browser" method is the time it can take to built the preview of the fonts in a big folder like "C://windows/fonts"

About the preferences, the idea was they are stored in a common data folder for blender, so blender users could guess where it is saved if they let the default option of this path (it is in blender regular prefs folder, along with presets and a bunch of other addons preferences) but if they want it to be cross platform because they have their font folder on an external hard drive (one user asked me about that) and they have a lot of fonts in it, they can just put the addon prefs on this same hard drive.
And if you migrate your settings from one version to another, i believe blender copy this folder (didn't really test it though) including the addon preferences

But the fact that you errored it without even trying shows that it should at least be clearer, like more hidden settings or more explanatory, what do you think ?

I also thought about a floating panel called with a shortcut, bringing the list into the 3D viewport instead of scrolling down in the text tab of properties panel, but i'm not sure adding some shortcut in this kind of addon is a good idea...

edit : i could also add error handling for the preferences path to give warning to user instead of an error it they are trying to write in a "not allowed" folder

Hi, great, i'll take a look at this as soon as i have some spare time ! Only downside of this "builtin browser" method is the time it can take to built the preview of the fonts in a big folder like "C://windows/fonts" About the preferences, the idea was they are stored in a common data folder for blender, so blender users could guess where it is saved if they let the default option of this path (it is in blender regular prefs folder, along with presets and a bunch of other addons preferences) but if they want it to be cross platform because they have their font folder on an external hard drive (one user asked me about that) and they have a lot of fonts in it, they can just put the addon prefs on this same hard drive. And if you migrate your settings from one version to another, i believe blender copy this folder (didn't really test it though) including the addon preferences But the fact that you errored it without even trying shows that it should at least be clearer, like more hidden settings or more explanatory, what do you think ? I also thought about a floating panel called with a shortcut, bringing the list into the 3D viewport instead of scrolling down in the text tab of properties panel, but i'm not sure adding some shortcut in this kind of addon is a good idea... edit : i could also add error handling for the preferences path to give warning to user instead of an error it they are trying to write in a "not allowed" folder
Member

Added subscriber: @CansecoGPC

Added subscriber: @CansecoGPC
Member

This really saves me a lot of time.
Only thing i miss is Fonts Folder Path being populated automatically with standard OS folders (e.g. /usr/share/fonts on Linux, C:\Windows\Fonts on Windows, /Library/Fonts on Mac)
It's something i wish Blender would do by default.

This really saves me a lot of time. Only thing i miss is Fonts Folder Path being populated automatically with standard OS folders (e.g. /usr/share/fonts on Linux, C:\Windows\Fonts on Windows, /Library/Fonts on Mac) It's something i wish Blender would do by default.
Author

In #63962#827252, @CansecoGPC wrote:
This really saves me a lot of time.
Only thing i miss is Fonts Folder Path being populated automatically with standard OS folders (e.g. /usr/share/fonts on Linux, C:\Windows\Fonts on Windows, /Library/Fonts on Mac)
It's something i wish Blender would do by default.

Hi, thanks ! yep it is a good idea and not to hard to code i think, i'll add it to the todo list !
cheers !

> In #63962#827252, @CansecoGPC wrote: > This really saves me a lot of time. > Only thing i miss is Fonts Folder Path being populated automatically with standard OS folders (e.g. /usr/share/fonts on Linux, C:\Windows\Fonts on Windows, /Library/Fonts on Mac) > It's something i wish Blender would do by default. Hi, thanks ! yep it is a good idea and not to hard to code i think, i'll add it to the todo list ! cheers !
Author

Hi, just a heads up to let you know i implemented the os default font folder logic and refactored the user preferences to make it more natural for new users !
It may need some further testing but so far so good on win and linux !

you can check it in the master branch !

https://github.com/samytichadou/FontSelector_blender_addon

cheers !

Hi, just a heads up to let you know i implemented the os default font folder logic and refactored the user preferences to make it more natural for new users ! It may need some further testing but so far so good on win and linux ! you can check it in the master branch ! https://github.com/samytichadou/FontSelector_blender_addon cheers !
Brendon Murphy was unassigned by Dalai Felinto 2019-12-23 16:42:35 +01:00
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Aaron Carlisle self-assigned this 2019-12-28 20:24:13 +01:00
Member

Hi thank you for submitting a patch, unfortunately, we no longer use the task subtype "Patch" please submit new patches through the differential tool: https://developer.blender.org/differential/

Hi thank you for submitting a patch, unfortunately, we no longer use the task subtype "Patch" please submit new patches through the differential tool: https://developer.blender.org/differential/

Added subscriber: @Mpc46

Added subscriber: @Mpc46

Managing fonts on Linux it's a nightmare... you are a life saver! I mean it! thanks D:

Managing fonts on Linux it's a nightmare... you are a life saver! I mean it! thanks D:
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#63962
No description provided.