Giter VIP home page Giter VIP logo

Comments (6)

chrissimpkins avatar chrissimpkins commented on August 27, 2024

Hi Maciej!

What operating system are you using? It is possible to define this script so that it runs globally on your command line, but the approach differs by OS

from fontname.py.

laictype avatar laictype commented on August 27, 2024

Thank you for your answer!
I'm on Big Sur 11.3 (20E232)

from fontname.py.

chrissimpkins avatar chrissimpkins commented on August 27, 2024

I'm on Big Sur 11.3 (20E232)

I am on macOS too. The way that I approach it is to add scripts (shell, Python) to a scripts directory under my home directory, and then add that directory to my system PATH. Here is an example of instructions to update your PATH on Big Sur:

https://wpbeaches.com/how-to-add-to-the-shell-path-in-macos-using-terminal/

My approach is the "permanent" approach in that article. I edit the PATH in the .zshrc configuration file with the following line:

export PATH="/Users/chris/scripts:$PATH"

Take care to confirm that your paths are correct when you do this if you are not familiar with PATH editing. It is possible to interfere with access to system executables on your system if you do something like forget to add the $PATH element in the line (this appends or prepends the existing PATH defintion based on the location where you place it in the string, this is how you define priority of executables that have the same name - if it points to a same name file that is first in order it takes precedence over one that is found in a dir path later in the PATH string).

Keep the fontname.py script in the top level of the directory that you add to your path. Make sure to run the source ~/.zshrc step after you edit the .zshrc file and then you can run the script here with the following command on your command line from any working directory:

fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

Note that you need to install the fonttools Python package in order to do this. This is no different from the requirement when you use it with the syntax:

python3 fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

If you want a simpler approach that does not involve PATH editing, you can always point the python interpreter at the script location on your system:

python3 path/to/directory/fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

Let me know if this doesn't address your question.

from fontname.py.

chrissimpkins avatar chrissimpkins commented on August 27, 2024

It is also possible to remove the .py file extension from the file if you prefer to use the syntax:

fontname [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

from fontname.py.

laictype avatar laictype commented on August 27, 2024

If you want a simpler approach that does not involve PATH editing, you can always point the python interpreter at the script location on your system:
python3 path/to/directory/fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

Thank you for describing it so precisely!
The one quoted above seems like a solution for me. I will examine that.
Best!

from fontname.py.

chrissimpkins avatar chrissimpkins commented on August 27, 2024

Good luck!

from fontname.py.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.