How to use the fontbakery.checkrunner.Section function in fontbakery

To help you get started, we’ve selected a few fontbakery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlefonts / fontbakery / Lib / fontbakery / profiles / ufo_sources.py View on Github external
)

# ----------------------------------------------------------------------------
# This variable serves as an exportable anchor point, see e.g. the
# Lib/fontbakery/commands/check_ufo_sources.py script.
profile = UFOProfile(
    default_section=Section('Default'),
    iterargs={'font': 'fonts'},
    derived_iterables={'ufo_fonts': ('ufo_font', True)},
    expected_values={fonts_expected_value.name: fonts_expected_value})

register_check = profile.register_check
register_condition = profile.register_condition
# ----------------------------------------------------------------------------

basic_checks = Section("Basic UFO checks")


@register_condition
@condition
def ufo_font(font):
  import defcon
  return defcon.Font(font)


@register_check(section=basic_checks)
@check(
  id = 'com.daltonmaag/check/ufolint',
  misc_metadata = {
    'priority': PriorityLevel.CRITICAL
  }
)
github googlefonts / fontbakery / Lib / fontbakery / profiles / ufo_sources.py View on Github external
fonts_expected_value = ExpectedValue(
      'fonts'
    , default=[]
    , description='A list of the ufo file paths to check.'
    , validator=lambda fonts: (True, None) if len(fonts) \
                                    else (False, 'Value is empty.')

)

# ----------------------------------------------------------------------------
# This variable serves as an exportable anchor point, see e.g. the
# Lib/fontbakery/commands/check_ufo_sources.py script.
profile = UFOProfile(
    default_section=Section('Default'),
    iterargs={'font': 'fonts'},
    derived_iterables={'ufo_fonts': ('ufo_font', True)},
    expected_values={fonts_expected_value.name: fonts_expected_value})

register_check = profile.register_check
register_condition = profile.register_condition
# ----------------------------------------------------------------------------

basic_checks = Section("Basic UFO checks")


@register_condition
@condition
def ufo_font(font):
  import defcon
  return defcon.Font(font)