Skip to main content

A python API to access data from the Google Fonts variable fonts axis registry.

Project description

AxisRegistry Python Module

This repository contains a python package providing easy access to the GF Axis Registry. Data was copied (and is kept is sync with) its original location at the axisregistry directory on the google/fonts git repo.

As of March 4th, 2022, there's an ongoing plan to soon make this module the central place for updates on the data-set.

GF Axis Registry

This package contains a collection of metadata source files that collectively form the Google Fonts Axis Registry.

The live Axis Registry is at fonts.google.com/variablefonts, and axis definitions are only final when they appear on that page.

When the registry is updated here, a line like axisregistry/axis_name.textproto should be added to the to_sandbox.txt file.

Axis Metadata Fields

  • tag
    • Tag for the axis used to specify an axis in font-variation-settings and CSS API requests.
  • display_name
    • Readable name for the axis, generally the expanded form of tag.
  • min_value
    • Lower bound of the axis. Inclusive.
  • max_value
    • Upper bound of the axis. Inclusive.
  • default_value
    • Default position of the aixs.
  • precision
    • Describes the specificity at which an axis position can be specified. For example, 0 means values must be specified as whole numbers while -1 means values can be as precise as one decimal place.
  • fallback
    • Instance positions along the axis, such as wght 100,200,300,400,500,600,700,800,900.
    • A cross-product of fallback positions along all supported axes is created to support legacy browsers that lack variable font support. For axes with CSS3 properties (such as font-weight), the positions accessible to CSS3 should be specified. For axes lacking CSS3 properties a legacy browser is limited to a single position and that position must be at a fallback.
      In case an axis doesn't include predefined positions, it is mandatory to define at least one fallback position. It should be called Default and its value should correspond to the default_value position of the axis.
  • fallback_only
    • Describes whether to only use fallback values when presenting to users.
  • description
    • A description of the axis.

Why does Google Fonts have its own Axis Registry?

We support a superset of the OpenType axis registry axis set, and use additional metadata for each axis. Axes present in a font file but not in this registry will not function via our API. No variable font is expected to support all of the axes here.

Any font foundry or distributor library that offers variable fonts has a implicit, latent, de-facto axis registry, which can be extracted by scanning the library for axes' tags, labels, and min/def/max values. While in 2016 Microsoft originally offered to include more axes in the OpenType 1.8 specification (github.com/microsoft/OpenTypeDesignVariationAxisTags), as of August 2020, this effort has stalled. We hope more foundries and distributors will publish documents like this that make their axes explicit, to encourage of adoption of variable fonts throughout the industry, and provide source material for a future update to the OpenType specification's axis registry.

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

axisregistry-0.3.9.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

axisregistry-0.3.9-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file axisregistry-0.3.9.tar.gz.

File metadata

  • Download URL: axisregistry-0.3.9.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for axisregistry-0.3.9.tar.gz
Algorithm Hash digest
SHA256 33fb839e9c869360a30cb8846dce0b1e8d153b6bef4a90f2b94e0696041b9c7a
MD5 43a22f5896ac7b1972b44e548b4a8681
BLAKE2b-256 e9c513b02a097dd3f735b22b77622a04aaf8fcba7a9ac35bca8081776c05d6ee

See more details on using hashes here.

Provenance

File details

Details for the file axisregistry-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: axisregistry-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for axisregistry-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c6bfa627ebd7faaffaec2ddc1c4812caff4248a77f1023eb4ef6292092e88447
MD5 fa6c6478e51ac82394b28c8771e4dad6
BLAKE2b-256 1eb7eefdda2a876a193563dbe1f8d1c0452d8c54dca75a3cd17392a4a97cb4f3

See more details on using hashes here.

Provenance

Supported by

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