Skip to content

Commit

Permalink
Deprecation of UFO profile, and migration of its checks
Browse files Browse the repository at this point in the history
The UFO profile was removed and its checks were migrated to the Universal profile.
For that reason, all of them received a temporary "experimental" flag.

Those checks will only run when actual UFO projects are passed to fontbakery.

(issue #4801)
  • Loading branch information
felipesanches committed Aug 9, 2024
1 parent b17ab14 commit 69bc6ff
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 68 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/install_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ jobs:
-x valid_default_instance_nameids
-x soft_dotted
data/test/source-sans-pro/VAR/SourceSansVariable-Roman.ttf
- description: Universal profile on a UFO font
extras: ".[ufo]"
name: universal
args: --verbose data/test/test.ufo
- description: Universal profile on a designspace
extras: ".[ufo]"
name: universal
args: >-
-x designspace_has_consistent
"data/test/stupidfont/Stupid Font.designspace"
- description: OpenType profile on a TTC
name: opentype
args: >-
Expand All @@ -68,16 +78,6 @@ jobs:
name: adobefonts
args: >-
data/test/source-sans-pro/VAR/SourceSansVariable-Roman.ttf
- description: UFO profile
extras: ".[ufo]"
name: ufo
args: --verbose data/test/test.ufo
- description: UFO Profile on a designspace
extras: ".[ufo]"
name: ufo
args: >-
-x designspace_has_consistent
"data/test/stupidfont/Stupid Font.designspace"
- description: Shaping checks
extras: ".[shaping]"
name: shaping
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ Below are the noteworthy changes from each release.
A more detailed list of changes is available in the corresponding milestones for each release in the Github issue tracker (https://github.com/googlefonts/fontbakery/milestones?state=closed).

## Upcoming release: 0.12.10 (2024-Jul-??)
### Noteworthy code changes
- The **UFO** profile was removed and its checks were migrated to the **Universal** profile. For that reason, all of them received a temporary "experimental" flag (issue #4801)

### Changes to existing checks
- **EXPERIMENTAL - [com.daltonmaag/check/consistent_curve_type]:**: remove usage of `ufoLib2` APIs. (PR #4802)

### New checks
#### Added to the UFO profile
#### Added to the Universal profile
- **EXPERIMENTAL - [com.daltonmaag/check/consistent_curve_type]:**: checks that a consistent curve type is used across the font sources as well as within glyphs. (PR #4795)
- **EXPERIMENTAL - [com.daltonmaag/check/no_open_corners]:** checks that sources don't contain open corners, intended for use in font projects with a roundness axis. (PR #4808)
- And all other pre-existing UFO checks as well.


## 0.12.9 (2024-Jul-17)
Expand Down
14 changes: 12 additions & 2 deletions Lib/fontbakery/checks/ufo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ def designspace_sources(designspace):

@check(
id="com.daltonmaag/check/ufolint",
proposal="https://github.com/fonttools/fontbakery/pull/1736",
rationale="""
ufolint is a tool that checks UFO source files for common issues.
It is a good idea to run it before building a font to catch potential
problems early in the process.
""",
proposal="https://github.com/fonttools/fontbakery/pull/1736",
experimental="Since 2024/Aug/09",
)
def com_daltonmaag_check_ufolint(ufo):
"""Run ufolint on UFO source directory."""
Expand Down Expand Up @@ -106,6 +107,7 @@ def com_daltonmaag_check_ufolint(ufo):
unitsPerEm, ascender, descender, xHeight, capHeight and familyName.
""",
proposal="https://github.com/fonttools/fontbakery/pull/1736",
experimental="Since 2024/Aug/09",
)
def com_daltonmaag_check_required_fields(ufo_font):
"""Check that required fields are present in the UFO fontinfo."""
Expand Down Expand Up @@ -137,6 +139,7 @@ def com_daltonmaag_check_required_fields(ufo_font):
This includes fields that should be in any production font.
""",
proposal="https://github.com/fonttools/fontbakery/pull/1736",
experimental="Since 2024/Aug/09",
)
def com_daltonmaag_check_recommended_fields(ufo_font):
"""Check that recommended fields are present in the UFO fontinfo."""
Expand Down Expand Up @@ -176,6 +179,7 @@ def com_daltonmaag_check_recommended_fields(ufo_font):
year is deprecated since UFO v2.
""",
proposal="https://github.com/fonttools/fontbakery/pull/1736",
experimental="Since 2024/Aug/09",
)
def com_daltonmaag_check_unnecessary_fields(ufo_font):
"""Check that no unnecessary fields are present in the UFO fontinfo."""
Expand Down Expand Up @@ -215,6 +219,7 @@ def com_daltonmaag_check_unnecessary_fields(ufo_font):
can be properly parsed and does include valid source file references.
""",
proposal="https://github.com/fonttools/fontbakery/pull/3168",
experimental="Since 2024/Aug/09",
)
def com_google_fonts_check_designspace_has_sources(designspace_sources):
"""See if we can actually load the source files."""
Expand All @@ -230,6 +235,7 @@ def com_google_fonts_check_designspace_has_sources(designspace_sources):
We expect that designspace files declare on of the masters as default.
""",
proposal="https://github.com/fonttools/fontbakery/pull/3168",
experimental="Since 2024/Aug/09",
)
def com_google_fonts_check_designspace_has_default_master(designSpace):
"""Ensure a default master is defined."""
Expand All @@ -247,6 +253,7 @@ def com_google_fonts_check_designspace_has_default_master(designSpace):
""",
conditions=["designspace_sources"],
proposal="https://github.com/fonttools/fontbakery/pull/3168",
experimental="Since 2024/Aug/09",
)
def com_google_fonts_check_designspace_has_consistent_glyphset(designSpace, config):
"""Check consistency of glyphset in a designspace file."""
Expand Down Expand Up @@ -280,6 +287,7 @@ def com_google_fonts_check_designspace_has_consistent_glyphset(designSpace, conf
""",
conditions=["designspace_sources"],
proposal="https://github.com/fonttools/fontbakery/pull/3168",
experimental="Since 2024/Aug/09",
)
def com_google_fonts_check_designspace_has_consistent_codepoints(designSpace, config):
"""Check codepoints consistency in a designspace file."""
Expand Down Expand Up @@ -329,6 +337,7 @@ def com_google_fonts_check_designspace_has_consistent_codepoints(designSpace, co
http://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#4b-language-system
""",
proposal="https://github.com/googlefonts/fontbakery/issues/4011",
experimental="Since 2024/Aug/09",
)
def com_thetypefounders_check_features_default_languagesystem(ufo_font):
"""Check that languagesystem DFLT dflt is present in the features.fea file."""
Expand Down Expand Up @@ -361,8 +370,8 @@ def com_thetypefounders_check_features_default_languagesystem(ufo_font):
build pipeline unless specifically configured to account for this.
""",
conditions=["ufo_font"],
experimental="Since 2024/Jul/17",
proposal="https://github.com/fonttools/fontbakery/pull/4795",
experimental="Since 2024/Jul/17",
)
def check_consistent_curve_type(config, ufo: Ufo):
"""Check that all glyphs across the source use the same curve type"""
Expand Down Expand Up @@ -419,6 +428,7 @@ def check_consistent_curve_type(config, ufo: Ufo):
""",
conditions=["ufo_font"],
proposal="https://github.com/fonttools/fontbakery/pull/4808",
experimental="Since 2024/Aug/09",
)
def check_no_open_corners(config, ufo):
"""Check the sources have no corners"""
Expand Down
1 change: 0 additions & 1 deletion Lib/fontbakery/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"opentype",
"shaping",
"typenetwork",
"ufo",
"universal",
]

