Skip to main content

Load, examine and save fonts in Context format

Project description

Context: Load, examine and save fonts in Context format

This describes Context >3.0, which is a complete rewrite from the previous version.

Context is a utility for loading and examining fonts in the Context format.

The Context format is a JSON-based font format that provides a simple and consistent way to work with font data. It supports single master and variable fonts.

The object hierarchy can be seen here.

For example:

from context import load

font = load("Myfont.context")
default_a = font.default_master.get_glyph_layer("A")
top_anchor = default_a.anchors_dict["top"]
print("Top anchor = (%i,%i)" % (top_anchor.x, top_anchor.y))
print("LSB, RSB = (%i,%i)" % (default_a.lsb, default_a.rsb))
font.save("Myfont-modified.context")

AI-Friendly Documentation

Context includes an AI documentation generator for creating concise, natural language documentation suitable for LLM/AI prompts:

from context import generate_minimal_docs, generate_class_docs, generate_all_docs

# Generate minimal documentation for common use cases
minimal_docs = generate_minimal_docs()

# Generate documentation for a specific class
from context import Font
font_docs = generate_class_docs(Font)

# Generate full documentation for all classes
all_docs = generate_all_docs()

This is useful when you need to provide context about Context's structure to an AI assistant.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contextfonteditor-1.0.3.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contextfonteditor-1.0.3-py3-none-any.whl (521.4 kB view details)

Uploaded Python 3

File details

Details for the file contextfonteditor-1.0.3.tar.gz.

File metadata

  • Download URL: contextfonteditor-1.0.3.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for contextfonteditor-1.0.3.tar.gz
Algorithm Hash digest
SHA256 24b3ea109f4394a994e38046254be862b7de9995174812259e0ea9c180a27f56
MD5 42c4ea3f3ad27f5e9155dab1e39b2303
BLAKE2b-256 d92ba188c4063bb7011f1e93a7cdf2752de74657667b3cbc0f8640e2665dc595

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextfonteditor-1.0.3.tar.gz:

Publisher: ci.yml on yanone/context-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contextfonteditor-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for contextfonteditor-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 baf30bd47cdcd471cd1f128b23ca492cb4450583b8e2a13a69c9c816772ffe52
MD5 7eda0eabcb3900dfaf49f14ab55da3d6
BLAKE2b-256 412d8be0bef87c87e4801ecb13f0c0e28b204c150d152cce89253e23850683bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for contextfonteditor-1.0.3-py3-none-any.whl:

Publisher: ci.yml on yanone/context-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page