-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(api): add variable stats and version api docs (#956)
- Loading branch information
Showing
10 changed files
with
273 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: Axis Registry | ||
section: Reference | ||
--- | ||
|
||
## Axis Registry | ||
|
||
--- | ||
|
||
The Axis Registry endpoint gives detailed descriptions of variable axis tags and their corresponding values. | ||
|
||
### HTTP Request | ||
|
||
- `GET https://api.fontsource.org/v1/axis-registry` | ||
|
||
### Response | ||
|
||
The API response for the Fontlist endpoint is a JSON object. | ||
|
||
#### Attributes: | ||
|
||
Returns an object of: | ||
|
||
| Attribute | Type | Description | | ||
| --------- | -------------------------------------- | --------------- | | ||
| [tag] | Record<string, AxisRegistryItem> | Axis tag object | | ||
|
||
<br /> | ||
|
||
**AxisRegistryItem:** | ||
|
||
|
||
| Attribute | Type | Description | | ||
| ----------- | ------ | ------------------------------- | | ||
| name | string | Axis name | | ||
| description | string | Axis description | | ||
| min | number | Minimum value possible for axis | | ||
| max | number | Maximum value possible for axis | | ||
| default | number | Default value for axis | | ||
| precision | number | Precision | | ||
|
||
#### Response example: | ||
|
||
```json | ||
{ | ||
... | ||
"ARRR":{ | ||
"name":"AR Retinal Resolution", | ||
"description":"Resolution-specific enhancements in AR/VR typefaces to optimize rendering across the different resolutions of the headsets making designs accessible and easy to read.", | ||
"min":10, | ||
"max":60, | ||
"default":10, | ||
"precision":0 | ||
}, | ||
... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
title: Stats | ||
section: Reference | ||
--- | ||
|
||
## Stats | ||
|
||
--- | ||
|
||
The Stats endpoint provides download statistics for each font. | ||
|
||
### HTTP Request | ||
|
||
- `GET https://api.fontsource.org/v1/stats/{id}` | ||
|
||
### Response | ||
|
||
The API response for the Stats endpoint is a JSON object that provides download statistics for each font. | ||
|
||
#### Attributes: | ||
|
||
Returns an object with: | ||
|
||
| Attribute | Type | Description | | ||
| --------- | ----------------------------- | ------------------------ | | ||
| total | DownloadStats | Total download counts | | ||
| static | DownloadStats | Static download counts | | ||
| variable | Optional<DownloadStats> | Variable download counts | | ||
|
||
<br /> | ||
|
||
|
||
**DownloadStats:** | ||
|
||
| Attribute | Type | Description | | ||
| ------------------- | ------ | -------------------------- | | ||
| npmDownloadTotal | number | Total NPM download count | | ||
| npmDownloadMonthly | number | Monthly NPM download count | | ||
| jsDelivrHitsTotal | number | Total jsDelivr hits | | ||
| jsDelivrHitsMonthly | number | Monthly jsDelivr hits | | ||
|
||
#### Response example: | ||
|
||
```json | ||
{ | ||
"total":{ | ||
"npmDownloadTotal":8566215, | ||
"npmDownloadMonthly":731202, | ||
"jsDelivrHitsTotal":46488758, | ||
"jsDelivrHitsMonthly":8210654 | ||
}, | ||
"static":{ | ||
"npmDownloadTotal":8288204, | ||
"npmDownloadMonthly":637495, | ||
"jsDelivrHitsTotal":46483427, | ||
"jsDelivrHitsMonthly":8207141 | ||
}, | ||
"variable":{ | ||
"npmDownloadTotal":278011, | ||
"npmDownloadMonthly":93707, | ||
"jsDelivrHitsTotal":5331, | ||
"jsDelivrHitsMonthly":3513 | ||
} | ||
} | ||
``` | ||
|
||
#### Example: | ||
|
||
- `GET https://api.fontsource.org/v1/stats/abel` | ||
- `GET https://api.fontsource.org/v1/stats/open-sans` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: Variable | ||
section: Reference | ||
--- | ||
|
||
## Variable | ||
|
||
--- | ||
|
||
The Variable endpoint allows you get specific axis data for a variable font. | ||
|
||
### HTTP Request | ||
|
||
- `GET https://api.fontsource.org/v1/variable/{id}` | ||
|
||
### Response | ||
|
||
The API response for the Variable endpoint is a JSON object that provides axis data for a variable font. | ||
|
||
#### Attributes: | ||
|
||
Returns an object with: | ||
|
||
| Attribute | Type | Description | | ||
| --------- | ------------------------------ | ----------- | | ||
| family | string | Font family | | ||
| axes | Record<string, AxesData> | Axis data | | ||
|
||
<br /> | ||
|
||
**AxesData:** | ||
|
||
| Attribute | Type | Description | | ||
| --------- | ------ | ------------- | | ||
| default | number | Default value | | ||
| min | number | Minimum value | | ||
| max | number | Maximum value | | ||
| step | number | Step value | | ||
|
||
#### Response example: | ||
|
||
```json | ||
{ | ||
"axes": { | ||
"slnt": { | ||
"default": "0", | ||
"min": "-10", | ||
"max": "0", | ||
"step": "1" | ||
}, | ||
"wght": { | ||
"default": "400", | ||
"min": "100", | ||
"max": "900", | ||
"step": "1" | ||
} | ||
}, | ||
"family": "Inter" | ||
} | ||
``` | ||
|
||
#### Example: | ||
|
||
- `GET https://api.fontsource.org/v1/variable/inter` | ||
- `GET https://api.fontsource.org/v1/variable/roboto-flex` | ||
- `GET https://api.fontsource.org/v1/variable/wavefont` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title: Version | ||
section: Reference | ||
--- | ||
|
||
## Version | ||
|
||
--- | ||
|
||
The Version endpoint provides NPM version information for each package. | ||
|
||
### HTTP Request | ||
|
||
- `GET https://api.fontsource.org/v1/version/{id}` | ||
|
||
### Response | ||
|
||
The API response for the Version endpoint is a JSON object that provides NPM version information for each package. | ||
|
||
#### Attributes: | ||
|
||
Returns an object with: | ||
|
||
| Attribute | Type | Description | | ||
| -------------- | ------------------------ | --------------------------------------------- | | ||
| latest | string | Latest static NPM version | | ||
| static | string[] | Static NPM versions sorted newest to oldest | | ||
| latestVariable | Optional<string> | Latest variable NPM version | | ||
| variable | Optional<string[]> | Variable NPM versions sorted newest to oldest | | ||
|
||
#### Response example: | ||
|
||
```json | ||
{ | ||
"latest": "5.0.4", | ||
"static": [ | ||
"5.0.4", | ||
"5.0.3", | ||
"5.0.2", | ||
"5.0.1", | ||
"5.0.0", | ||
"4.2.2", | ||
"4.2.1", | ||
"4.2.0", | ||
"4.1.1", | ||
"4.1.0", | ||
"4.0.1", | ||
"4.0.0" | ||
], | ||
"latestVariable": "5.0.7", | ||
"variable": [ | ||
"5.0.7", | ||
"5.0.6", | ||
"5.0.5", | ||
"5.0.4", | ||
"5.0.3", | ||
"5.0.2", | ||
"5.0.1", | ||
"5.0.0" | ||
] | ||
} | ||
``` | ||
|
||
#### Example: | ||
|
||
- `GET https://api.fontsource.org/v1/version/abel` | ||
- `GET https://api.fontsource.org/v1/version/open-sans` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters