Registering Python Scripts to the Tools Menu (Windows)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Registering Python Scripts to the Tools Menu (Windows)

Abraham Lee
Greetings, All!

I am feeling like quite a dunce at the moment because I can't seem to figure out what it takes to make a python script get processed so that it can register a function in the Tools menu as described in the docs and as I've seen in other scripts.

On the docs page[1] that describes the python scripting API, it says that the scripts should be put in one of the following directories:

$(PREFIX)/share/fontforge/python

or 

~/.FontForge/python

and they would get processed when FF boots up. I've tried putting them in both directories, but without luck (unless I'm confused about what "$(PREFIX)"  and "~" point to, but I don't think so...). There are several scripts there (including the simple example script shown on the python API page for this very purpose and Dave Crossland's Simplepolator script), but the Tools menu remains inactive no matter what I do.

Any suggestions for making this work on Windows would be very welcome. I'm using Windows 8.1.

Best,
Abraham

[1]https://fontforge.github.io/python.html#fontforge under the "User Interface Methods" section.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Registering Python Scripts to the Tools Menu (Windows)

Max Rabkin-2
Try replacing ~/.fontforge with wherever fontforge keeps its settings. On many Linux distributions it's ~/.config rather than ~ and on Windows it might be in something like "App Settings" (I don't remember the name in Windows 8) in your user folder.

On 2 Feb 2017 8:06 a.m., "Abraham Lee" <[hidden email]> wrote:
Greetings, All!

I am feeling like quite a dunce at the moment because I can't seem to figure out what it takes to make a python script get processed so that it can register a function in the Tools menu as described in the docs and as I've seen in other scripts.

On the docs page[1] that describes the python scripting API, it says that the scripts should be put in one of the following directories:

$(PREFIX)/share/fontforge/python

or 

~/.FontForge/python

and they would get processed when FF boots up. I've tried putting them in both directories, but without luck (unless I'm confused about what "$(PREFIX)"  and "~" point to, but I don't think so...). There are several scripts there (including the simple example script shown on the python API page for this very purpose and Dave Crossland's Simplepolator script), but the Tools menu remains inactive no matter what I do.

Any suggestions for making this work on Windows would be very welcome. I'm using Windows 8.1.

Best,
Abraham

[1]https://fontforge.github.io/python.html#fontforge under the "User Interface Methods" section.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Registering Python Scripts to the Tools Menu (Windows)

Abraham Lee
Hi, Max!

On Thu, Feb 2, 2017 at 12:52 AM, Max Rabkin <[hidden email]> wrote:
Try replacing ~/.fontforge with wherever fontforge keeps its settings. On many Linux distributions it's ~/.config rather than ~ and on Windows it might be in something like "App Settings" (I don't remember the name in Windows 8) in your user folder.

Thank you for the pointer! I found the folder and was able to finally see some new menu items, added by the scripts! For posterity sake, the folder (for me) is:

C:\Users\[YOUR USERNAME HERE]\AppData\Roaming\FontForge\python

That's enough to get things working for me! Thank you sooooooooo much, Max!

Out of curiosity, any idea why the $(PREFIX)\share\fontforge\python folder doesn't work? I often run a portable version of FF and would like to include the scripts there, but can't.

Best,
Abraham

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Loading...