Skip to main content

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

Project description

Google Fonts Axis Registry

This repository is the official upstream Google Fonts Axis Registry.

This data-set is synced into the central github.com/google/fonts git repo, through which all Google Fonts assets are onboarded.

The actual Axis Registry lives within the actual live Google Fonts product, surfaced at fonts.google.com/variablefonts#axis-definitions – so axis definitions are only final when they appear on that page, and this repository will from time to time contain fresh data not in the live system, and subject to change.

The AxisRegistry Python Module

This repo is structured as a Python package/module, providing easy access to the registry data-set from Python programs.

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

This module is the central place for dataset updates. After updates are made here on the main branch, the maintainers of the central repo will update subtree located at google/fonts/axisregistry and then work to push those changes through to the live Google Fonts API via sandbox servers, according to the typical push process. For more detailed information, please see the Axis Registry section of the google/fonts repository explained article in the GF Guide.

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 in the UI. Currently, default to true, for continuous range axes should be set to false.
  • 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), by August 2020 this effort had 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.4.16.tar.gz (4.2 MB view details)

Uploaded Source

Built Distribution

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

axisregistry-0.4.16-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: axisregistry-0.4.16.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for axisregistry-0.4.16.tar.gz
Algorithm Hash digest
SHA256 7a8870b651524eeb6d3efd0fb0ecb5b9ecc64f534d9709bc66e9d525dd5af73a
MD5 22433b3bd1d44729b6898fa1dcd17439
BLAKE2b-256 8c65ccbf5c51920bd6f10e415a91c832d4354ff97f2fcdda3477133109daf2b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for axisregistry-0.4.16.tar.gz:

Publisher: publish-release.yml on googlefonts/axisregistry

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

File details

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

File metadata

  • Download URL: axisregistry-0.4.16-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for axisregistry-0.4.16-py3-none-any.whl
Algorithm Hash digest
SHA256 2fe15aae226a85aee1d48d83be372cd0b80a9b1e43c26822d3cf9d429e44fc0e
MD5 ec237a1e9d80dfa2f2d86384421eb749
BLAKE2b-256 42f9212a8a05a719e4833da9fee9d4faa396000af2b132258ac7016889450174

See more details on using hashes here.

Provenance

The following attestation bundles were made for axisregistry-0.4.16-py3-none-any.whl:

Publisher: publish-release.yml on googlefonts/axisregistry

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