Expand Down
2 changes: 1 addition & 1 deletion Lib/fontbakery/profiles/googlefonts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROFILE = {
"include_profiles": ["universal", "outline", "shaping", "ufo"],
"include_profiles": ["universal", "outline", "shaping"],
"sections": {
"Article Checks": [
"com.google.fonts/check/article/images",
Expand Down
19 changes: 0 additions & 19 deletions Lib/fontbakery/profiles/ufo.py

This file was deleted.

14 changes: 14 additions & 0 deletions Lib/fontbakery/profiles/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
"com.google.fonts/check/superfamily/list",
"com.google.fonts/check/superfamily/vertical_metrics",
],
"UFO Sources": [
# FIXME (orphan check): "com.daltonmaag/check/consistent_curve_type",
# https://github.com/fonttools/fontbakery/pull/4809
"com.google.fonts/check/designspace_has_sources",
"com.google.fonts/check/designspace_has_default_master",
"com.google.fonts/check/designspace_has_consistent_glyphset",
"com.google.fonts/check/designspace_has_consistent_codepoints",
"com.thetypefounders/check/features_default_languagesystem",
# FIXME (orphan check): "com.daltonmaag/check/no_open_corners",
"com.daltonmaag/check/ufolint",
"com.daltonmaag/check/ufo_required_fields",
"com.daltonmaag/check/ufo_recommended_fields",
"com.daltonmaag/check/ufo_unnecessary_fields",
],
"Universal Profile Checks": [
"com.google.fonts/check/alt_caron",
"com.google.fonts/check/arabic_high_hamza",
Expand Down
1 change: 0 additions & 1 deletion docs/source/fontbakery/profiles/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ profiles
fontbureau
fontwerk
fontval
ufo
iso15008
outline
shaping
5 changes: 0 additions & 5 deletions docs/source/fontbakery/profiles/ufo.rst

This file was deleted.

39 changes: 12 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,26 @@ maintainers = [
]

dependencies = [
"fontTools >= 4.46.0",
"beziers >= 0.6.0, == 0.6.*",
"cmarkgfm >= 0.4",
"defcon",
"fontTools[ufo] >= 4.46.0",
"freetype-py < 2.4.0", # see: https://github.com/fonttools/fontbakery/issues/4143
"Jinja2 >= 3.0.0", # issue #4717
"munkres",
"opentypespec",
"opentype-sanitizer >= 9.1.0, == 9.*",
"munkres",
"PyYAML",
"toml",
"cmarkgfm >= 0.4",
"rich",
"Jinja2 >= 3.0.0", # issue #4717
"packaging >= 14.5", # VERSION_PATTERN was added on v14.5 (fontbakery/issues/4792)
"pip-api",
"PyYAML",
"requests >= 2.19", # issue #4718
"beziers >= 0.6.0, == 0.6.*",
"rich",
"toml",
"typing_extensions ; python_version < '3.11'",
"ufolint",
"ufo2ft >= 2.25.2", # script lists for Unicode 14.0 were updated on v2.25.2
"uharfbuzz",
"vharfbuzz >= 0.2.0",
"typing_extensions ; python_version < '3.11'",
]

[project.optional-dependencies]
Expand All @@ -68,11 +71,6 @@ shaperglot = [
# for other deps such as protobuf, making it harder satisfy all dependencies.
]

ufo2ft = [
"ufo2ft >= 2.25.2",
# 2.25.2 updated the script lists for Unicode 14.0
]

# These Google Fonts profile dependencies contain data that is critical to
# always be up-to-date, so we treat any update to these deps the same way we would
# deal with API-breaking updates. Only the latest released version is acceptable:
Expand Down Expand Up @@ -120,7 +118,6 @@ googlefonts = [
"fontbakery[beautifulsoup4]",
"fontbakery[googlefontsalwayslatest]",
"fontbakery[shaping]",
"fontbakery[ufo]",
]

iso15008 = []
Expand All @@ -139,27 +136,16 @@ shaping = [

"stringbrewer",

"fontbakery[ufo2ft]",
"fontbakery[shaperglot]",
]

typenetwork = [
"unicodedata2",

"fontbakery[beautifulsoup4]",
"fontbakery[ufo2ft]",
"fontbakery[shaperglot]",
]

# FIXME: This is not a vendor-specific profile!
ufo = [
"defcon",
"fonttools[ufo]",
"ufolint",

"fontbakery[ufo2ft]",
]


# Dependencies for building our documentation:

Expand All @@ -183,7 +169,6 @@ all = [
"fontbakery[notofonts]",
"fontbakery[shaping]",
"fontbakery[typenetwork]",
"fontbakery[ufo]",
]


Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_command_check_googlefonts():
[
"check-profile",
"check-opentype",
"check-ufo",
"check-universal",
],
)
def test_command_check_profile(subcommand):
Expand Down

0 comments on commit 69bc6ff

Please sign in to comment.