Skip to main content

ttf-opensans

py license status

ttf-opensans is a Python package vending the Open Sans font by Steve Matteson.

It is intended for when you want to use the Open Sans font family without having to worry about availability on the target system.

The Open Sans font family and this package is licensed under the Apache License, Version 2.0.

Installation

This package can be installed through the following command:

python3 -m pip install -U ttf-opensans

Usage

The fonts are provided through instances of the TTFFont class.

You can either access a specific font style directly:

import ttf_opensans

my_font = ttf_opensans.OPENSANS_SEMIBOLDITALIC

Or you can use the helper function to find the most appropriate font style:

from ttf_opensans import opensans

my_font = opensans(font_weight=600, italic=True)

Once you have the font you want, you can access various attributes on it:

print(my_font.name)  # "OpenSans-SemiBoldItalic"
print(my_font.weight)  # 600
print(my_font.italic)  # True
print(my_font.path)  # pathlib.Path("<...>/site_packages/ttf_opensans/ttf/OpenSans-SemiBoldItalic.ttf")

You can also open the font for reading directly:

with my_font.open() as fp:
    font_data = fp.read()

If you use the Python Imaging Library (Pillow), you can also directly get an ImageFont instance:

from PIL import Image, ImageDraw, ImageFont

with Image.new("RGB", (512, 512), (255, 255, 255)) as im:
    draw = ImageDraw.Draw(im)
    imagefont = my_font.imagefont(size=48)

    draw.text(font=imagefont, fill=(0, 0, 0), xy=(0, 0), text="Hello World!")

Metadata

Release files for ttf-opensans 2020.10.30

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

Source distribution (sdist)

Source distribution for ttf-opensans 2020.10.30
File Size Uploaded Provenance Actions
ttf-opensans-2020.10.30.tar.gz 602.1 kB Without provenance Details for ttf-opensans-2020.10.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ttf-opensans 2020.10.30
File Interpreter ABI Platform Actions
ttf_opensans-2020.10.30-py3-none-any.whl Python 3 none any Details for ttf_opensans-2020.10.30-py3-none-any.whl

Total release size: 1.2 MB

Release files / ttf-opensans-2020.10.30.tar.gz

Download URL ttf-opensans-2020.10.30.tar.gz
Size 602.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bbc6e8e1f354a8a20970cb9e2a6fbd10cf2e855c9194e1d59268487d7d4d1e83
BLAKE2b-256 checksum
How to use checksums
adee50958ddd4139ddca88670873596d648ab1f4c90193cf3abb1cc82cd9bdad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release files / ttf_opensans-2020.10.30-py3-none-any.whl

Download URL ttf_opensans-2020.10.30-py3-none-any.whl
Size 599.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ce65f171eb60fc16c15b31fc714cc5735533acb43b0637e5cebb612e2a9ac9c
BLAKE2b-256 checksum
How to use checksums
00760a5a5f4700d1c2ee85e7afa209c3b53bbe5540bf7c06da605229e3676257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Security for ttf-opensans 2020.10.30

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2020.10.30 This release

2 release files No provenance

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