Code Monkey home page Code Monkey logo

fontfinder's Introduction

FoundryTools-CLI

FoundryTools-CLI, former known as ftCLI, is a collection of command line tools written in Python to inspect, manipulate and convert fonts. It takes advantage of the capabilities made available by other tools such as:

image

The command line interface is built with click and tables are rendered by rich.

Even if not directly imported to keep the footprint as small as possible, portions of code have been copied from fontbakery and font-line.

Installation

FoundryTools-CLI requires Python 3.9 or later.

Note for Windows users: installation on Python 3.11 and later may fail due to an error while building the wheel for the AFDKO dependency. This is a known issue and a workaround is to install Visual Studio 2022 (Community Edition is fine) and the Python development workload, selecting the Python native development tools optional component.

image

IMPORTANT: If you have Python 2.x installed in your system, you may have to use python3 (instead of python) in the commands below.

pip

FoundryTools-CLI releases are available on the Python Package Index (PyPI), so it can be installed with pip:

python -m pip install foundrytools-cli

Editable mode

If you would like to contribute to the development, you can clone the repository from GitHub, install the package in 'editable' mode and modify the source code in place. We strongly recommend using a virtual environment.

# clone the repository:
git clone https://github.com/ftCLI/foundrytools-cli.git
cd foundrytools-cli

# create new virtual environment named e.g. ftcli-venv, or whatever you prefer:
python -m venv ftcli-venv

# to activate the virtual environmtnet in macOS and Linux, do:
. ftcli-venv/bin/activate

# to activate the virtual environment in Windows, do:
ftcli-venv\Scripts\activate.bat

# install in 'editable' mode
python -m pip install -e .

Documentation

FoundryTools-CLI is a Terminal app where commands are logically organized into subcommands.

Please refer to the user documentation.

License

FoundryTools-CLI is available under the MIT license

Credits

To Sergiev. May You rest in peace.

fontfinder's People

Contributors

ftcli avatar pre-commit-ci[bot] avatar renovate[bot] avatar

Watchers

 avatar

fontfinder's Issues

How do I install this inside of an existing FontTool VENV?

I tried following instructions here: https://www.activestate.com/resources/quick-reads/how-to-manually-install-python-packages/

  1. Activate my FontTools VENV
  2. cd into the root directory where setup.py is located
  3. Enter: python setup.py install

This didn't work and gave me a bunch of depreciation warnings. Is there a proper way to install this that I'm missing? I'd really like to use this helper.

My FontTools VENV is using Python 3.10.11. Any help would be fantastic. Thank you for creating this helper tool.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/codecov.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/setup-python v5
  • codecov/codecov-action v4
pip_requirements
requirements.txt
  • fonttools ==4.53.1

  • Check this box to trigger a request for Renovate to run again on this repository

How do I get information out of a "fontTools.ttLib.ttFont.TTFont object"? Or a <'name' table at 18f23a4ca90>

I'm testing FontFinder and have no clue how to get it to display human readable information out of the fonts it finds. Here's a small script I'm using to test:

import sys
from sys import argv
from sys import exit
import json
from font_finder import FontFinder

# find all variable fonts in a directory and its subdirectories
finder = FontFinder("D:/Fonts/Licensed/Sans Circular+/00 Temp", recursive=False)
finder.filter_out_static = True  # filter out static fonts
fonts = finder.find_fonts()

for x in range(len(fonts)):
    print(fonts[x]);

The above code prints out five lines corresponding to my variable fonts:

<fontTools.ttLib.ttFont.TTFont object at 0x00000253A247CAC0>
<fontTools.ttLib.ttFont.TTFont object at 0x00000253A247C430>
<fontTools.ttLib.ttFont.TTFont object at 0x00000253A247C400>
<fontTools.ttLib.ttFont.TTFont object at 0x00000253A247CE20>
<fontTools.ttLib.ttFont.TTFont object at 0x00000253A247D660>

But I am not able to figure out how to access the information from each TTFont object, like the font name, font path, etc. How can I accomplish this? I've tried reading the documentation but still can't figure it out.

I also tried:

import sys
from sys import argv
from sys import exit
import json
from font_finder import FontFinder

# find all variable fonts in a directory and its subdirectories
finder = FontFinder("D:/Fonts/Licensed/Sans Circular+/00 Temp", recursive=False)
finder.filter_out_static = True  # filter out static fonts
fonts = finder.find_fonts()

for x in range(len(fonts)):
    print(fonts[x]['name']);

But then I just get this:

<'name' table at 18f23a4ca90>
<'name' table at 18f26152440>
<'name' table at 18f26152d10>
<'name' table at 18f26153970>
<'name' table at 18f26170460>

Any help would be greatly, greatly appreciated!

Thanks again,
Joseph

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.