Open twardoch opened 2 years ago
Was this generated from the Google Fonts collection?
Could you please share the script that was used to compute this?
This was generated from the Google Fonts collection and an extensive collection of proprietary fonts.
The code to get this (I just updated the table above to be sorted by frequency) is:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2022 by Adam Twardoch
# Licensed per your choice under the Apache 2 license, or under the MIT License
# Also published under the CC-0 Public Domain attribution, no rights reserved.
import sys
from pathlib import Path
import fontTools.ttLib
from collections import Counter
import yaml
from statistics import mode
def main(folder):
folder = Path(folder)
daxes = {}
for path in folder.glob("**/*.?tf"):
try:
font = fontTools.ttLib.TTFont(path)
fvar = font["fvar"]
for axis in fvar.axes:
daxes[axis.axisTag] = daxes.get(axis.axisTag, {})
daxes[axis.axisTag]["display_name"] = daxes[axis.axisTag].get(
"display_name", []
) + [font["name"].getDebugName(axis.axisNameID)]
daxes[axis.axisTag]["min_value"] = daxes[axis.axisTag].get(
"min_value", []
) + [axis.minValue]
daxes[axis.axisTag]["default_value"] = daxes[axis.axisTag].get(
"default_value", []
) + [axis.defaultValue]
daxes[axis.axisTag]["max_value"] = daxes[axis.axisTag].get(
"max_value", []
) + [axis.maxValue]
daxes[axis.axisTag]["font"] = daxes[axis.axisTag].get("font", []) + [
font["name"].getDebugName(6)
]
except:
pass
for axis in daxes:
daxes[axis]["display_name"] = [
key for key, value in Counter(daxes[axis]["display_name"]).most_common()
]
daxes[axis]["freq"] = len(daxes[axis]["font"])
daxes[axis]["min_value"] = mode(daxes[axis]["min_value"])
daxes[axis]["default_value"] = mode(daxes[axis]["default_value"])
daxes[axis]["max_value"] = mode(daxes[axis]["max_value"])
daxes[axis]["font"] = [
key for key, value in Counter(daxes[axis]["font"]).most_common()
]
del daxes[axis]["font"]
daxes = dict(sorted(daxes.items(), key=lambda x: x[1]["freq"], reverse=True))
return yaml.dump(daxes, allow_unicode=True, sort_keys=False)
if __name__ == "__main__":
print(main(sys.argv[1]))
I presume this code snippet is released under Apache 2.0 (same license as the code in this repo). Please confirm that.
Some fonts were duplicates, and obviously in some of the fonts the wght
tag was used for functionally other axes, like Grade etc. This is why the display_name
is a list — sorted by descending frequency for each axis name associated with a given tag.
I’ve included the license terms: "Copyright (c) 2022 by Adam Twardoch. Licensed per your choice under the Apache 2 license, or under the MIT License. Also published under the CC-0 Public Domain attribution, no rights reserved."
This is the Google Fonts collection from google/fonts repo:
wght:
display_name:
- Weight
- wght
min_value: 100.0
default_value: 400.0
max_value: 900.0
freq: 340
wdth:
display_name:
- Width
- wdth
min_value: 62.5
default_value: 100.0
max_value: 100.0
freq: 85
opsz:
display_name:
- Optical size
- Optical Size
- opsz
min_value: 8.0
default_value: 12.0
max_value: 72.0
freq: 22
GRAD:
display_name:
- Grade
- GRAD
min_value: -50.0
default_value: 0.0
max_value: 150.0
freq: 4
slnt:
display_name:
- Slant
- slnt
min_value: -10.0
default_value: 0.0
max_value: 0.0
freq: 4
SOFT:
display_name:
- Softness
min_value: 0.0
default_value: 0.0
max_value: 100.0
freq: 2
WONK:
display_name:
- Wonky
min_value: 0.0
default_value: 1.0
max_value: 1.0
freq: 2
XOPQ:
display_name:
- x opaque
- XOPQ
min_value: 5.0
default_value: 88.0
max_value: 500.0
freq: 2
XTRA:
display_name:
- x transparent
- XTRA
min_value: 42.0
default_value: 402.0
max_value: 402.0
freq: 2
YOPQ:
display_name:
- y opaque
- YOPQ
min_value: 4.0
default_value: 50.0
max_value: 85.0
freq: 2
YTLC:
display_name:
- lc y transparent
- YTLC
min_value: 445.0
default_value: 500.0
max_value: 600.0
freq: 2
YTAS:
display_name:
- y transparent ascender
- YTAS
min_value: 650.0
default_value: 750.0
max_value: 850.0
freq: 2
YTDE:
display_name:
- y transparent descender
- YTDE
min_value: 150.0
default_value: 250.0
max_value: 350.0
freq: 2
YTUC:
display_name:
- y transparent uppercase
- YTUC
min_value: 650.0
default_value: 750.0
max_value: 950.0
freq: 2
YTSE:
display_name:
- Serif height
min_value: 0.0
default_value: 18.0
max_value: 48.0
freq: 1
XTCH:
display_name:
- x transparent Chinese
min_value: 800.0
default_value: 1000.0
max_value: 1200.0
freq: 1
YTCH:
display_name:
- y transparent Chinese
min_value: 800.0
default_value: 1000.0
max_value: 1200.0
freq: 1
YTRA:
display_name:
- y transparent
min_value: 800.0
default_value: 1000.0
max_value: 1200.0
freq: 1
NEGA:
display_name:
- Negative
min_value: -1.0
default_value: 0.0
max_value: 0.0
freq: 1
MONO:
display_name:
- Monospace
min_value: 0.0
default_value: 0.0
max_value: 1.0
freq: 1
CASL:
display_name:
- Casual
min_value: 0.0
default_value: 0.0
max_value: 1.0
freq: 1
CRSV:
display_name:
- Cursive
min_value: 0.0
default_value: 0.5
max_value: 1.0
freq: 1
ESHP:
display_name:
- Element Shape
min_value: 0.0
default_value: 2.0
max_value: 16.0
freq: 1
EGRD:
display_name:
- Element Grid
min_value: 1.0
default_value: 1.0
max_value: 3.0
freq: 1
BLDA:
display_name:
- Inline
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMD:
display_name:
- Shearded
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMC:
display_name:
- Rounded Slab
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
SKLD:
display_name:
- Stripes
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRML:
display_name:
- Worm Terminal
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
SKLA:
display_name:
- Inline Skeleton
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMF:
display_name:
- Open Inline Terminal
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMK:
display_name:
- Inline Terminal
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
BLDB:
display_name:
- Worm
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
WMX2:
display_name:
- Weight
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMB:
display_name:
- Flared
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMA:
display_name:
- Rounded
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
SKLB:
display_name:
- Worm Skeleton
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRMG:
display_name:
- Slab
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
TRME:
display_name:
- Bifurcated
min_value: 0.0
default_value: 0.0
max_value: 1000.0
freq: 1
YTFI:
display_name:
- YTFI
min_value: 560.0
default_value: 738.0
max_value: 788.0
freq: 1
FLAR:
display_name:
- Flair
min_value: 0.0
default_value: 0.0
max_value: 100.0
freq: 1
VOLM:
display_name:
- Volume
min_value: 0.0
default_value: 0.0
max_value: 100.0
freq: 1
I’ve included the license terms: "Copyright (c) 2022 by Adam Twardoch. Licensed per your choice under the Apache 2 license, or under the MIT License. Also published under the CC-0 Public Domain attribution, no rights reserved."
Felipe can proceed to take it under Apache only
display_name: - Optical size - Optical Size - opsz
This is bad, and needs to be fixed; seems we need stricted fontbakery checks?
I propose to mandate "Sentence case", not "Title Case" (so: "Optical size"). Title Case is tedious, confusing and loses semantics. It forces grotesque constructs like "Lowercase X-Height Size" etc.
The OT spec only has one two-word entry ("Optical size"), and it uses Sentence case: https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg
The registry uses mainly Title Case for the feature names (which shows how inconsistent the spec is editorially): https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae — it’s just a mess: "Case-Sensitive Form" and "Contextual Half-width Spacing" and "Left-to-right glyph alternates".
Nobody really knows how to apply Title Case, so people make mistakes.
However, the difference between the feature registry and axis registry is: feature names aren’t normally stored inside fonts, so it’s up to app makers to write out the feature names in a friendly way. But axis names ARE stored inside the fonts, so it’s best to ensure some consistency.
These are proper nouns so Title Case is best.
These are not proper nouns. Proper nouns are something like "Africa", "Jupiter", "Sarah" or "Google". Proper nouns are always capitalized, even in Sentence case.
"Size" is a common noun, so it’s only capitalized in Title Case.
However, even though I have a strong dislike towards Title Case, I have an inclination to accept it for a different reason — English style names in fonts typically use Title Case (like "Light Italic"). And the majority of feature names in the spec use Title Case — though this is inconsistent. The "opsz" axis in the OT spec is labeled "Optical size" (so Sentence case), but if we agree on Title Case, this needs to be ultimately also changed in the OT spec.
I’m happy to go either way (and the full survey I made shows that Title Case is probably more popular). However, we need clear recommendations. I’ll happily write the recommendations, it’s about time to do it.
Proper nouns are something like "Africa", "Jupiter", "Sarah" or "Google".
Yes, and the OpenType Weight axis, the Width axis, are different/distinct from the overall concept of typefaces' weight and width properties. They are, for want of a better word, named instances, ahah
This is frequency data sampled from a range of existing variable fonts.