Skip to main content

py-open-fonts

Open Fonts in pip and conda.

Install

Needs python 3.6+

conda install -c defaults -c conda-forge py-open-fonts

or

pip install py-open-fonts

API

CLI

Usage: open-fonts-css [OPTIONS] [FONTS]...

  Generates CSS source with @font-face definitions with absolute paths to
  fonts files as URL.

  Multiple FONTS like FontName can be provided. For example "FontName"
  argument means using $PYTHONPREFIX/fonts/open-fonts/css/FontName.css If
  none were provided then all fonts definitions from
  $PYTHONPREFIX/fonts/open-fonts/css/ would be used.

  Note that spaces would be removed from provided font names and CSS files
  do not contain spaces in their names.

Options:
  -p, --pref TEXT  Generated CSS would have TEXT as prefix in URL to fonts
                   files (instead of default absolute path as URL). Like:
                   ${PREFIX}FontName.ttf ("<...>" to "TEXT"replacement
                   actually)
  -o, --out TEXT   Save CSS to TEXT filepath. "-" means write to stdout
                   (default behaviour)
  --help           Show this message and exit.

open_fonts_css

def open_fonts_css(*fonts: str, pref: str=None, out: str=None) -> str:
    """
    Generates CSS source with @font-face definitions with absolute paths
    to fonts files as URL.

    Multiple ``fonts`` like ``"FontName"`` can be provided. For example ``"FontName"``
    argument means using ``$PYTHONPREFIX/fonts/open-fonts/css/FontName.css``
    If none were provided (``fonts`` is ``()``) then all fonts definitions from
    ``$PYTHONPREFIX/fonts/open-fonts/css/`` would be used.

    Note that spaces would be removed from provided font names and CSS files
    do not contain spaces in their names. 

    :param pref:
        Generated CSS would have ``pref`` as prefix in URL to fonts files (instead
        of default absolute path as URL). Like: ``f"{pref}FontName.ttf"``
        ("<...>" to ``pref`` replacement actually).
    :param out:
        Save CSS to ``out`` filepath. ``"-"`` or ``None`` mean do nothing.

    :return: CSS source code if out is None or '-' else returns ''
    """

Metadata

Release files for py-open-fonts 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-open-fonts 0.7.0
File Size Uploaded Provenance
py-open-fonts-0.7.0.tar.gz 6.5 kB Without provenance Details

Release files / py-open-fonts-0.7.0.tar.gz

Download URL py-open-fonts-0.7.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cb6fcae2d812c3c8d4b3794bb5342a27119970666f3be7812eb3e9bad63d0bb6
BLAKE2b-256 checksum
How to use checksums
31d8cddc98843216b52a6a666dd91a8ed37588526e5a72d9a8970fafcdc163bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

Security for py-open-fonts 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page