Skip to content

Commit

Permalink
We now keep a local copy of the Google Fonts Axis Registry textproto …
Browse files Browse the repository at this point in the history
…files

so that the checks do not need to keep always fetch them online at runtime.
These files should not change too often, but we should be careful to check for updates on our FontBakery releases.
(issue fonttools#3022)
  • Loading branch information
felipesanches committed Oct 7, 2020
1 parent f005186 commit ce0af11
Show file tree
Hide file tree
Showing 20 changed files with 616 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ A more detailed list of changes is available in the corresponding milestones for


## 0.7.32 (2020-Oct-??)
### Note-worthy code changes
- We now keep a local copy of the Google Fonts Axis Registry textproto files so that the checks do not need to keep always fetch them online at runtime. These files should not change too often, but we should be careful to check for updates on our FontBakery releases. (issue #3022)

### New checks
- **[com.google.fonts/check/metadata/gf-axisregistry_valid_tags]:** VF axis tags are registered on GF Axis Registry (issue #3010)
- **[com.google.fonts/check/metadata/gf-axisregistry_bounds]:** VF axes have ranges compliant to the bounds specified on the GF Axis Registry (issue #3022)
Expand Down
38 changes: 38 additions & 0 deletions Lib/fontbakery/axes.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto2";
// GF Axis Registry Protos

// An axis in the GF Axis Registry
message AxisProto {
// Axis tag
optional string tag = 1;

// Display name for axis, e.g. "Optical size" for 'opsz'
// Like 'Name' in
// https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
optional string display_name = 7;

// Lower bound for the axis
optional float min_value = 2;

// The default position to use and to prefer for exemplars
optional float default_value = 3;

// Upper bound for the axis
optional float max_value = 4;

// Input values for this axis must aligned to 10^precision
optional int32 precision = 5;

// Fallback positions along the axis
repeated FallbackProto fallback = 6;

// Short descriptive paragraph
optional string description = 8;

// Next = 9
}

message FallbackProto {
optional string name = 1;
optional float value = 2;
}
165 changes: 165 additions & 0 deletions Lib/fontbakery/axes_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Lib/fontbakery/data/casual.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# CASL based on https://github.com/arrowtype/Recursive#variable-axes
tag: "CASL"
display_name: "Casual"
min_value: 0
max_value: 1
default_value: 0
precision: -2
fallback {
name: "Linear"
value: 0
}
fallback {
name: "Casual"
value: 1
}
description:
"Along this axis, letterforms adjust in stroke curvature, contrast, and"
" terminals to go from a sturdy, rational 'Linear' style to a friendly,"
" energetic 'Casual' style."
24 changes: 24 additions & 0 deletions Lib/fontbakery/data/cursive.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CRSV based on https://github.com/arrowtype/Recursive#variable-axes
tag: "CRSV"
display_name: "Cursive"
min_value: 0
max_value: 1
default_value: 0.5
precision: -1
fallback {
name: "Roman"
value: 0
}
fallback {
name: "Auto"
value: 0.5
}
fallback {
name: "Cursive"
value: 1
}
description:
"Controls the substitution of cursive forms along the Slant axis. 'Off' (0)"
" maintains Roman letterforms such as a double-story a and g, 'Auto' (0.5)"
" allows for Cursive substitution, and 'On' (1) asserts cursive forms even"
" in upright text with a Slant of 0."
33 changes: 33 additions & 0 deletions Lib/fontbakery/data/grade.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# GRAD based on https://github.com/TypeNetwork/Opentype-1.8-Axis-Proposal/blob/gh-pages/proposal/Grade/ProposalSummary.md
tag: "GRAD"
display_name: "Grade"
min_value: -1
max_value: 1
default_value: 0
precision: -1
fallback {
name: "Full Negative"
value: -1
}
fallback {
name: "Half Negative"
value: -0.5
}
fallback {
name: "Normal"
value: 0
}
fallback {
name: "Half Positive"
value: 0.5
}
fallback {
name: "Full Positive"
value: 1
}
description:
"Finesse the style from lighter to bolder in typographic color, by varying"
" stroke thicknesses or other forms, without any changes overall width,"
" inter-letter spacing, or kerning, so there are no changes to line breaks"
" or page layout. Negative grade makes the style lighter, while positive"
" grade makes it bolder. "
19 changes: 19 additions & 0 deletions Lib/fontbakery/data/italic.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ital based on https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_ital
tag: "ital"
display_name: "Italic"
min_value: 0
max_value: 1
default_value: 0
precision: -1
fallback {
name: "Roman"
value: 0
}
fallback {
name: "Italic"
value: 1
}
description:
"Adjust the style from roman to italic. This can be provided as"
" a continuous range within a single font file, like most axes, or as a"
" toggle between two roman and italic files that form a family as a pair."
23 changes: 23 additions & 0 deletions Lib/fontbakery/data/monospace.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# FOR TESTING ONLY [for now anyway]
# MONO based on https://github.com/arrowtype/Recursive#variable-axes
tag: "MONO"
display_name: "Monospace"
min_value: 0
max_value: 1
default_value: 0
precision: -2
fallback {
name: "Proportional"
value: 0
}
fallback {
name: "Monospace"
value: 1
}
description:
"Adjust the style from proportional (natural widths, default) to"
" monospace (fixed width). Monospace is when all glyphs have the same"
" total character width, and more wide or narrow letter proportions to fill"
" the space such as a narrower 'w' or wider 'r.' Proportionally spaced"
"fonts have letters drawn with more typical proportions, and each glyph"
"takes up a unique amount of space on a line."
Loading

0 comments on commit ce0af11

Please sign in to comment.