Skip to content

Commit

Permalink
feat: axis registry (#117)
Browse files Browse the repository at this point in the history
* feat: add axis registry data

* feat: add new registry to variable parser

* docs: update changelog

* test: fix lint errors in ci
  • Loading branch information
ayuhito committed Mar 1, 2023
1 parent b9d8a93 commit e58f0ad
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 41 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ require("@ayuhito/eslint-config/patch");

module.exports = {
extends: ["@ayuhito/eslint-config/profile/node"],
parserOptions: { tsconfigRootDir: __dirname },
parserOptions: { tsconfigRootDir: __dirname },
rules: {
"@typescript-eslint/no-throw-literal": "off",
}
};
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Google Font Metadata will log all notable changes within this file.

# [4.2.0](https://github.com/fontsource/google-font-metadata/releases/tag/v4.2.0)

## Features

- Automatically update axis registry. [#117](https://github.com/fontsource/google-font-metadata/pull/117)

# [4.1.4](https://github.com/fontsource/google-font-metadata/releases/tag/v4.1.4)

## Fixes
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,25 @@ Scrapes the [Google Fonts Attribution](https://fonts.google.com/attribution) pag

Exports [`data/licenses.json`](https://github.com/fontsource/google-font-metadata/tree/main/data/licenses.json)

## Axis Registry

```json
{
...
{
"name": "Thick Stroke",
"tag": "XOPQ",
"min": -1000,
"max": 2000,
"default": 88,
"precision": 0
},
...
}
```

Exports [`data/licenses.json`](https://github.com/fontsource/google-font-metadata/tree/main/data/axis-registry.json)

## Updating API Files

You can use the `gfm` CLI tool to update the metadata with fresh results from the Google APIs.
Expand Down
298 changes: 298 additions & 0 deletions data/axis-registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
[
{
"name": "Bounce",
"tag": "BNCE",
"min": -100,
"max": 100,
"default": 0,
"precision": 0
},
{
"name": "Casual",
"tag": "CASL",
"min": 0,
"max": 1,
"default": 0,
"precision": -2
},
{
"name": "On",
"tag": "CRSV",
"min": 0,
"max": 1,
"default": 0.5,
"precision": -1
},
{
"name": "Edge Highlight",
"tag": "EHLT",
"min": 0,
"max": 1000,
"default": null,
"precision": 0
},
{
"name": "Element Grid",
"tag": "ELGR",
"min": 1,
"max": 2,
"default": 1,
"precision": -1
},
{
"name": "Element Shape",
"tag": "ELSH",
"min": 0,
"max": 100,
"default": 0,
"precision": -1
},
{
"name": "Extrusion Depth",
"tag": "EDPT",
"min": 0,
"max": 1000,
"default": null,
"precision": 0
},
{
"name": "Fill",
"tag": "FILL",
"min": 0,
"max": 1,
"default": 0,
"precision": -2
},
{
"name": "Flare",
"tag": "FLAR",
"min": 0,
"max": 100,
"default": 0,
"precision": 0
},
{
"name": "Grade",
"tag": "GRAD",
"min": -1000,
"max": 1000,
"default": 0,
"precision": 0
},
{
"name": "Hyper Expansion",
"tag": "HEXP",
"min": 0,
"max": 100,
"default": 0,
"precision": -1
},
{
"name": "Informality",
"tag": "INFM",
"min": 0,
"max": 100,
"default": 0,
"precision": 0
},
{
"name": "Italic",
"tag": "ital",
"min": 0,
"max": 1,
"default": 0,
"precision": 0
},
{
"name": "Monospace",
"tag": "MONO",
"min": 0,
"max": 1,
"default": 0,
"precision": -2
},
{
"name": "Morph",
"tag": "MORF",
"min": 0,
"max": 60,
"default": 0,
"precision": 0
},
{
"name": "Mutation",
"tag": "MUTA",
"min": 0,
"max": 60,
"default": 0,
"precision": 0
},
{
"name": "Optical Size",
"tag": "opsz",
"min": 5,
"max": 1200,
"default": 14,
"precision": -1
},
{
"name": "Roundness",
"tag": "ROND",
"min": 0,
"max": 100,
"default": 0,
"precision": 0
},
{
"name": "Slant",
"tag": "slnt",
"min": -90,
"max": 90,
"default": 0,
"precision": 0
},
{
"name": "Softness",
"tag": "SOFT",
"min": 0,
"max": 100,
"default": 0,
"precision": -1
},
{
"name": "Spacing",
"tag": "SPAC",
"min": -100,
"max": 100,
"default": 0,
"precision": -1
},
{
"name": "Volume",
"tag": "VOLM",
"min": 0,
"max": 100,
"default": 0,
"precision": 0
},
{
"name": "Weight",
"tag": "wght",
"min": 1,
"max": 1000,
"default": 400,
"precision": 0
},
{
"name": "Width",
"tag": "wdth",
"min": 25,
"max": 200,
"default": 100,
"precision": -1
},
{
"name": "Wonky",
"tag": "WONK",
"min": 0,
"max": 1,
"default": 0,
"precision": 0
},
{
"name": "Thick Stroke",
"tag": "XOPQ",
"min": -1000,
"max": 2000,
"default": 88,
"precision": 0
},
{
"name": "Rotation in X",
"tag": "XROT",
"min": -180,
"max": 180,
"default": 0,
"precision": 0
},
{
"name": "Counter Width",
"tag": "XTRA",
"min": -1000,
"max": 2000,
"default": 400,
"precision": 0
},
{
"name": "X transparent figures",
"tag": "XTFI",
"min": -1000,
"max": 2000,
"default": 400,
"precision": 0
},
{
"name": "Thin Stroke",
"tag": "YOPQ",
"min": -1000,
"max": 2000,
"default": 116,
"precision": 0
},
{
"name": "Rotation in Y",
"tag": "YROT",
"min": -180,
"max": 180,
"default": 0,
"precision": 0
},
{
"name": "Ascender Height",
"tag": "YTAS",
"min": 0,
"max": 1000,
"default": 750,
"precision": 0
},
{
"name": "Descender Depth",
"tag": "YTDE",
"min": -1000,
"max": 0,
"default": -250,
"precision": 0
},
{
"name": "Figure Height",
"tag": "YTFI",
"min": -1000,
"max": 2000,
"default": null,
"precision": 0
},
{
"name": "Lowercase Height",
"tag": "YTLC",
"min": 0,
"max": 1000,
"default": 500,
"precision": 0
},
{
"name": "Uppercase Height",
"tag": "YTUC",
"min": 0,
"max": 1000,
"default": 725,
"precision": 0
},
{
"name": "Year",
"tag": "YEAR",
"min": -4000,
"max": 4000,
"default": 2000,
"precision": 0
}
]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "google-font-metadata",
"description": "A metadata generator for Google Fonts.",
"version": "4.1.4",
"version": "4.2.0",
"author": "Ayuhito <hello@ayuhito.com>",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand All @@ -25,6 +25,7 @@
"unicode range"
],
"dependencies": {
"@octokit/core": "^4.2.0",
"cac": "^6.7.14",
"consola": "^2.15.3",
"deepmerge": "^4.2.2",
Expand Down
Loading

0 comments on commit e58f0ad

Please sign in to comment.