id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9,700 | BerkeleyAutomation/autolab_core | autolab_core/data_stream_recorder.py | DataStreamRecorder._stop | def _stop(self):
""" Stops recording. Returns all recorded data and their timestamps. Destroys recorder process."""
self._pause()
self._cmds_q.put(("stop",))
try:
self._recorder.terminate()
except Exception:
pass
self._recording = False | python | def _stop(self):
""" Stops recording. Returns all recorded data and their timestamps. Destroys recorder process."""
self._pause()
self._cmds_q.put(("stop",))
try:
self._recorder.terminate()
except Exception:
pass
self._recording = False | [
"def",
"_stop",
"(",
"self",
")",
":",
"self",
".",
"_pause",
"(",
")",
"self",
".",
"_cmds_q",
".",
"put",
"(",
"(",
"\"stop\"",
",",
")",
")",
"try",
":",
"self",
".",
"_recorder",
".",
"terminate",
"(",
")",
"except",
"Exception",
":",
"pass",
... | Stops recording. Returns all recorded data and their timestamps. Destroys recorder process. | [
"Stops",
"recording",
".",
"Returns",
"all",
"recorded",
"data",
"and",
"their",
"timestamps",
".",
"Destroys",
"recorder",
"process",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/data_stream_recorder.py#L209-L217 |
9,701 | BerkeleyAutomation/autolab_core | autolab_core/completer.py | Completer._listdir | def _listdir(self, root):
"List directory 'root' appending the path separator to subdirs."
res = []
for name in os.listdir(root):
path = os.path.join(root, name)
if os.path.isdir(path):
name += os.sep
res.append(name)
return res | python | def _listdir(self, root):
"List directory 'root' appending the path separator to subdirs."
res = []
for name in os.listdir(root):
path = os.path.join(root, name)
if os.path.isdir(path):
name += os.sep
res.append(name)
return res | [
"def",
"_listdir",
"(",
"self",
",",
"root",
")",
":",
"res",
"=",
"[",
"]",
"for",
"name",
"in",
"os",
".",
"listdir",
"(",
"root",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"name",
")",
"if",
"os",
".",
"path"... | List directory 'root' appending the path separator to subdirs. | [
"List",
"directory",
"root",
"appending",
"the",
"path",
"separator",
"to",
"subdirs",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/completer.py#L24-L32 |
9,702 | BerkeleyAutomation/autolab_core | autolab_core/completer.py | Completer.complete_extra | def complete_extra(self, args):
"Completions for the 'extra' command."
# treat the last arg as a path and complete it
if len(args) == 0:
return self._listdir('./')
return self._complete_path(args[-1]) | python | def complete_extra(self, args):
"Completions for the 'extra' command."
# treat the last arg as a path and complete it
if len(args) == 0:
return self._listdir('./')
return self._complete_path(args[-1]) | [
"def",
"complete_extra",
"(",
"self",
",",
"args",
")",
":",
"# treat the last arg as a path and complete it",
"if",
"len",
"(",
"args",
")",
"==",
"0",
":",
"return",
"self",
".",
"_listdir",
"(",
"'./'",
")",
"return",
"self",
".",
"_complete_path",
"(",
"... | Completions for the 'extra' command. | [
"Completions",
"for",
"the",
"extra",
"command",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/completer.py#L51-L56 |
9,703 | BerkeleyAutomation/autolab_core | autolab_core/completer.py | Completer.complete | def complete(self, text, state):
"Generic readline completion entry point."
# dexnet entity tab completion
results = [w for w in self.words if w.startswith(text)] + [None]
if results != [None]:
return results[state]
buffer = readline.get_line_buffer()
line =... | python | def complete(self, text, state):
"Generic readline completion entry point."
# dexnet entity tab completion
results = [w for w in self.words if w.startswith(text)] + [None]
if results != [None]:
return results[state]
buffer = readline.get_line_buffer()
line =... | [
"def",
"complete",
"(",
"self",
",",
"text",
",",
"state",
")",
":",
"# dexnet entity tab completion",
"results",
"=",
"[",
"w",
"for",
"w",
"in",
"self",
".",
"words",
"if",
"w",
".",
"startswith",
"(",
"text",
")",
"]",
"+",
"[",
"None",
"]",
"if",... | Generic readline completion entry point. | [
"Generic",
"readline",
"completion",
"entry",
"point",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/completer.py#L58-L78 |
9,704 | BerkeleyAutomation/autolab_core | autolab_core/data_stream_syncer.py | DataStreamSyncer.stop | def stop(self):
""" Stops syncer operations. Destroys syncer process. """
self._cmds_q.put(("stop",))
for recorder in self._data_stream_recorders:
recorder._stop()
try:
self._syncer.terminate()
except Exception:
pass | python | def stop(self):
""" Stops syncer operations. Destroys syncer process. """
self._cmds_q.put(("stop",))
for recorder in self._data_stream_recorders:
recorder._stop()
try:
self._syncer.terminate()
except Exception:
pass | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"_cmds_q",
".",
"put",
"(",
"(",
"\"stop\"",
",",
")",
")",
"for",
"recorder",
"in",
"self",
".",
"_data_stream_recorders",
":",
"recorder",
".",
"_stop",
"(",
")",
"try",
":",
"self",
".",
"_syncer"... | Stops syncer operations. Destroys syncer process. | [
"Stops",
"syncer",
"operations",
".",
"Destroys",
"syncer",
"process",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/data_stream_syncer.py#L123-L131 |
9,705 | BerkeleyAutomation/autolab_core | autolab_core/logger.py | configure_root | def configure_root():
"""Configure the root logger."""
root_logger = logging.getLogger()
# clear any existing handles to streams because we don't want duplicate logs
# NOTE: we assume that any stream handles we find are to ROOT_LOG_STREAM, which is usually the case(because it is stdout). This is fine b... | python | def configure_root():
"""Configure the root logger."""
root_logger = logging.getLogger()
# clear any existing handles to streams because we don't want duplicate logs
# NOTE: we assume that any stream handles we find are to ROOT_LOG_STREAM, which is usually the case(because it is stdout). This is fine b... | [
"def",
"configure_root",
"(",
")",
":",
"root_logger",
"=",
"logging",
".",
"getLogger",
"(",
")",
"# clear any existing handles to streams because we don't want duplicate logs",
"# NOTE: we assume that any stream handles we find are to ROOT_LOG_STREAM, which is usually the case(because it... | Configure the root logger. | [
"Configure",
"the",
"root",
"logger",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/logger.py#L14-L39 |
9,706 | BerkeleyAutomation/autolab_core | autolab_core/logger.py | add_root_log_file | def add_root_log_file(log_file):
"""
Add a log file to the root logger.
Parameters
----------
log_file :obj:`str`
The path to the log file.
"""
root_logger = logging.getLogger()
# add a file handle to the root logger
hdlr = logging.FileHandler(log_file)
formatter = logg... | python | def add_root_log_file(log_file):
"""
Add a log file to the root logger.
Parameters
----------
log_file :obj:`str`
The path to the log file.
"""
root_logger = logging.getLogger()
# add a file handle to the root logger
hdlr = logging.FileHandler(log_file)
formatter = logg... | [
"def",
"add_root_log_file",
"(",
"log_file",
")",
":",
"root_logger",
"=",
"logging",
".",
"getLogger",
"(",
")",
"# add a file handle to the root logger",
"hdlr",
"=",
"logging",
".",
"FileHandler",
"(",
"log_file",
")",
"formatter",
"=",
"logging",
".",
"Formatt... | Add a log file to the root logger.
Parameters
----------
log_file :obj:`str`
The path to the log file. | [
"Add",
"a",
"log",
"file",
"to",
"the",
"root",
"logger",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/logger.py#L41-L57 |
9,707 | BerkeleyAutomation/autolab_core | autolab_core/logger.py | Logger.add_log_file | def add_log_file(logger, log_file, global_log_file=False):
"""
Add a log file to this logger. If global_log_file is true, log_file will be handed the root logger, otherwise it will only be used by this particular logger.
Parameters
----------
logger :obj:`logging.Logger`
... | python | def add_log_file(logger, log_file, global_log_file=False):
"""
Add a log file to this logger. If global_log_file is true, log_file will be handed the root logger, otherwise it will only be used by this particular logger.
Parameters
----------
logger :obj:`logging.Logger`
... | [
"def",
"add_log_file",
"(",
"logger",
",",
"log_file",
",",
"global_log_file",
"=",
"False",
")",
":",
"if",
"global_log_file",
":",
"add_root_log_file",
"(",
"log_file",
")",
"else",
":",
"hdlr",
"=",
"logging",
".",
"FileHandler",
"(",
"log_file",
")",
"fo... | Add a log file to this logger. If global_log_file is true, log_file will be handed the root logger, otherwise it will only be used by this particular logger.
Parameters
----------
logger :obj:`logging.Logger`
The logger.
log_file :obj:`str`
The path to the log fi... | [
"Add",
"a",
"log",
"file",
"to",
"this",
"logger",
".",
"If",
"global_log_file",
"is",
"true",
"log_file",
"will",
"be",
"handed",
"the",
"root",
"logger",
"otherwise",
"it",
"will",
"only",
"be",
"used",
"by",
"this",
"particular",
"logger",
"."
] | 8f3813f6401972868cc5e3981ba1b4382d4418d5 | https://github.com/BerkeleyAutomation/autolab_core/blob/8f3813f6401972868cc5e3981ba1b4382d4418d5/autolab_core/logger.py#L128-L148 |
9,708 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | get_module_profile | def get_module_profile(module, name=None):
"""
Get or create a profile from a module and return it.
If the name `module.profile` is present the value of that is returned.
Otherwise, if the name `module.profile_factory` is present, a new profile
is created using `module.profile_factory` and then `profile.auto... | python | def get_module_profile(module, name=None):
"""
Get or create a profile from a module and return it.
If the name `module.profile` is present the value of that is returned.
Otherwise, if the name `module.profile_factory` is present, a new profile
is created using `module.profile_factory` and then `profile.auto... | [
"def",
"get_module_profile",
"(",
"module",
",",
"name",
"=",
"None",
")",
":",
"try",
":",
"# if profile is defined we just use it",
"return",
"module",
".",
"profile",
"except",
"AttributeError",
":",
"# > 'module' object has no attribute 'profile'",
"# try to create one ... | Get or create a profile from a module and return it.
If the name `module.profile` is present the value of that is returned.
Otherwise, if the name `module.profile_factory` is present, a new profile
is created using `module.profile_factory` and then `profile.auto_register`
is called with the module namespace.
... | [
"Get",
"or",
"create",
"a",
"profile",
"from",
"a",
"module",
"and",
"return",
"it",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L1626-L1659 |
9,709 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | CheckRunner.iterargs | def iterargs(self):
""" uses the singular name as key """
iterargs = OrderedDict()
for name in self._iterargs:
plural = self._profile.iterargs[name]
iterargs[name] = tuple(self._values[plural])
return iterargs | python | def iterargs(self):
""" uses the singular name as key """
iterargs = OrderedDict()
for name in self._iterargs:
plural = self._profile.iterargs[name]
iterargs[name] = tuple(self._values[plural])
return iterargs | [
"def",
"iterargs",
"(",
"self",
")",
":",
"iterargs",
"=",
"OrderedDict",
"(",
")",
"for",
"name",
"in",
"self",
".",
"_iterargs",
":",
"plural",
"=",
"self",
".",
"_profile",
".",
"iterargs",
"[",
"name",
"]",
"iterargs",
"[",
"name",
"]",
"=",
"tup... | uses the singular name as key | [
"uses",
"the",
"singular",
"name",
"as",
"key"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L270-L276 |
9,710 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | CheckRunner._exec_check | def _exec_check(self, check: FontbakeryCallable, args: Dict[str, Any]):
""" Yields check sub results.
Each check result is a tuple of: (<Status>, mixed message)
`status`: must be an instance of Status.
If one of the `status` entries in one of the results
is FAIL, the whole check is cons... | python | def _exec_check(self, check: FontbakeryCallable, args: Dict[str, Any]):
""" Yields check sub results.
Each check result is a tuple of: (<Status>, mixed message)
`status`: must be an instance of Status.
If one of the `status` entries in one of the results
is FAIL, the whole check is cons... | [
"def",
"_exec_check",
"(",
"self",
",",
"check",
":",
"FontbakeryCallable",
",",
"args",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
")",
":",
"try",
":",
"# A check can be either a normal function that returns one Status or a",
"# generator that yields one or more. The lat... | Yields check sub results.
Each check result is a tuple of: (<Status>, mixed message)
`status`: must be an instance of Status.
If one of the `status` entries in one of the results
is FAIL, the whole check is considered failed.
WARN is most likely a PASS in a non strict mode and a
... | [
"Yields",
"check",
"sub",
"results",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L318-L352 |
9,711 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | CheckRunner.check_order | def check_order(self, order):
"""
order must be a subset of self.order
"""
own_order = self.order
for item in order:
if item not in own_order:
raise ValueError(f'Order item {item} not found.')
return order | python | def check_order(self, order):
"""
order must be a subset of self.order
"""
own_order = self.order
for item in order:
if item not in own_order:
raise ValueError(f'Order item {item} not found.')
return order | [
"def",
"check_order",
"(",
"self",
",",
"order",
")",
":",
"own_order",
"=",
"self",
".",
"order",
"for",
"item",
"in",
"order",
":",
"if",
"item",
"not",
"in",
"own_order",
":",
"raise",
"ValueError",
"(",
"f'Order item {item} not found.'",
")",
"return",
... | order must be a subset of self.order | [
"order",
"must",
"be",
"a",
"subset",
"of",
"self",
".",
"order"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L622-L630 |
9,712 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Section.add_check | def add_check(self, check):
"""
Please use rather `register_check` as a decorator.
"""
if self._add_check_callback is not None:
if not self._add_check_callback(self, check):
# rejected, skip!
return False
self._checkid2index[check.id] = len(self._checks)
self._checks.appen... | python | def add_check(self, check):
"""
Please use rather `register_check` as a decorator.
"""
if self._add_check_callback is not None:
if not self._add_check_callback(self, check):
# rejected, skip!
return False
self._checkid2index[check.id] = len(self._checks)
self._checks.appen... | [
"def",
"add_check",
"(",
"self",
",",
"check",
")",
":",
"if",
"self",
".",
"_add_check_callback",
"is",
"not",
"None",
":",
"if",
"not",
"self",
".",
"_add_check_callback",
"(",
"self",
",",
"check",
")",
":",
"# rejected, skip!",
"return",
"False",
"self... | Please use rather `register_check` as a decorator. | [
"Please",
"use",
"rather",
"register_check",
"as",
"a",
"decorator",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L732-L743 |
9,713 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Section.merge_section | def merge_section(self, section, filter_func=None):
"""
Add section.checks to self, if not skipped by self._add_check_callback.
order, description, etc. are not updated.
"""
for check in section.checks:
if filter_func and not filter_func(check):
continue
self.add_check(check) | python | def merge_section(self, section, filter_func=None):
"""
Add section.checks to self, if not skipped by self._add_check_callback.
order, description, etc. are not updated.
"""
for check in section.checks:
if filter_func and not filter_func(check):
continue
self.add_check(check) | [
"def",
"merge_section",
"(",
"self",
",",
"section",
",",
"filter_func",
"=",
"None",
")",
":",
"for",
"check",
"in",
"section",
".",
"checks",
":",
"if",
"filter_func",
"and",
"not",
"filter_func",
"(",
"check",
")",
":",
"continue",
"self",
".",
"add_c... | Add section.checks to self, if not skipped by self._add_check_callback.
order, description, etc. are not updated. | [
"Add",
"section",
".",
"checks",
"to",
"self",
"if",
"not",
"skipped",
"by",
"self",
".",
"_add_check_callback",
".",
"order",
"description",
"etc",
".",
"are",
"not",
"updated",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L745-L753 |
9,714 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Profile.validate_values | def validate_values(self, values):
"""
Validate values if they are registered as expected_values and present.
* If they are not registered they shouldn't be used anywhere at all
because profile can self check (profile.check_dependencies) for
missing/undefined dependencies.
* If they are no... | python | def validate_values(self, values):
"""
Validate values if they are registered as expected_values and present.
* If they are not registered they shouldn't be used anywhere at all
because profile can self check (profile.check_dependencies) for
missing/undefined dependencies.
* If they are no... | [
"def",
"validate_values",
"(",
"self",
",",
"values",
")",
":",
"format_message",
"=",
"'{}: {} (value: {})'",
".",
"format",
"messages",
"=",
"[",
"]",
"for",
"name",
",",
"value",
"in",
"values",
".",
"items",
"(",
")",
":",
"if",
"name",
"not",
"in",
... | Validate values if they are registered as expected_values and present.
* If they are not registered they shouldn't be used anywhere at all
because profile can self check (profile.check_dependencies) for
missing/undefined dependencies.
* If they are not present in values but registered as expected_... | [
"Validate",
"values",
"if",
"they",
"are",
"registered",
"as",
"expected_values",
"and",
"present",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L993-L1017 |
9,715 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Profile._get_aggregate_args | def _get_aggregate_args(self, item, key):
"""
Get all arguments or mandatory arguments of the item.
Item is a check or a condition, which means it can be dependent on
more conditions, this climbs down all the way.
"""
if not key in ('args', 'mandatoryArgs'):
raise TypeError('key mus... | python | def _get_aggregate_args(self, item, key):
"""
Get all arguments or mandatory arguments of the item.
Item is a check or a condition, which means it can be dependent on
more conditions, this climbs down all the way.
"""
if not key in ('args', 'mandatoryArgs'):
raise TypeError('key mus... | [
"def",
"_get_aggregate_args",
"(",
"self",
",",
"item",
",",
"key",
")",
":",
"if",
"not",
"key",
"in",
"(",
"'args'",
",",
"'mandatoryArgs'",
")",
":",
"raise",
"TypeError",
"(",
"'key must be \"args\" or \"mandatoryArgs\", got {}'",
")",
".",
"format",
"(",
... | Get all arguments or mandatory arguments of the item.
Item is a check or a condition, which means it can be dependent on
more conditions, this climbs down all the way. | [
"Get",
"all",
"arguments",
"or",
"mandatory",
"arguments",
"of",
"the",
"item",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L1055-L1079 |
9,716 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Profile.get_iterargs | def get_iterargs(self, item):
""" Returns a tuple of all iterags for item, sorted by name."""
# iterargs should always be mandatory, unless there's a good reason
# not to, which I can't think of right now.
args = self._get_aggregate_args(item, 'mandatoryArgs')
return tuple(sorted([arg for arg in ar... | python | def get_iterargs(self, item):
""" Returns a tuple of all iterags for item, sorted by name."""
# iterargs should always be mandatory, unless there's a good reason
# not to, which I can't think of right now.
args = self._get_aggregate_args(item, 'mandatoryArgs')
return tuple(sorted([arg for arg in ar... | [
"def",
"get_iterargs",
"(",
"self",
",",
"item",
")",
":",
"# iterargs should always be mandatory, unless there's a good reason",
"# not to, which I can't think of right now.",
"args",
"=",
"self",
".",
"_get_aggregate_args",
"(",
"item",
",",
"'mandatoryArgs'",
")",
"return"... | Returns a tuple of all iterags for item, sorted by name. | [
"Returns",
"a",
"tuple",
"of",
"all",
"iterags",
"for",
"item",
"sorted",
"by",
"name",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L1081-L1087 |
9,717 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Profile.auto_register | def auto_register(self, symbol_table, filter_func=None, profile_imports=None):
"""
Register items from `symbol_table` in the profile.
Get all items from `symbol_table` dict and from `symbol_table.profile_imports`
if it is present. If they an item is an instance of FontBakeryCheck,
FontBaker... | python | def auto_register(self, symbol_table, filter_func=None, profile_imports=None):
"""
Register items from `symbol_table` in the profile.
Get all items from `symbol_table` dict and from `symbol_table.profile_imports`
if it is present. If they an item is an instance of FontBakeryCheck,
FontBaker... | [
"def",
"auto_register",
"(",
"self",
",",
"symbol_table",
",",
"filter_func",
"=",
"None",
",",
"profile_imports",
"=",
"None",
")",
":",
"if",
"profile_imports",
":",
"symbol_table",
"=",
"symbol_table",
".",
"copy",
"(",
")",
"# Avoid messing with original table... | Register items from `symbol_table` in the profile.
Get all items from `symbol_table` dict and from `symbol_table.profile_imports`
if it is present. If they an item is an instance of FontBakeryCheck,
FontBakeryCondition or FontBakeryExpectedValue and register it in
the default section.
If ... | [
"Register",
"items",
"from",
"symbol_table",
"in",
"the",
"profile",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L1417-L1481 |
9,718 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Profile.merge_profile | def merge_profile(self, profile, filter_func=None):
"""Copy all namespace items from profile to self.
Namespace items are: 'iterargs', 'derived_iterables', 'aliases',
'conditions', 'expected_values'
Don't change any contents of profile ever!
That means sections are cloned not ... | python | def merge_profile(self, profile, filter_func=None):
"""Copy all namespace items from profile to self.
Namespace items are: 'iterargs', 'derived_iterables', 'aliases',
'conditions', 'expected_values'
Don't change any contents of profile ever!
That means sections are cloned not ... | [
"def",
"merge_profile",
"(",
"self",
",",
"profile",
",",
"filter_func",
"=",
"None",
")",
":",
"# 'iterargs', 'derived_iterables', 'aliases', 'conditions', 'expected_values'",
"for",
"ns_type",
"in",
"self",
".",
"_valid_namespace_types",
":",
"# this will raise a NamespaceE... | Copy all namespace items from profile to self.
Namespace items are: 'iterargs', 'derived_iterables', 'aliases',
'conditions', 'expected_values'
Don't change any contents of profile ever!
That means sections are cloned not used directly
filter_func: see description in auto_reg... | [
"Copy",
"all",
"namespace",
"items",
"from",
"profile",
"to",
"self",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L1483-L1517 |
9,719 | googlefonts/fontbakery | Lib/fontbakery/checkrunner.py | Profile.serialize_identity | def serialize_identity(self, identity):
""" Return a json string that can also be used as a key.
The JSON is explicitly unambiguous in the item order
entries (dictionaries are not ordered usually)
Otherwise it is valid JSON
"""
section, check, iterargs = identity
values = map(
# se... | python | def serialize_identity(self, identity):
""" Return a json string that can also be used as a key.
The JSON is explicitly unambiguous in the item order
entries (dictionaries are not ordered usually)
Otherwise it is valid JSON
"""
section, check, iterargs = identity
values = map(
# se... | [
"def",
"serialize_identity",
"(",
"self",
",",
"identity",
")",
":",
"section",
",",
"check",
",",
"iterargs",
"=",
"identity",
"values",
"=",
"map",
"(",
"# separators are without space, which is the default in JavaScript;",
"# just in case we need to make these keys in JS."... | Return a json string that can also be used as a key.
The JSON is explicitly unambiguous in the item order
entries (dictionaries are not ordered usually)
Otherwise it is valid JSON | [
"Return",
"a",
"json",
"string",
"that",
"can",
"also",
"be",
"used",
"as",
"a",
"key",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/checkrunner.py#L1550-L1570 |
9,720 | googlefonts/fontbakery | Lib/fontbakery/commands/check_profile.py | get_profile | def get_profile():
""" Prefetch the profile module, to fill some holes in the help text."""
argument_parser = ThrowingArgumentParser(add_help=False)
argument_parser.add_argument('profile')
try:
args, _ = argument_parser.parse_known_args()
except ArgumentParserError:
# silently fails, the main parser w... | python | def get_profile():
""" Prefetch the profile module, to fill some holes in the help text."""
argument_parser = ThrowingArgumentParser(add_help=False)
argument_parser.add_argument('profile')
try:
args, _ = argument_parser.parse_known_args()
except ArgumentParserError:
# silently fails, the main parser w... | [
"def",
"get_profile",
"(",
")",
":",
"argument_parser",
"=",
"ThrowingArgumentParser",
"(",
"add_help",
"=",
"False",
")",
"argument_parser",
".",
"add_argument",
"(",
"'profile'",
")",
"try",
":",
"args",
",",
"_",
"=",
"argument_parser",
".",
"parse_known_args... | Prefetch the profile module, to fill some holes in the help text. | [
"Prefetch",
"the",
"profile",
"module",
"to",
"fill",
"some",
"holes",
"in",
"the",
"help",
"text",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/commands/check_profile.py#L193-L206 |
9,721 | googlefonts/fontbakery | Lib/fontbakery/commands/generate_glyphdata.py | collate_fonts_data | def collate_fonts_data(fonts_data):
"""Collate individual fonts data into a single glyph data list."""
glyphs = {}
for family in fonts_data:
for glyph in family:
if glyph['unicode'] not in glyphs:
glyphs[glyph['unicode']] = glyph
else:
c = gly... | python | def collate_fonts_data(fonts_data):
"""Collate individual fonts data into a single glyph data list."""
glyphs = {}
for family in fonts_data:
for glyph in family:
if glyph['unicode'] not in glyphs:
glyphs[glyph['unicode']] = glyph
else:
c = gly... | [
"def",
"collate_fonts_data",
"(",
"fonts_data",
")",
":",
"glyphs",
"=",
"{",
"}",
"for",
"family",
"in",
"fonts_data",
":",
"for",
"glyph",
"in",
"family",
":",
"if",
"glyph",
"[",
"'unicode'",
"]",
"not",
"in",
"glyphs",
":",
"glyphs",
"[",
"glyph",
... | Collate individual fonts data into a single glyph data list. | [
"Collate",
"individual",
"fonts",
"data",
"into",
"a",
"single",
"glyph",
"data",
"list",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/commands/generate_glyphdata.py#L35-L46 |
9,722 | googlefonts/fontbakery | Lib/fontbakery/profiles/adobefonts.py | com_adobe_fonts_check_family_consistent_upm | def com_adobe_fonts_check_family_consistent_upm(ttFonts):
"""Fonts have consistent Units Per Em?"""
upm_set = set()
for ttFont in ttFonts:
upm_set.add(ttFont['head'].unitsPerEm)
if len(upm_set) > 1:
yield FAIL, ("Fonts have different units per em: {}."
).format(sorte... | python | def com_adobe_fonts_check_family_consistent_upm(ttFonts):
"""Fonts have consistent Units Per Em?"""
upm_set = set()
for ttFont in ttFonts:
upm_set.add(ttFont['head'].unitsPerEm)
if len(upm_set) > 1:
yield FAIL, ("Fonts have different units per em: {}."
).format(sorte... | [
"def",
"com_adobe_fonts_check_family_consistent_upm",
"(",
"ttFonts",
")",
":",
"upm_set",
"=",
"set",
"(",
")",
"for",
"ttFont",
"in",
"ttFonts",
":",
"upm_set",
".",
"add",
"(",
"ttFont",
"[",
"'head'",
"]",
".",
"unitsPerEm",
")",
"if",
"len",
"(",
"upm... | Fonts have consistent Units Per Em? | [
"Fonts",
"have",
"consistent",
"Units",
"Per",
"Em?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/adobefonts.py#L27-L36 |
9,723 | googlefonts/fontbakery | Lib/fontbakery/profiles/adobefonts.py | com_adobe_fonts_check_find_empty_letters | def com_adobe_fonts_check_find_empty_letters(ttFont):
"""Letters in font have glyphs that are not empty?"""
cmap = ttFont.getBestCmap()
passed = True
# http://unicode.org/reports/tr44/#General_Category_Values
letter_categories = {
'Ll', 'Lm', 'Lo', 'Lt', 'Lu',
}
invisible_letters = ... | python | def com_adobe_fonts_check_find_empty_letters(ttFont):
"""Letters in font have glyphs that are not empty?"""
cmap = ttFont.getBestCmap()
passed = True
# http://unicode.org/reports/tr44/#General_Category_Values
letter_categories = {
'Ll', 'Lm', 'Lo', 'Lt', 'Lu',
}
invisible_letters = ... | [
"def",
"com_adobe_fonts_check_find_empty_letters",
"(",
"ttFont",
")",
":",
"cmap",
"=",
"ttFont",
".",
"getBestCmap",
"(",
")",
"passed",
"=",
"True",
"# http://unicode.org/reports/tr44/#General_Category_Values",
"letter_categories",
"=",
"{",
"'Ll'",
",",
"'Lm'",
",",... | Letters in font have glyphs that are not empty? | [
"Letters",
"in",
"font",
"have",
"glyphs",
"that",
"are",
"not",
"empty?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/adobefonts.py#L81-L103 |
9,724 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_adobe_fonts_check_name_empty_records | def com_adobe_fonts_check_name_empty_records(ttFont):
"""Check name table for empty records."""
failed = False
for name_record in ttFont['name'].names:
name_string = name_record.toUnicode().strip()
if len(name_string) == 0:
failed = True
name_key = tuple([name_record.... | python | def com_adobe_fonts_check_name_empty_records(ttFont):
"""Check name table for empty records."""
failed = False
for name_record in ttFont['name'].names:
name_string = name_record.toUnicode().strip()
if len(name_string) == 0:
failed = True
name_key = tuple([name_record.... | [
"def",
"com_adobe_fonts_check_name_empty_records",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"name_record",
"in",
"ttFont",
"[",
"'name'",
"]",
".",
"names",
":",
"name_string",
"=",
"name_record",
".",
"toUnicode",
"(",
")",
".",
"strip",
"(",
... | Check name table for empty records. | [
"Check",
"name",
"table",
"for",
"empty",
"records",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L20-L33 |
9,725 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_google_fonts_check_name_no_copyright_on_description | def com_google_fonts_check_name_no_copyright_on_description(ttFont):
"""Description strings in the name table must not contain copyright info."""
failed = False
for name in ttFont['name'].names:
if 'opyright' in name.string.decode(name.getEncoding())\
and name.nameID == NameID.DESCRIPTION:
failed... | python | def com_google_fonts_check_name_no_copyright_on_description(ttFont):
"""Description strings in the name table must not contain copyright info."""
failed = False
for name in ttFont['name'].names:
if 'opyright' in name.string.decode(name.getEncoding())\
and name.nameID == NameID.DESCRIPTION:
failed... | [
"def",
"com_google_fonts_check_name_no_copyright_on_description",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"name",
"in",
"ttFont",
"[",
"'name'",
"]",
".",
"names",
":",
"if",
"'opyright'",
"in",
"name",
".",
"string",
".",
"decode",
"(",
"name"... | Description strings in the name table must not contain copyright info. | [
"Description",
"strings",
"in",
"the",
"name",
"table",
"must",
"not",
"contain",
"copyright",
"info",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L42-L58 |
9,726 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_google_fonts_check_monospace | def com_google_fonts_check_monospace(ttFont, glyph_metrics_stats):
"""Checking correctness of monospaced metadata.
There are various metadata in the OpenType spec to specify if
a font is monospaced or not. If the font is not trully monospaced,
then no monospaced metadata should be set (as sometimes
they mist... | python | def com_google_fonts_check_monospace(ttFont, glyph_metrics_stats):
"""Checking correctness of monospaced metadata.
There are various metadata in the OpenType spec to specify if
a font is monospaced or not. If the font is not trully monospaced,
then no monospaced metadata should be set (as sometimes
they mist... | [
"def",
"com_google_fonts_check_monospace",
"(",
"ttFont",
",",
"glyph_metrics_stats",
")",
":",
"from",
"fontbakery",
".",
"constants",
"import",
"(",
"IsFixedWidth",
",",
"PANOSE_Proportion",
")",
"failed",
"=",
"False",
"# Note: These values are read from the dict here on... | Checking correctness of monospaced metadata.
There are various metadata in the OpenType spec to specify if
a font is monospaced or not. If the font is not trully monospaced,
then no monospaced metadata should be set (as sometimes
they mistakenly are...)
Monospace fonts must:
* post.isFixedWidth "Set to 0... | [
"Checking",
"correctness",
"of",
"monospaced",
"metadata",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L66-L177 |
9,727 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_google_fonts_check_name_line_breaks | def com_google_fonts_check_name_line_breaks(ttFont):
"""Name table entries should not contain line-breaks."""
failed = False
for name in ttFont["name"].names:
string = name.string.decode(name.getEncoding())
if "\n" in string:
failed = True
yield FAIL, ("Name entry {} on platform {} contains"
... | python | def com_google_fonts_check_name_line_breaks(ttFont):
"""Name table entries should not contain line-breaks."""
failed = False
for name in ttFont["name"].names:
string = name.string.decode(name.getEncoding())
if "\n" in string:
failed = True
yield FAIL, ("Name entry {} on platform {} contains"
... | [
"def",
"com_google_fonts_check_name_line_breaks",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"name",
"in",
"ttFont",
"[",
"\"name\"",
"]",
".",
"names",
":",
"string",
"=",
"name",
".",
"string",
".",
"decode",
"(",
"name",
".",
"getEncoding",
... | Name table entries should not contain line-breaks. | [
"Name",
"table",
"entries",
"should",
"not",
"contain",
"line",
"-",
"breaks",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L183-L195 |
9,728 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_google_fonts_check_name_match_familyname_fullfont | def com_google_fonts_check_name_match_familyname_fullfont(ttFont):
"""Does full font name begin with the font family name?"""
from fontbakery.utils import get_name_entry_strings
familyname = get_name_entry_strings(ttFont, NameID.FONT_FAMILY_NAME)
fullfontname = get_name_entry_strings(ttFont, NameID.FULL_FONT_NA... | python | def com_google_fonts_check_name_match_familyname_fullfont(ttFont):
"""Does full font name begin with the font family name?"""
from fontbakery.utils import get_name_entry_strings
familyname = get_name_entry_strings(ttFont, NameID.FONT_FAMILY_NAME)
fullfontname = get_name_entry_strings(ttFont, NameID.FULL_FONT_NA... | [
"def",
"com_google_fonts_check_name_match_familyname_fullfont",
"(",
"ttFont",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"familyname",
"=",
"get_name_entry_strings",
"(",
"ttFont",
",",
"NameID",
".",
"FONT_FAMILY_NAME",
")",
"fullf... | Does full font name begin with the font family name? | [
"Does",
"full",
"font",
"name",
"begin",
"with",
"the",
"font",
"family",
"name?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L201-L232 |
9,729 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_google_fonts_check_family_naming_recommendations | def com_google_fonts_check_family_naming_recommendations(ttFont):
"""Font follows the family naming recommendations?"""
# See http://forum.fontlab.com/index.php?topic=313.0
import re
from fontbakery.utils import get_name_entry_strings
bad_entries = []
# <Postscript name> may contain only a-zA-Z0-9
# and ... | python | def com_google_fonts_check_family_naming_recommendations(ttFont):
"""Font follows the family naming recommendations?"""
# See http://forum.fontlab.com/index.php?topic=313.0
import re
from fontbakery.utils import get_name_entry_strings
bad_entries = []
# <Postscript name> may contain only a-zA-Z0-9
# and ... | [
"def",
"com_google_fonts_check_family_naming_recommendations",
"(",
"ttFont",
")",
":",
"# See http://forum.fontlab.com/index.php?topic=313.0",
"import",
"re",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"bad_entries",
"=",
"[",
"]",
"# <Postscript n... | Font follows the family naming recommendations? | [
"Font",
"follows",
"the",
"family",
"naming",
"recommendations?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L238-L332 |
9,730 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_google_fonts_check_name_rfn | def com_google_fonts_check_name_rfn(ttFont):
"""Name table strings must not contain the string 'Reserved Font Name'."""
failed = False
for entry in ttFont["name"].names:
string = entry.toUnicode()
if "reserved font name" in string.lower():
yield WARN, ("Name table entry (\"{}\")"
... | python | def com_google_fonts_check_name_rfn(ttFont):
"""Name table strings must not contain the string 'Reserved Font Name'."""
failed = False
for entry in ttFont["name"].names:
string = entry.toUnicode()
if "reserved font name" in string.lower():
yield WARN, ("Name table entry (\"{}\")"
... | [
"def",
"com_google_fonts_check_name_rfn",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"entry",
"in",
"ttFont",
"[",
"\"name\"",
"]",
".",
"names",
":",
"string",
"=",
"entry",
".",
"toUnicode",
"(",
")",
"if",
"\"reserved font name\"",
"in",
"str... | Name table strings must not contain the string 'Reserved Font Name'. | [
"Name",
"table",
"strings",
"must",
"not",
"contain",
"the",
"string",
"Reserved",
"Font",
"Name",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L338-L351 |
9,731 | googlefonts/fontbakery | Lib/fontbakery/profiles/name.py | com_adobe_fonts_check_family_max_4_fonts_per_family_name | def com_adobe_fonts_check_family_max_4_fonts_per_family_name(ttFonts):
"""Verify that each group of fonts with the same nameID 1
has maximum of 4 fonts"""
from collections import Counter
from fontbakery.utils import get_name_entry_strings
failed = False
family_names = list()
for ttFont in ttFonts:
na... | python | def com_adobe_fonts_check_family_max_4_fonts_per_family_name(ttFonts):
"""Verify that each group of fonts with the same nameID 1
has maximum of 4 fonts"""
from collections import Counter
from fontbakery.utils import get_name_entry_strings
failed = False
family_names = list()
for ttFont in ttFonts:
na... | [
"def",
"com_adobe_fonts_check_family_max_4_fonts_per_family_name",
"(",
"ttFonts",
")",
":",
"from",
"collections",
"import",
"Counter",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"failed",
"=",
"False",
"family_names",
"=",
"list",
"(",
")"... | Verify that each group of fonts with the same nameID 1
has maximum of 4 fonts | [
"Verify",
"that",
"each",
"group",
"of",
"fonts",
"with",
"the",
"same",
"nameID",
"1",
"has",
"maximum",
"of",
"4",
"fonts"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/name.py#L421-L445 |
9,732 | googlefonts/fontbakery | Lib/fontbakery/profiles/cmap.py | com_google_fonts_check_family_equal_unicode_encodings | def com_google_fonts_check_family_equal_unicode_encodings(ttFonts):
"""Fonts have equal unicode encodings?"""
encoding = None
failed = False
for ttFont in ttFonts:
cmap = None
for table in ttFont['cmap'].tables:
if table.format == 4:
cmap = table
break
# Could a font lack a for... | python | def com_google_fonts_check_family_equal_unicode_encodings(ttFonts):
"""Fonts have equal unicode encodings?"""
encoding = None
failed = False
for ttFont in ttFonts:
cmap = None
for table in ttFont['cmap'].tables:
if table.format == 4:
cmap = table
break
# Could a font lack a for... | [
"def",
"com_google_fonts_check_family_equal_unicode_encodings",
"(",
"ttFonts",
")",
":",
"encoding",
"=",
"None",
"failed",
"=",
"False",
"for",
"ttFont",
"in",
"ttFonts",
":",
"cmap",
"=",
"None",
"for",
"table",
"in",
"ttFont",
"[",
"'cmap'",
"]",
".",
"tab... | Fonts have equal unicode encodings? | [
"Fonts",
"have",
"equal",
"unicode",
"encodings?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/cmap.py#L10-L30 |
9,733 | googlefonts/fontbakery | Lib/fontbakery/profiles/cmap.py | com_google_fonts_check_all_glyphs_have_codepoints | def com_google_fonts_check_all_glyphs_have_codepoints(ttFont):
"""Check all glyphs have codepoints assigned."""
failed = False
for subtable in ttFont['cmap'].tables:
if subtable.isUnicode():
for item in subtable.cmap.items():
codepoint = item[0]
if codepoint is None:
failed = T... | python | def com_google_fonts_check_all_glyphs_have_codepoints(ttFont):
"""Check all glyphs have codepoints assigned."""
failed = False
for subtable in ttFont['cmap'].tables:
if subtable.isUnicode():
for item in subtable.cmap.items():
codepoint = item[0]
if codepoint is None:
failed = T... | [
"def",
"com_google_fonts_check_all_glyphs_have_codepoints",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"subtable",
"in",
"ttFont",
"[",
"'cmap'",
"]",
".",
"tables",
":",
"if",
"subtable",
".",
"isUnicode",
"(",
")",
":",
"for",
"item",
"in",
"s... | Check all glyphs have codepoints assigned. | [
"Check",
"all",
"glyphs",
"have",
"codepoints",
"assigned",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/cmap.py#L42-L54 |
9,734 | googlefonts/fontbakery | Lib/fontbakery/reporters/__init__.py | FontbakeryReporter.run | def run(self, order=None):
"""
self.runner must be present
"""
for event in self.runner.run(order=order):
self.receive(event) | python | def run(self, order=None):
"""
self.runner must be present
"""
for event in self.runner.run(order=order):
self.receive(event) | [
"def",
"run",
"(",
"self",
",",
"order",
"=",
"None",
")",
":",
"for",
"event",
"in",
"self",
".",
"runner",
".",
"run",
"(",
"order",
"=",
"order",
")",
":",
"self",
".",
"receive",
"(",
"event",
")"
] | self.runner must be present | [
"self",
".",
"runner",
"must",
"be",
"present"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/__init__.py#L45-L50 |
9,735 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_name_trailing_spaces | def com_google_fonts_check_name_trailing_spaces(ttFont):
"""Name table records must not have trailing spaces."""
failed = False
for name_record in ttFont['name'].names:
name_string = name_record.toUnicode()
if name_string != name_string.strip():
failed = True
name_key = tuple([name_record.plat... | python | def com_google_fonts_check_name_trailing_spaces(ttFont):
"""Name table records must not have trailing spaces."""
failed = False
for name_record in ttFont['name'].names:
name_string = name_record.toUnicode()
if name_string != name_string.strip():
failed = True
name_key = tuple([name_record.plat... | [
"def",
"com_google_fonts_check_name_trailing_spaces",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"name_record",
"in",
"ttFont",
"[",
"'name'",
"]",
".",
"names",
":",
"name_string",
"=",
"name_record",
".",
"toUnicode",
"(",
")",
"if",
"name_string"... | Name table records must not have trailing spaces. | [
"Name",
"table",
"records",
"must",
"not",
"have",
"trailing",
"spaces",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L45-L61 |
9,736 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_family_single_directory | def com_google_fonts_check_family_single_directory(fonts):
"""Checking all files are in the same directory.
If the set of font files passed in the command line is not all in the
same directory, then we warn the user since the tool will interpret
the set of files as belonging to a single family (and it is unlik... | python | def com_google_fonts_check_family_single_directory(fonts):
"""Checking all files are in the same directory.
If the set of font files passed in the command line is not all in the
same directory, then we warn the user since the tool will interpret
the set of files as belonging to a single family (and it is unlik... | [
"def",
"com_google_fonts_check_family_single_directory",
"(",
"fonts",
")",
":",
"directories",
"=",
"[",
"]",
"for",
"target_file",
"in",
"fonts",
":",
"directory",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"target_file",
")",
"if",
"directory",
"not",
"in... | Checking all files are in the same directory.
If the set of font files passed in the command line is not all in the
same directory, then we warn the user since the tool will interpret
the set of files as belonging to a single family (and it is unlikely
that the user would store the files from a single family s... | [
"Checking",
"all",
"files",
"are",
"in",
"the",
"same",
"directory",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L194-L218 |
9,737 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_ftxvalidator | def com_google_fonts_check_ftxvalidator(font):
"""Checking with ftxvalidator."""
import plistlib
try:
import subprocess
ftx_cmd = [
"ftxvalidator",
"-t",
"all", # execute all checks
font
]
ftx_output = subprocess.check_output(ftx_cmd, stderr=subprocess.STDOUT)
... | python | def com_google_fonts_check_ftxvalidator(font):
"""Checking with ftxvalidator."""
import plistlib
try:
import subprocess
ftx_cmd = [
"ftxvalidator",
"-t",
"all", # execute all checks
font
]
ftx_output = subprocess.check_output(ftx_cmd, stderr=subprocess.STDOUT)
... | [
"def",
"com_google_fonts_check_ftxvalidator",
"(",
"font",
")",
":",
"import",
"plistlib",
"try",
":",
"import",
"subprocess",
"ftx_cmd",
"=",
"[",
"\"ftxvalidator\"",
",",
"\"-t\"",
",",
"\"all\"",
",",
"# execute all checks",
"font",
"]",
"ftx_output",
"=",
"sub... | Checking with ftxvalidator. | [
"Checking",
"with",
"ftxvalidator",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L258-L292 |
9,738 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_ots | def com_google_fonts_check_ots(font):
"""Checking with ots-sanitize."""
import ots
try:
process = ots.sanitize(font, check=True, capture_output=True)
except ots.CalledProcessError as e:
yield FAIL, (
"ots-sanitize returned an error code ({}). Output follows:\n\n{}{}"
).format(e.returncode, e.... | python | def com_google_fonts_check_ots(font):
"""Checking with ots-sanitize."""
import ots
try:
process = ots.sanitize(font, check=True, capture_output=True)
except ots.CalledProcessError as e:
yield FAIL, (
"ots-sanitize returned an error code ({}). Output follows:\n\n{}{}"
).format(e.returncode, e.... | [
"def",
"com_google_fonts_check_ots",
"(",
"font",
")",
":",
"import",
"ots",
"try",
":",
"process",
"=",
"ots",
".",
"sanitize",
"(",
"font",
",",
"check",
"=",
"True",
",",
"capture_output",
"=",
"True",
")",
"except",
"ots",
".",
"CalledProcessError",
"a... | Checking with ots-sanitize. | [
"Checking",
"with",
"ots",
"-",
"sanitize",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L298-L314 |
9,739 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_fontbakery_version | def com_google_fonts_check_fontbakery_version():
"""Do we have the latest version of FontBakery installed?"""
try:
import subprocess
installed_str = None
latest_str = None
is_latest = False
failed = False
pip_cmd = ["pip", "search", "fontbakery"]
pip_output = subprocess.check_output(pip... | python | def com_google_fonts_check_fontbakery_version():
"""Do we have the latest version of FontBakery installed?"""
try:
import subprocess
installed_str = None
latest_str = None
is_latest = False
failed = False
pip_cmd = ["pip", "search", "fontbakery"]
pip_output = subprocess.check_output(pip... | [
"def",
"com_google_fonts_check_fontbakery_version",
"(",
")",
":",
"try",
":",
"import",
"subprocess",
"installed_str",
"=",
"None",
"latest_str",
"=",
"None",
"is_latest",
"=",
"False",
"failed",
"=",
"False",
"pip_cmd",
"=",
"[",
"\"pip\"",
",",
"\"search\"",
... | Do we have the latest version of FontBakery installed? | [
"Do",
"we",
"have",
"the",
"latest",
"version",
"of",
"FontBakery",
"installed?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L343-L373 |
9,740 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_fontforge_stderr | def com_google_fonts_check_fontforge_stderr(font, fontforge_check_results):
"""FontForge validation outputs error messages?"""
if "skip" in fontforge_check_results:
yield SKIP, fontforge_check_results["skip"]
return
filtered_err_msgs = ""
for line in fontforge_check_results["ff_err_messages"].split('\n... | python | def com_google_fonts_check_fontforge_stderr(font, fontforge_check_results):
"""FontForge validation outputs error messages?"""
if "skip" in fontforge_check_results:
yield SKIP, fontforge_check_results["skip"]
return
filtered_err_msgs = ""
for line in fontforge_check_results["ff_err_messages"].split('\n... | [
"def",
"com_google_fonts_check_fontforge_stderr",
"(",
"font",
",",
"fontforge_check_results",
")",
":",
"if",
"\"skip\"",
"in",
"fontforge_check_results",
":",
"yield",
"SKIP",
",",
"fontforge_check_results",
"[",
"\"skip\"",
"]",
"return",
"filtered_err_msgs",
"=",
"\... | FontForge validation outputs error messages? | [
"FontForge",
"validation",
"outputs",
"error",
"messages?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L380-L401 |
9,741 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_mandatory_glyphs | def com_google_fonts_check_mandatory_glyphs(ttFont):
"""Font contains .notdef as first glyph?
The OpenType specification v1.8.2 recommends that the first glyph is the
.notdef glyph without a codepoint assigned and with a drawing.
https://docs.microsoft.com/en-us/typography/opentype/spec/recom#glyph-0-the-notd... | python | def com_google_fonts_check_mandatory_glyphs(ttFont):
"""Font contains .notdef as first glyph?
The OpenType specification v1.8.2 recommends that the first glyph is the
.notdef glyph without a codepoint assigned and with a drawing.
https://docs.microsoft.com/en-us/typography/opentype/spec/recom#glyph-0-the-notd... | [
"def",
"com_google_fonts_check_mandatory_glyphs",
"(",
"ttFont",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"glyph_has_ink",
"if",
"(",
"ttFont",
".",
"getGlyphOrder",
"(",
")",
"[",
"0",
"]",
"==",
"\".notdef\"",
"and",
"\".notdef\"",
"not",
"in",
... | Font contains .notdef as first glyph?
The OpenType specification v1.8.2 recommends that the first glyph is the
.notdef glyph without a codepoint assigned and with a drawing.
https://docs.microsoft.com/en-us/typography/opentype/spec/recom#glyph-0-the-notdef-glyph
Pre-v1.8, it was recommended that a font shoul... | [
"Font",
"contains",
".",
"notdef",
"as",
"first",
"glyph?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L559-L586 |
9,742 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_whitespace_ink | def com_google_fonts_check_whitespace_ink(ttFont):
"""Whitespace glyphs have ink?"""
from fontbakery.utils import get_glyph_name, glyph_has_ink
# code-points for all "whitespace" chars:
WHITESPACE_CHARACTERS = [
0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x0020, 0x0085, 0x00A0, 0x1680,
0x2000, 0x2001,... | python | def com_google_fonts_check_whitespace_ink(ttFont):
"""Whitespace glyphs have ink?"""
from fontbakery.utils import get_glyph_name, glyph_has_ink
# code-points for all "whitespace" chars:
WHITESPACE_CHARACTERS = [
0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x0020, 0x0085, 0x00A0, 0x1680,
0x2000, 0x2001,... | [
"def",
"com_google_fonts_check_whitespace_ink",
"(",
"ttFont",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"get_glyph_name",
",",
"glyph_has_ink",
"# code-points for all \"whitespace\" chars:",
"WHITESPACE_CHARACTERS",
"=",
"[",
"0x0009",
",",
"0x000A",
",",
"... | Whitespace glyphs have ink? | [
"Whitespace",
"glyphs",
"have",
"ink?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L652-L672 |
9,743 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_required_tables | def com_google_fonts_check_required_tables(ttFont):
"""Font contains all required tables?"""
from .shared_conditions import is_variable_font
REQUIRED_TABLES = {
"cmap", "head", "hhea", "hmtx", "maxp", "name", "OS/2", "post"}
OPTIONAL_TABLES = {
"cvt ", "fpgm", "loca", "prep", "VORG", "EBDT", "EBLC"... | python | def com_google_fonts_check_required_tables(ttFont):
"""Font contains all required tables?"""
from .shared_conditions import is_variable_font
REQUIRED_TABLES = {
"cmap", "head", "hhea", "hmtx", "maxp", "name", "OS/2", "post"}
OPTIONAL_TABLES = {
"cvt ", "fpgm", "loca", "prep", "VORG", "EBDT", "EBLC"... | [
"def",
"com_google_fonts_check_required_tables",
"(",
"ttFont",
")",
":",
"from",
".",
"shared_conditions",
"import",
"is_variable_font",
"REQUIRED_TABLES",
"=",
"{",
"\"cmap\"",
",",
"\"head\"",
",",
"\"hhea\"",
",",
"\"hmtx\"",
",",
"\"maxp\"",
",",
"\"name\"",
",... | Font contains all required tables? | [
"Font",
"contains",
"all",
"required",
"tables?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L689-L728 |
9,744 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_unwanted_tables | def com_google_fonts_check_unwanted_tables(ttFont):
"""Are there unwanted tables?"""
UNWANTED_TABLES = {
'FFTM': '(from FontForge)',
'TTFA': '(from TTFAutohint)',
'TSI0': '(from VTT)',
'TSI1': '(from VTT)',
'TSI2': '(from VTT)',
'TSI3': '(from VTT)',
'TSI5': '(from VTT)',
... | python | def com_google_fonts_check_unwanted_tables(ttFont):
"""Are there unwanted tables?"""
UNWANTED_TABLES = {
'FFTM': '(from FontForge)',
'TTFA': '(from TTFAutohint)',
'TSI0': '(from VTT)',
'TSI1': '(from VTT)',
'TSI2': '(from VTT)',
'TSI3': '(from VTT)',
'TSI5': '(from VTT)',
... | [
"def",
"com_google_fonts_check_unwanted_tables",
"(",
"ttFont",
")",
":",
"UNWANTED_TABLES",
"=",
"{",
"'FFTM'",
":",
"'(from FontForge)'",
",",
"'TTFA'",
":",
"'(from TTFAutohint)'",
",",
"'TSI0'",
":",
"'(from VTT)'",
",",
"'TSI1'",
":",
"'(from VTT)'",
",",
"'TSI... | Are there unwanted tables? | [
"Are",
"there",
"unwanted",
"tables?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L737-L762 |
9,745 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_valid_glyphnames | def com_google_fonts_check_valid_glyphnames(ttFont):
"""Glyph names are all valid?"""
if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
"post") and ttFont["post"].formatType == 3.0:
yield SKIP, ("TrueType fonts with a format 3.0 post table contain no"
" glyph names.")
else:
... | python | def com_google_fonts_check_valid_glyphnames(ttFont):
"""Glyph names are all valid?"""
if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
"post") and ttFont["post"].formatType == 3.0:
yield SKIP, ("TrueType fonts with a format 3.0 post table contain no"
" glyph names.")
else:
... | [
"def",
"com_google_fonts_check_valid_glyphnames",
"(",
"ttFont",
")",
":",
"if",
"ttFont",
".",
"sfntVersion",
"==",
"b'\\x00\\x01\\x00\\x00'",
"and",
"ttFont",
".",
"get",
"(",
"\"post\"",
")",
"and",
"ttFont",
"[",
"\"post\"",
"]",
".",
"formatType",
"==",
"3.... | Glyph names are all valid? | [
"Glyph",
"names",
"are",
"all",
"valid?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L777-L810 |
9,746 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_unique_glyphnames | def com_google_fonts_check_unique_glyphnames(ttFont):
"""Font contains unique glyph names?"""
if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
"post") and ttFont["post"].formatType == 3.0:
yield SKIP, ("TrueType fonts with a format 3.0 post table contain no"
" glyph names.")
... | python | def com_google_fonts_check_unique_glyphnames(ttFont):
"""Font contains unique glyph names?"""
if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
"post") and ttFont["post"].formatType == 3.0:
yield SKIP, ("TrueType fonts with a format 3.0 post table contain no"
" glyph names.")
... | [
"def",
"com_google_fonts_check_unique_glyphnames",
"(",
"ttFont",
")",
":",
"if",
"ttFont",
".",
"sfntVersion",
"==",
"b'\\x00\\x01\\x00\\x00'",
"and",
"ttFont",
".",
"get",
"(",
"\"post\"",
")",
"and",
"ttFont",
"[",
"\"post\"",
"]",
".",
"formatType",
"==",
"3... | Font contains unique glyph names? | [
"Font",
"contains",
"unique",
"glyph",
"names?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L822-L843 |
9,747 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_glyphnames_max_length | def com_google_fonts_check_glyphnames_max_length(ttFont):
"""Check that glyph names do not exceed max length."""
if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
"post") and ttFont["post"].formatType == 3.0:
yield PASS, ("TrueType fonts with a format 3.0 post table contain no "
... | python | def com_google_fonts_check_glyphnames_max_length(ttFont):
"""Check that glyph names do not exceed max length."""
if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
"post") and ttFont["post"].formatType == 3.0:
yield PASS, ("TrueType fonts with a format 3.0 post table contain no "
... | [
"def",
"com_google_fonts_check_glyphnames_max_length",
"(",
"ttFont",
")",
":",
"if",
"ttFont",
".",
"sfntVersion",
"==",
"b'\\x00\\x01\\x00\\x00'",
"and",
"ttFont",
".",
"get",
"(",
"\"post\"",
")",
"and",
"ttFont",
"[",
"\"post\"",
"]",
".",
"formatType",
"==",
... | Check that glyph names do not exceed max length. | [
"Check",
"that",
"glyph",
"names",
"do",
"not",
"exceed",
"max",
"length",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L857-L870 |
9,748 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_ttx_roundtrip | def com_google_fonts_check_ttx_roundtrip(font):
"""Checking with fontTools.ttx"""
from fontTools import ttx
import sys
ttFont = ttx.TTFont(font)
failed = False
class TTXLogger:
msgs = []
def __init__(self):
self.original_stderr = sys.stderr
self.original_stdout = sys.stdout
sys.s... | python | def com_google_fonts_check_ttx_roundtrip(font):
"""Checking with fontTools.ttx"""
from fontTools import ttx
import sys
ttFont = ttx.TTFont(font)
failed = False
class TTXLogger:
msgs = []
def __init__(self):
self.original_stderr = sys.stderr
self.original_stdout = sys.stdout
sys.s... | [
"def",
"com_google_fonts_check_ttx_roundtrip",
"(",
"font",
")",
":",
"from",
"fontTools",
"import",
"ttx",
"import",
"sys",
"ttFont",
"=",
"ttx",
".",
"TTFont",
"(",
"font",
")",
"failed",
"=",
"False",
"class",
"TTXLogger",
":",
"msgs",
"=",
"[",
"]",
"d... | Checking with fontTools.ttx | [
"Checking",
"with",
"fontTools",
".",
"ttx"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L877-L946 |
9,749 | googlefonts/fontbakery | Lib/fontbakery/profiles/universal.py | com_google_fonts_check_family_vertical_metrics | def com_google_fonts_check_family_vertical_metrics(ttFonts):
"""Each font in a family must have the same vertical metrics values."""
failed = []
vmetrics = {
"sTypoAscender": {},
"sTypoDescender": {},
"sTypoLineGap": {},
"usWinAscent": {},
"usWinDescent": {},
"ascent": {},
"descent": {... | python | def com_google_fonts_check_family_vertical_metrics(ttFonts):
"""Each font in a family must have the same vertical metrics values."""
failed = []
vmetrics = {
"sTypoAscender": {},
"sTypoDescender": {},
"sTypoLineGap": {},
"usWinAscent": {},
"usWinDescent": {},
"ascent": {},
"descent": {... | [
"def",
"com_google_fonts_check_family_vertical_metrics",
"(",
"ttFonts",
")",
":",
"failed",
"=",
"[",
"]",
"vmetrics",
"=",
"{",
"\"sTypoAscender\"",
":",
"{",
"}",
",",
"\"sTypoDescender\"",
":",
"{",
"}",
",",
"\"sTypoLineGap\"",
":",
"{",
"}",
",",
"\"usWi... | Each font in a family must have the same vertical metrics values. | [
"Each",
"font",
"in",
"a",
"family",
"must",
"have",
"the",
"same",
"vertical",
"metrics",
"values",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/universal.py#L956-L990 |
9,750 | googlefonts/fontbakery | Lib/fontbakery/profiles/hhea.py | com_google_fonts_check_linegaps | def com_google_fonts_check_linegaps(ttFont):
"""Checking Vertical Metric Linegaps."""
if ttFont["hhea"].lineGap != 0:
yield WARN, Message("hhea", "hhea lineGap is not equal to 0.")
elif ttFont["OS/2"].sTypoLineGap != 0:
yield WARN, Message("OS/2", "OS/2 sTypoLineGap is not equal to 0.")
else:
yield ... | python | def com_google_fonts_check_linegaps(ttFont):
"""Checking Vertical Metric Linegaps."""
if ttFont["hhea"].lineGap != 0:
yield WARN, Message("hhea", "hhea lineGap is not equal to 0.")
elif ttFont["OS/2"].sTypoLineGap != 0:
yield WARN, Message("OS/2", "OS/2 sTypoLineGap is not equal to 0.")
else:
yield ... | [
"def",
"com_google_fonts_check_linegaps",
"(",
"ttFont",
")",
":",
"if",
"ttFont",
"[",
"\"hhea\"",
"]",
".",
"lineGap",
"!=",
"0",
":",
"yield",
"WARN",
",",
"Message",
"(",
"\"hhea\"",
",",
"\"hhea lineGap is not equal to 0.\"",
")",
"elif",
"ttFont",
"[",
"... | Checking Vertical Metric Linegaps. | [
"Checking",
"Vertical",
"Metric",
"Linegaps",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/hhea.py#L14-L21 |
9,751 | googlefonts/fontbakery | Lib/fontbakery/profiles/hhea.py | com_google_fonts_check_maxadvancewidth | def com_google_fonts_check_maxadvancewidth(ttFont):
"""MaxAdvanceWidth is consistent with values in the Hmtx and Hhea tables?"""
hhea_advance_width_max = ttFont['hhea'].advanceWidthMax
hmtx_advance_width_max = None
for g in ttFont['hmtx'].metrics.values():
if hmtx_advance_width_max is None:
hmtx_advan... | python | def com_google_fonts_check_maxadvancewidth(ttFont):
"""MaxAdvanceWidth is consistent with values in the Hmtx and Hhea tables?"""
hhea_advance_width_max = ttFont['hhea'].advanceWidthMax
hmtx_advance_width_max = None
for g in ttFont['hmtx'].metrics.values():
if hmtx_advance_width_max is None:
hmtx_advan... | [
"def",
"com_google_fonts_check_maxadvancewidth",
"(",
"ttFont",
")",
":",
"hhea_advance_width_max",
"=",
"ttFont",
"[",
"'hhea'",
"]",
".",
"advanceWidthMax",
"hmtx_advance_width_max",
"=",
"None",
"for",
"g",
"in",
"ttFont",
"[",
"'hmtx'",
"]",
".",
"metrics",
".... | MaxAdvanceWidth is consistent with values in the Hmtx and Hhea tables? | [
"MaxAdvanceWidth",
"is",
"consistent",
"with",
"values",
"in",
"the",
"Hmtx",
"and",
"Hhea",
"tables?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/hhea.py#L27-L43 |
9,752 | googlefonts/fontbakery | Lib/fontbakery/profiles/hhea.py | com_google_fonts_check_monospace_max_advancewidth | def com_google_fonts_check_monospace_max_advancewidth(ttFont, glyph_metrics_stats):
"""Monospace font has hhea.advanceWidthMax equal to each glyph's
advanceWidth?"""
from fontbakery.utils import pretty_print_list
seems_monospaced = glyph_metrics_stats["seems_monospaced"]
if not seems_monospaced:
yield SK... | python | def com_google_fonts_check_monospace_max_advancewidth(ttFont, glyph_metrics_stats):
"""Monospace font has hhea.advanceWidthMax equal to each glyph's
advanceWidth?"""
from fontbakery.utils import pretty_print_list
seems_monospaced = glyph_metrics_stats["seems_monospaced"]
if not seems_monospaced:
yield SK... | [
"def",
"com_google_fonts_check_monospace_max_advancewidth",
"(",
"ttFont",
",",
"glyph_metrics_stats",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"pretty_print_list",
"seems_monospaced",
"=",
"glyph_metrics_stats",
"[",
"\"seems_monospaced\"",
"]",
"if",
"not",... | Monospace font has hhea.advanceWidthMax equal to each glyph's
advanceWidth? | [
"Monospace",
"font",
"has",
"hhea",
".",
"advanceWidthMax",
"equal",
"to",
"each",
"glyph",
"s",
"advanceWidth?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/hhea.py#L50-L95 |
9,753 | googlefonts/fontbakery | Lib/fontbakery/profiles/shared_conditions.py | glyph_metrics_stats | def glyph_metrics_stats(ttFont):
"""Returns a dict containing whether the font seems_monospaced,
what's the maximum glyph width and what's the most common width.
For a font to be considered monospaced, at least 80% of
the ascii glyphs must have the same width."""
glyph_metrics = ttFont['hmtx'].metrics
asci... | python | def glyph_metrics_stats(ttFont):
"""Returns a dict containing whether the font seems_monospaced,
what's the maximum glyph width and what's the most common width.
For a font to be considered monospaced, at least 80% of
the ascii glyphs must have the same width."""
glyph_metrics = ttFont['hmtx'].metrics
asci... | [
"def",
"glyph_metrics_stats",
"(",
"ttFont",
")",
":",
"glyph_metrics",
"=",
"ttFont",
"[",
"'hmtx'",
"]",
".",
"metrics",
"ascii_glyph_names",
"=",
"[",
"ttFont",
".",
"getBestCmap",
"(",
")",
"[",
"c",
"]",
"for",
"c",
"in",
"range",
"(",
"32",
",",
... | Returns a dict containing whether the font seems_monospaced,
what's the maximum glyph width and what's the most common width.
For a font to be considered monospaced, at least 80% of
the ascii glyphs must have the same width. | [
"Returns",
"a",
"dict",
"containing",
"whether",
"the",
"font",
"seems_monospaced",
"what",
"s",
"the",
"maximum",
"glyph",
"width",
"and",
"what",
"s",
"the",
"most",
"common",
"width",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/shared_conditions.py#L77-L98 |
9,754 | googlefonts/fontbakery | Lib/fontbakery/profiles/shared_conditions.py | vtt_talk_sources | def vtt_talk_sources(ttFont) -> List[str]:
"""Return the tags of VTT source tables found in a font."""
VTT_SOURCE_TABLES = {'TSI0', 'TSI1', 'TSI2', 'TSI3', 'TSI5'}
tables_found = [tag for tag in ttFont.keys() if tag in VTT_SOURCE_TABLES]
return tables_found | python | def vtt_talk_sources(ttFont) -> List[str]:
"""Return the tags of VTT source tables found in a font."""
VTT_SOURCE_TABLES = {'TSI0', 'TSI1', 'TSI2', 'TSI3', 'TSI5'}
tables_found = [tag for tag in ttFont.keys() if tag in VTT_SOURCE_TABLES]
return tables_found | [
"def",
"vtt_talk_sources",
"(",
"ttFont",
")",
"->",
"List",
"[",
"str",
"]",
":",
"VTT_SOURCE_TABLES",
"=",
"{",
"'TSI0'",
",",
"'TSI1'",
",",
"'TSI2'",
",",
"'TSI3'",
",",
"'TSI5'",
"}",
"tables_found",
"=",
"[",
"tag",
"for",
"tag",
"in",
"ttFont",
... | Return the tags of VTT source tables found in a font. | [
"Return",
"the",
"tags",
"of",
"VTT",
"source",
"tables",
"found",
"in",
"a",
"font",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/shared_conditions.py#L180-L184 |
9,755 | googlefonts/fontbakery | Lib/fontbakery/reporters/terminal.py | ThrottledOut.write | def write(self, data):
"""only put to stdout every now and then"""
self._buffer.append(data)
self._current_ticks += 1
# first entry ever will be flushed immediately
flush=False
if self._last_flush_time is None or \
(self._holdback_time is None and self._max_ticks == 0):
fl... | python | def write(self, data):
"""only put to stdout every now and then"""
self._buffer.append(data)
self._current_ticks += 1
# first entry ever will be flushed immediately
flush=False
if self._last_flush_time is None or \
(self._holdback_time is None and self._max_ticks == 0):
fl... | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_buffer",
".",
"append",
"(",
"data",
")",
"self",
".",
"_current_ticks",
"+=",
"1",
"# first entry ever will be flushed immediately",
"flush",
"=",
"False",
"if",
"self",
".",
"_last_flush_time... | only put to stdout every now and then | [
"only",
"put",
"to",
"stdout",
"every",
"now",
"and",
"then"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/terminal.py#L139-L154 |
9,756 | googlefonts/fontbakery | Lib/fontbakery/reporters/terminal.py | ThrottledOut.flush | def flush(self, draw_progress=True):
"""call this at the very end, so that we can output the rest"""
reset_progressbar = None
if self._draw_progressbar and draw_progress:
progressbar, reset_progressbar = self._draw_progressbar()
self._buffer.append(progressbar)
for line in self._buffer:
... | python | def flush(self, draw_progress=True):
"""call this at the very end, so that we can output the rest"""
reset_progressbar = None
if self._draw_progressbar and draw_progress:
progressbar, reset_progressbar = self._draw_progressbar()
self._buffer.append(progressbar)
for line in self._buffer:
... | [
"def",
"flush",
"(",
"self",
",",
"draw_progress",
"=",
"True",
")",
":",
"reset_progressbar",
"=",
"None",
"if",
"self",
".",
"_draw_progressbar",
"and",
"draw_progress",
":",
"progressbar",
",",
"reset_progressbar",
"=",
"self",
".",
"_draw_progressbar",
"(",
... | call this at the very end, so that we can output the rest | [
"call",
"this",
"at",
"the",
"very",
"end",
"so",
"that",
"we",
"can",
"output",
"the",
"rest"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/terminal.py#L156-L171 |
9,757 | googlefonts/fontbakery | Lib/fontbakery/reporters/terminal.py | TerminalProgress._draw_progressbar | def _draw_progressbar(self, columns=None, len_prefix=0, right_margin=0):
"""
if columns is None, don't insert any extra line breaks
"""
if self._order == None:
total = len(self._results)
else:
total = max(len(self._order), len(self._results))
percent = int(round(len(self._results)/t... | python | def _draw_progressbar(self, columns=None, len_prefix=0, right_margin=0):
"""
if columns is None, don't insert any extra line breaks
"""
if self._order == None:
total = len(self._results)
else:
total = max(len(self._order), len(self._results))
percent = int(round(len(self._results)/t... | [
"def",
"_draw_progressbar",
"(",
"self",
",",
"columns",
"=",
"None",
",",
"len_prefix",
"=",
"0",
",",
"right_margin",
"=",
"0",
")",
":",
"if",
"self",
".",
"_order",
"==",
"None",
":",
"total",
"=",
"len",
"(",
"self",
".",
"_results",
")",
"else"... | if columns is None, don't insert any extra line breaks | [
"if",
"columns",
"is",
"None",
"don",
"t",
"insert",
"any",
"extra",
"line",
"breaks"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/terminal.py#L281-L319 |
9,758 | googlefonts/fontbakery | snippets/fontbakery-check-upstream.py | download_file | def download_file(url, dst_path):
"""Download a file from a url"""
request = requests.get(url, stream=True)
with open(dst_path, 'wb') as downloaded_file:
request.raw.decode_content = True
shutil.copyfileobj(request.raw, downloaded_file) | python | def download_file(url, dst_path):
"""Download a file from a url"""
request = requests.get(url, stream=True)
with open(dst_path, 'wb') as downloaded_file:
request.raw.decode_content = True
shutil.copyfileobj(request.raw, downloaded_file) | [
"def",
"download_file",
"(",
"url",
",",
"dst_path",
")",
":",
"request",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"stream",
"=",
"True",
")",
"with",
"open",
"(",
"dst_path",
",",
"'wb'",
")",
"as",
"downloaded_file",
":",
"request",
".",
"raw",
... | Download a file from a url | [
"Download",
"a",
"file",
"from",
"a",
"url"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/snippets/fontbakery-check-upstream.py#L32-L37 |
9,759 | googlefonts/fontbakery | snippets/fontbakery-check-upstream.py | download_fonts | def download_fonts(gh_url, dst):
"""Download fonts from a github dir"""
font_paths = []
r = requests.get(gh_url)
for item in r.json():
if item['name'].endswith(".ttf"):
f = item['download_url']
dl_path = os.path.join(dst, os.path.basename(f))
download_file(f, ... | python | def download_fonts(gh_url, dst):
"""Download fonts from a github dir"""
font_paths = []
r = requests.get(gh_url)
for item in r.json():
if item['name'].endswith(".ttf"):
f = item['download_url']
dl_path = os.path.join(dst, os.path.basename(f))
download_file(f, ... | [
"def",
"download_fonts",
"(",
"gh_url",
",",
"dst",
")",
":",
"font_paths",
"=",
"[",
"]",
"r",
"=",
"requests",
".",
"get",
"(",
"gh_url",
")",
"for",
"item",
"in",
"r",
".",
"json",
"(",
")",
":",
"if",
"item",
"[",
"'name'",
"]",
".",
"endswit... | Download fonts from a github dir | [
"Download",
"fonts",
"from",
"a",
"github",
"dir"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/snippets/fontbakery-check-upstream.py#L40-L50 |
9,760 | googlefonts/fontbakery | Lib/fontbakery/profiles/head.py | com_google_fonts_check_family_equal_font_versions | def com_google_fonts_check_family_equal_font_versions(ttFonts):
"""Make sure all font files have the same version value."""
all_detected_versions = []
fontfile_versions = {}
for ttFont in ttFonts:
v = ttFont['head'].fontRevision
fontfile_versions[ttFont] = v
if v not in all_detected_versions:
... | python | def com_google_fonts_check_family_equal_font_versions(ttFonts):
"""Make sure all font files have the same version value."""
all_detected_versions = []
fontfile_versions = {}
for ttFont in ttFonts:
v = ttFont['head'].fontRevision
fontfile_versions[ttFont] = v
if v not in all_detected_versions:
... | [
"def",
"com_google_fonts_check_family_equal_font_versions",
"(",
"ttFonts",
")",
":",
"all_detected_versions",
"=",
"[",
"]",
"fontfile_versions",
"=",
"{",
"}",
"for",
"ttFont",
"in",
"ttFonts",
":",
"v",
"=",
"ttFont",
"[",
"'head'",
"]",
".",
"fontRevision",
... | Make sure all font files have the same version value. | [
"Make",
"sure",
"all",
"font",
"files",
"have",
"the",
"same",
"version",
"value",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/head.py#L13-L33 |
9,761 | googlefonts/fontbakery | Lib/fontbakery/profiles/head.py | com_google_fonts_check_unitsperem | def com_google_fonts_check_unitsperem(ttFont):
"""Checking unitsPerEm value is reasonable."""
upem = ttFont['head'].unitsPerEm
target_upem = [2**i for i in range(4, 15)]
target_upem.append(1000)
target_upem.append(2000)
if upem < 16 or upem > 16384:
yield FAIL, ("The value of unitsPerEm at the head tabl... | python | def com_google_fonts_check_unitsperem(ttFont):
"""Checking unitsPerEm value is reasonable."""
upem = ttFont['head'].unitsPerEm
target_upem = [2**i for i in range(4, 15)]
target_upem.append(1000)
target_upem.append(2000)
if upem < 16 or upem > 16384:
yield FAIL, ("The value of unitsPerEm at the head tabl... | [
"def",
"com_google_fonts_check_unitsperem",
"(",
"ttFont",
")",
":",
"upem",
"=",
"ttFont",
"[",
"'head'",
"]",
".",
"unitsPerEm",
"target_upem",
"=",
"[",
"2",
"**",
"i",
"for",
"i",
"in",
"range",
"(",
"4",
",",
"15",
")",
"]",
"target_upem",
".",
"a... | Checking unitsPerEm value is reasonable. | [
"Checking",
"unitsPerEm",
"value",
"is",
"reasonable",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/head.py#L53-L73 |
9,762 | googlefonts/fontbakery | Lib/fontbakery/callable.py | cached_getter | def cached_getter(func):
"""Decorate a property by executing it at instatiation time and cache the
result on the instance object."""
@wraps(func)
def wrapper(self):
attribute = f'_{func.__name__}'
value = getattr(self, attribute, None)
if value is None:
value = func(self)
setattr(self, a... | python | def cached_getter(func):
"""Decorate a property by executing it at instatiation time and cache the
result on the instance object."""
@wraps(func)
def wrapper(self):
attribute = f'_{func.__name__}'
value = getattr(self, attribute, None)
if value is None:
value = func(self)
setattr(self, a... | [
"def",
"cached_getter",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"self",
")",
":",
"attribute",
"=",
"f'_{func.__name__}'",
"value",
"=",
"getattr",
"(",
"self",
",",
"attribute",
",",
"None",
")",
"if",
"value",
"i... | Decorate a property by executing it at instatiation time and cache the
result on the instance object. | [
"Decorate",
"a",
"property",
"by",
"executing",
"it",
"at",
"instatiation",
"time",
"and",
"cache",
"the",
"result",
"on",
"the",
"instance",
"object",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/callable.py#L18-L29 |
9,763 | googlefonts/fontbakery | Lib/fontbakery/callable.py | condition | def condition(*args, **kwds):
"""Check wrapper, a factory for FontBakeryCondition
Requires all arguments of FontBakeryCondition but not `func`
which is passed via the decorator syntax.
"""
if len(args) == 1 and len(kwds) == 0 and callable(args[0]):
# used as `@decorator`
func = args[0]
return wra... | python | def condition(*args, **kwds):
"""Check wrapper, a factory for FontBakeryCondition
Requires all arguments of FontBakeryCondition but not `func`
which is passed via the decorator syntax.
"""
if len(args) == 1 and len(kwds) == 0 and callable(args[0]):
# used as `@decorator`
func = args[0]
return wra... | [
"def",
"condition",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"len",
"(",
"args",
")",
"==",
"1",
"and",
"len",
"(",
"kwds",
")",
"==",
"0",
"and",
"callable",
"(",
"args",
"[",
"0",
"]",
")",
":",
"# used as `@decorator`",
"func",... | Check wrapper, a factory for FontBakeryCondition
Requires all arguments of FontBakeryCondition but not `func`
which is passed via the decorator syntax. | [
"Check",
"wrapper",
"a",
"factory",
"for",
"FontBakeryCondition"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/callable.py#L211-L225 |
9,764 | googlefonts/fontbakery | Lib/fontbakery/callable.py | check | def check(*args, **kwds):
"""Check wrapper, a factory for FontBakeryCheck
Requires all arguments of FontBakeryCheck but not `checkfunc`
which is passed via the decorator syntax.
"""
def wrapper(checkfunc):
return wraps(checkfunc)(FontBakeryCheck(checkfunc, *args, **kwds))
return wrapper | python | def check(*args, **kwds):
"""Check wrapper, a factory for FontBakeryCheck
Requires all arguments of FontBakeryCheck but not `checkfunc`
which is passed via the decorator syntax.
"""
def wrapper(checkfunc):
return wraps(checkfunc)(FontBakeryCheck(checkfunc, *args, **kwds))
return wrapper | [
"def",
"check",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"def",
"wrapper",
"(",
"checkfunc",
")",
":",
"return",
"wraps",
"(",
"checkfunc",
")",
"(",
"FontBakeryCheck",
"(",
"checkfunc",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
")",
... | Check wrapper, a factory for FontBakeryCheck
Requires all arguments of FontBakeryCheck but not `checkfunc`
which is passed via the decorator syntax. | [
"Check",
"wrapper",
"a",
"factory",
"for",
"FontBakeryCheck"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/callable.py#L227-L235 |
9,765 | googlefonts/fontbakery | Lib/fontbakery/utils.py | get_bounding_box | def get_bounding_box(font):
""" Returns max and min bbox of given truetype font """
ymin = 0
ymax = 0
if font.sfntVersion == 'OTTO':
ymin = font['head'].yMin
ymax = font['head'].yMax
else:
for g in font['glyf'].glyphs:
char = font['glyf'][g]
if hasattr... | python | def get_bounding_box(font):
""" Returns max and min bbox of given truetype font """
ymin = 0
ymax = 0
if font.sfntVersion == 'OTTO':
ymin = font['head'].yMin
ymax = font['head'].yMax
else:
for g in font['glyf'].glyphs:
char = font['glyf'][g]
if hasattr... | [
"def",
"get_bounding_box",
"(",
"font",
")",
":",
"ymin",
"=",
"0",
"ymax",
"=",
"0",
"if",
"font",
".",
"sfntVersion",
"==",
"'OTTO'",
":",
"ymin",
"=",
"font",
"[",
"'head'",
"]",
".",
"yMin",
"ymax",
"=",
"font",
"[",
"'head'",
"]",
".",
"yMax",... | Returns max and min bbox of given truetype font | [
"Returns",
"max",
"and",
"min",
"bbox",
"of",
"given",
"truetype",
"font"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/utils.py#L57-L71 |
9,766 | googlefonts/fontbakery | Lib/fontbakery/utils.py | glyph_contour_count | def glyph_contour_count(font, name):
"""Contour count for specified glyph.
This implementation will also return contour count for
composite glyphs.
"""
contour_count = 0
items = [font['glyf'][name]]
while items:
g = items.pop(0)
if g.isComposite():
for comp in g.... | python | def glyph_contour_count(font, name):
"""Contour count for specified glyph.
This implementation will also return contour count for
composite glyphs.
"""
contour_count = 0
items = [font['glyf'][name]]
while items:
g = items.pop(0)
if g.isComposite():
for comp in g.... | [
"def",
"glyph_contour_count",
"(",
"font",
",",
"name",
")",
":",
"contour_count",
"=",
"0",
"items",
"=",
"[",
"font",
"[",
"'glyf'",
"]",
"[",
"name",
"]",
"]",
"while",
"items",
":",
"g",
"=",
"items",
".",
"pop",
"(",
"0",
")",
"if",
"g",
"."... | Contour count for specified glyph.
This implementation will also return contour count for
composite glyphs. | [
"Contour",
"count",
"for",
"specified",
"glyph",
".",
"This",
"implementation",
"will",
"also",
"return",
"contour",
"count",
"for",
"composite",
"glyphs",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/utils.py#L116-L132 |
9,767 | googlefonts/fontbakery | Lib/fontbakery/utils.py | get_font_glyph_data | def get_font_glyph_data(font):
"""Return information for each glyph in a font"""
from fontbakery.constants import (PlatformID,
WindowsEncodingID)
font_data = []
try:
subtable = font['cmap'].getcmap(PlatformID.WINDOWS,
... | python | def get_font_glyph_data(font):
"""Return information for each glyph in a font"""
from fontbakery.constants import (PlatformID,
WindowsEncodingID)
font_data = []
try:
subtable = font['cmap'].getcmap(PlatformID.WINDOWS,
... | [
"def",
"get_font_glyph_data",
"(",
"font",
")",
":",
"from",
"fontbakery",
".",
"constants",
"import",
"(",
"PlatformID",
",",
"WindowsEncodingID",
")",
"font_data",
"=",
"[",
"]",
"try",
":",
"subtable",
"=",
"font",
"[",
"'cmap'",
"]",
".",
"getcmap",
"(... | Return information for each glyph in a font | [
"Return",
"information",
"for",
"each",
"glyph",
"in",
"a",
"font"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/utils.py#L135-L164 |
9,768 | googlefonts/fontbakery | Lib/fontbakery/utils.py | glyph_has_ink | def glyph_has_ink(font: TTFont, name: Text) -> bool:
"""Checks if specified glyph has any ink.
That is, that it has at least one defined contour associated.
Composites are considered to have ink if any of their components have ink.
Args:
font: the font
glyph_name: The name of the glyph to che... | python | def glyph_has_ink(font: TTFont, name: Text) -> bool:
"""Checks if specified glyph has any ink.
That is, that it has at least one defined contour associated.
Composites are considered to have ink if any of their components have ink.
Args:
font: the font
glyph_name: The name of the glyph to che... | [
"def",
"glyph_has_ink",
"(",
"font",
":",
"TTFont",
",",
"name",
":",
"Text",
")",
"->",
"bool",
":",
"if",
"'glyf'",
"in",
"font",
":",
"return",
"ttf_glyph_has_ink",
"(",
"font",
",",
"name",
")",
"elif",
"(",
"'CFF '",
"in",
"font",
")",
"or",
"("... | Checks if specified glyph has any ink.
That is, that it has at least one defined contour associated.
Composites are considered to have ink if any of their components have ink.
Args:
font: the font
glyph_name: The name of the glyph to check for ink.
Returns:
True if the font has at least... | [
"Checks",
"if",
"specified",
"glyph",
"has",
"any",
"ink",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/utils.py#L245-L261 |
9,769 | googlefonts/fontbakery | Lib/fontbakery/utils.py | assert_results_contain | def assert_results_contain(check_results, expected_status, expected_msgcode=None):
"""
This helper function is useful when we want to make sure that
a certain log message is emited by a check but it can be in any
order among other log messages.
"""
found = False
for status, message in check_results:
i... | python | def assert_results_contain(check_results, expected_status, expected_msgcode=None):
"""
This helper function is useful when we want to make sure that
a certain log message is emited by a check but it can be in any
order among other log messages.
"""
found = False
for status, message in check_results:
i... | [
"def",
"assert_results_contain",
"(",
"check_results",
",",
"expected_status",
",",
"expected_msgcode",
"=",
"None",
")",
":",
"found",
"=",
"False",
"for",
"status",
",",
"message",
"in",
"check_results",
":",
"if",
"status",
"==",
"expected_status",
"and",
"me... | This helper function is useful when we want to make sure that
a certain log message is emited by a check but it can be in any
order among other log messages. | [
"This",
"helper",
"function",
"is",
"useful",
"when",
"we",
"want",
"to",
"make",
"sure",
"that",
"a",
"certain",
"log",
"message",
"is",
"emited",
"by",
"a",
"check",
"but",
"it",
"can",
"be",
"in",
"any",
"order",
"among",
"other",
"log",
"messages",
... | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/utils.py#L264-L275 |
9,770 | googlefonts/fontbakery | Lib/fontbakery/profiles/post.py | com_google_fonts_check_family_underline_thickness | def com_google_fonts_check_family_underline_thickness(ttFonts):
"""Fonts have consistent underline thickness?"""
underTs = {}
underlineThickness = None
failed = False
for ttfont in ttFonts:
fontname = ttfont.reader.file.name
# stylename = style(fontname)
ut = ttfont['post'].underlineThickness
... | python | def com_google_fonts_check_family_underline_thickness(ttFonts):
"""Fonts have consistent underline thickness?"""
underTs = {}
underlineThickness = None
failed = False
for ttfont in ttFonts:
fontname = ttfont.reader.file.name
# stylename = style(fontname)
ut = ttfont['post'].underlineThickness
... | [
"def",
"com_google_fonts_check_family_underline_thickness",
"(",
"ttFonts",
")",
":",
"underTs",
"=",
"{",
"}",
"underlineThickness",
"=",
"None",
"failed",
"=",
"False",
"for",
"ttfont",
"in",
"ttFonts",
":",
"fontname",
"=",
"ttfont",
".",
"reader",
".",
"file... | Fonts have consistent underline thickness? | [
"Fonts",
"have",
"consistent",
"underline",
"thickness?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/post.py#L21-L47 |
9,771 | googlefonts/fontbakery | Lib/fontbakery/reporters/html.py | summary_table | def summary_table(
errors: int, fails: int, warns: int, skips: int, infos: int, passes: int, total: int
) -> str:
"""Return summary table with statistics."""
return f"""<h2>Summary</h2>
<table>
<tr>
<th>{EMOTICON['ERROR']} ERROR</th>
<th>{EMOTICON['FA... | python | def summary_table(
errors: int, fails: int, warns: int, skips: int, infos: int, passes: int, total: int
) -> str:
"""Return summary table with statistics."""
return f"""<h2>Summary</h2>
<table>
<tr>
<th>{EMOTICON['ERROR']} ERROR</th>
<th>{EMOTICON['FA... | [
"def",
"summary_table",
"(",
"errors",
":",
"int",
",",
"fails",
":",
"int",
",",
"warns",
":",
"int",
",",
"skips",
":",
"int",
",",
"infos",
":",
"int",
",",
"passes",
":",
"int",
",",
"total",
":",
"int",
")",
"->",
"str",
":",
"return",
"f\"\... | Return summary table with statistics. | [
"Return",
"summary",
"table",
"with",
"statistics",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/html.py#L204-L236 |
9,772 | googlefonts/fontbakery | Lib/fontbakery/reporters/html.py | HTMLReporter.get_html | def get_html(self) -> str:
"""Return complete report as a HTML string."""
data = self.getdoc()
num_checks = 0
body_elements = []
# Order by section first...
for section in data["sections"]:
section_name = html.escape(section["key"][0])
section_sta... | python | def get_html(self) -> str:
"""Return complete report as a HTML string."""
data = self.getdoc()
num_checks = 0
body_elements = []
# Order by section first...
for section in data["sections"]:
section_name = html.escape(section["key"][0])
section_sta... | [
"def",
"get_html",
"(",
"self",
")",
"->",
"str",
":",
"data",
"=",
"self",
".",
"getdoc",
"(",
")",
"num_checks",
"=",
"0",
"body_elements",
"=",
"[",
"]",
"# Order by section first...",
"for",
"section",
"in",
"data",
"[",
"\"sections\"",
"]",
":",
"se... | Return complete report as a HTML string. | [
"Return",
"complete",
"report",
"as",
"a",
"HTML",
"string",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/html.py#L29-L96 |
9,773 | googlefonts/fontbakery | Lib/fontbakery/reporters/html.py | HTMLReporter.omit_loglevel | def omit_loglevel(self, msg) -> bool:
"""Determine if message is below log level."""
return self.loglevels and (
self.loglevels[0] > fontbakery.checkrunner.Status(msg)
) | python | def omit_loglevel(self, msg) -> bool:
"""Determine if message is below log level."""
return self.loglevels and (
self.loglevels[0] > fontbakery.checkrunner.Status(msg)
) | [
"def",
"omit_loglevel",
"(",
"self",
",",
"msg",
")",
"->",
"bool",
":",
"return",
"self",
".",
"loglevels",
"and",
"(",
"self",
".",
"loglevels",
"[",
"0",
"]",
">",
"fontbakery",
".",
"checkrunner",
".",
"Status",
"(",
"msg",
")",
")"
] | Determine if message is below log level. | [
"Determine",
"if",
"message",
"is",
"below",
"log",
"level",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/html.py#L98-L102 |
9,774 | googlefonts/fontbakery | Lib/fontbakery/reporters/html.py | HTMLReporter.html_for_check | def html_for_check(self, check) -> str:
"""Return HTML string for complete single check."""
check["logs"].sort(key=lambda c: LOGLEVELS.index(c["status"]))
logs = "<ul>" + "".join([self.log_html(log) for log in check["logs"]]) + "</ul>"
return logs | python | def html_for_check(self, check) -> str:
"""Return HTML string for complete single check."""
check["logs"].sort(key=lambda c: LOGLEVELS.index(c["status"]))
logs = "<ul>" + "".join([self.log_html(log) for log in check["logs"]]) + "</ul>"
return logs | [
"def",
"html_for_check",
"(",
"self",
",",
"check",
")",
"->",
"str",
":",
"check",
"[",
"\"logs\"",
"]",
".",
"sort",
"(",
"key",
"=",
"lambda",
"c",
":",
"LOGLEVELS",
".",
"index",
"(",
"c",
"[",
"\"status\"",
"]",
")",
")",
"logs",
"=",
"\"<ul>\... | Return HTML string for complete single check. | [
"Return",
"HTML",
"string",
"for",
"complete",
"single",
"check",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/html.py#L104-L108 |
9,775 | googlefonts/fontbakery | Lib/fontbakery/reporters/html.py | HTMLReporter.log_html | def log_html(self, log) -> str:
"""Return single check sub-result string as HTML or not if below log
level."""
if not self.omit_loglevel(log["status"]):
emoticon = EMOTICON[log["status"]]
status = log["status"]
message = html.escape(log["message"]).replace("\n... | python | def log_html(self, log) -> str:
"""Return single check sub-result string as HTML or not if below log
level."""
if not self.omit_loglevel(log["status"]):
emoticon = EMOTICON[log["status"]]
status = log["status"]
message = html.escape(log["message"]).replace("\n... | [
"def",
"log_html",
"(",
"self",
",",
"log",
")",
"->",
"str",
":",
"if",
"not",
"self",
".",
"omit_loglevel",
"(",
"log",
"[",
"\"status\"",
"]",
")",
":",
"emoticon",
"=",
"EMOTICON",
"[",
"log",
"[",
"\"status\"",
"]",
"]",
"status",
"=",
"log",
... | Return single check sub-result string as HTML or not if below log
level. | [
"Return",
"single",
"check",
"sub",
"-",
"result",
"string",
"as",
"HTML",
"or",
"not",
"if",
"below",
"log",
"level",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/reporters/html.py#L110-L123 |
9,776 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | style | def style(font):
"""Determine font style from canonical filename."""
from fontbakery.constants import STATIC_STYLE_NAMES
filename = os.path.basename(font)
if '-' in filename:
stylename = os.path.splitext(filename)[0].split('-')[1]
if stylename in [name.replace(' ', '') for name in STATIC_STYLE_NAMES]:
... | python | def style(font):
"""Determine font style from canonical filename."""
from fontbakery.constants import STATIC_STYLE_NAMES
filename = os.path.basename(font)
if '-' in filename:
stylename = os.path.splitext(filename)[0].split('-')[1]
if stylename in [name.replace(' ', '') for name in STATIC_STYLE_NAMES]:
... | [
"def",
"style",
"(",
"font",
")",
":",
"from",
"fontbakery",
".",
"constants",
"import",
"STATIC_STYLE_NAMES",
"filename",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"font",
")",
"if",
"'-'",
"in",
"filename",
":",
"stylename",
"=",
"os",
".",
"path",... | Determine font style from canonical filename. | [
"Determine",
"font",
"style",
"from",
"canonical",
"filename",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L140-L148 |
9,777 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | canonical_stylename | def canonical_stylename(font):
""" Returns the canonical stylename of a given font. """
from fontbakery.constants import (STATIC_STYLE_NAMES,
VARFONT_SUFFIXES)
from fontbakery.profiles.shared_conditions import is_variable_font
from fontTools.ttLib import TTFont
# remove sp... | python | def canonical_stylename(font):
""" Returns the canonical stylename of a given font. """
from fontbakery.constants import (STATIC_STYLE_NAMES,
VARFONT_SUFFIXES)
from fontbakery.profiles.shared_conditions import is_variable_font
from fontTools.ttLib import TTFont
# remove sp... | [
"def",
"canonical_stylename",
"(",
"font",
")",
":",
"from",
"fontbakery",
".",
"constants",
"import",
"(",
"STATIC_STYLE_NAMES",
",",
"VARFONT_SUFFIXES",
")",
"from",
"fontbakery",
".",
"profiles",
".",
"shared_conditions",
"import",
"is_variable_font",
"from",
"fo... | Returns the canonical stylename of a given font. | [
"Returns",
"the",
"canonical",
"stylename",
"of",
"a",
"given",
"font",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L224-L241 |
9,778 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_canonical_filename | def com_google_fonts_check_canonical_filename(font):
"""Checking file is named canonically.
A font's filename must be composed in the following manner:
<familyname>-<stylename>.ttf
e.g. Nunito-Regular.ttf,
Oswald-BoldItalic.ttf
Variable fonts must use the "-VF" suffix:
e.g. Roboto-VF.ttf,
... | python | def com_google_fonts_check_canonical_filename(font):
"""Checking file is named canonically.
A font's filename must be composed in the following manner:
<familyname>-<stylename>.ttf
e.g. Nunito-Regular.ttf,
Oswald-BoldItalic.ttf
Variable fonts must use the "-VF" suffix:
e.g. Roboto-VF.ttf,
... | [
"def",
"com_google_fonts_check_canonical_filename",
"(",
"font",
")",
":",
"from",
"fontTools",
".",
"ttLib",
"import",
"TTFont",
"from",
"fontbakery",
".",
"profiles",
".",
"shared_conditions",
"import",
"is_variable_font",
"from",
"fontbakery",
".",
"constants",
"im... | Checking file is named canonically.
A font's filename must be composed in the following manner:
<familyname>-<stylename>.ttf
e.g. Nunito-Regular.ttf,
Oswald-BoldItalic.ttf
Variable fonts must use the "-VF" suffix:
e.g. Roboto-VF.ttf,
Barlow-VF.ttf,
Example-Roman-VF.ttf,
Familyn... | [
"Checking",
"file",
"is",
"named",
"canonically",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L250-L285 |
9,779 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | family_directory | def family_directory(fonts):
"""Get the path of font project directory."""
if fonts:
dirname = os.path.dirname(fonts[0])
if dirname == '':
dirname = '.'
return dirname | python | def family_directory(fonts):
"""Get the path of font project directory."""
if fonts:
dirname = os.path.dirname(fonts[0])
if dirname == '':
dirname = '.'
return dirname | [
"def",
"family_directory",
"(",
"fonts",
")",
":",
"if",
"fonts",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"fonts",
"[",
"0",
"]",
")",
"if",
"dirname",
"==",
"''",
":",
"dirname",
"=",
"'.'",
"return",
"dirname"
] | Get the path of font project directory. | [
"Get",
"the",
"path",
"of",
"font",
"project",
"directory",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L289-L295 |
9,780 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | descfile | def descfile(family_directory):
"""Get the path of the DESCRIPTION file of a given font project."""
if family_directory:
descfilepath = os.path.join(family_directory, "DESCRIPTION.en_us.html")
if os.path.exists(descfilepath):
return descfilepath | python | def descfile(family_directory):
"""Get the path of the DESCRIPTION file of a given font project."""
if family_directory:
descfilepath = os.path.join(family_directory, "DESCRIPTION.en_us.html")
if os.path.exists(descfilepath):
return descfilepath | [
"def",
"descfile",
"(",
"family_directory",
")",
":",
"if",
"family_directory",
":",
"descfilepath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"family_directory",
",",
"\"DESCRIPTION.en_us.html\"",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"descfilepat... | Get the path of the DESCRIPTION file of a given font project. | [
"Get",
"the",
"path",
"of",
"the",
"DESCRIPTION",
"file",
"of",
"a",
"given",
"font",
"project",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L299-L304 |
9,781 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_description_broken_links | def com_google_fonts_check_description_broken_links(description):
"""Does DESCRIPTION file contain broken links?"""
from lxml.html import HTMLParser
import defusedxml.lxml
import requests
doc = defusedxml.lxml.fromstring(description, parser=HTMLParser())
broken_links = []
for link in doc.xpath('//a/@href'... | python | def com_google_fonts_check_description_broken_links(description):
"""Does DESCRIPTION file contain broken links?"""
from lxml.html import HTMLParser
import defusedxml.lxml
import requests
doc = defusedxml.lxml.fromstring(description, parser=HTMLParser())
broken_links = []
for link in doc.xpath('//a/@href'... | [
"def",
"com_google_fonts_check_description_broken_links",
"(",
"description",
")",
":",
"from",
"lxml",
".",
"html",
"import",
"HTMLParser",
"import",
"defusedxml",
".",
"lxml",
"import",
"requests",
"doc",
"=",
"defusedxml",
".",
"lxml",
".",
"fromstring",
"(",
"... | Does DESCRIPTION file contain broken links? | [
"Does",
"DESCRIPTION",
"file",
"contain",
"broken",
"links?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L320-L351 |
9,782 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_metadata_parses | def com_google_fonts_check_metadata_parses(family_directory):
""" Check METADATA.pb parse correctly. """
from google.protobuf import text_format
from fontbakery.utils import get_FamilyProto_Message
try:
pb_file = os.path.join(family_directory, "METADATA.pb")
get_FamilyProto_Message(pb_file)
yield PA... | python | def com_google_fonts_check_metadata_parses(family_directory):
""" Check METADATA.pb parse correctly. """
from google.protobuf import text_format
from fontbakery.utils import get_FamilyProto_Message
try:
pb_file = os.path.join(family_directory, "METADATA.pb")
get_FamilyProto_Message(pb_file)
yield PA... | [
"def",
"com_google_fonts_check_metadata_parses",
"(",
"family_directory",
")",
":",
"from",
"google",
".",
"protobuf",
"import",
"text_format",
"from",
"fontbakery",
".",
"utils",
"import",
"get_FamilyProto_Message",
"try",
":",
"pb_file",
"=",
"os",
".",
"path",
".... | Check METADATA.pb parse correctly. | [
"Check",
"METADATA",
".",
"pb",
"parse",
"correctly",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L420-L432 |
9,783 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_family_equal_numbers_of_glyphs | def com_google_fonts_check_family_equal_numbers_of_glyphs(ttFonts):
"""Fonts have equal numbers of glyphs?"""
# ttFonts is an iterator, so here we make a list from it
# because we'll have to iterate twice in this check implementation:
the_ttFonts = list(ttFonts)
failed = False
max_stylename = None
max_co... | python | def com_google_fonts_check_family_equal_numbers_of_glyphs(ttFonts):
"""Fonts have equal numbers of glyphs?"""
# ttFonts is an iterator, so here we make a list from it
# because we'll have to iterate twice in this check implementation:
the_ttFonts = list(ttFonts)
failed = False
max_stylename = None
max_co... | [
"def",
"com_google_fonts_check_family_equal_numbers_of_glyphs",
"(",
"ttFonts",
")",
":",
"# ttFonts is an iterator, so here we make a list from it",
"# because we'll have to iterate twice in this check implementation:",
"the_ttFonts",
"=",
"list",
"(",
"ttFonts",
")",
"failed",
"=",
... | Fonts have equal numbers of glyphs? | [
"Fonts",
"have",
"equal",
"numbers",
"of",
"glyphs?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L452-L493 |
9,784 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_family_equal_glyph_names | def com_google_fonts_check_family_equal_glyph_names(ttFonts):
"""Fonts have equal glyph names?"""
fonts = list(ttFonts)
all_glyphnames = set()
for ttFont in fonts:
all_glyphnames |= set(ttFont["glyf"].glyphs.keys())
missing = {}
available = {}
for glyphname in all_glyphnames:
missing[glyphname] ... | python | def com_google_fonts_check_family_equal_glyph_names(ttFonts):
"""Fonts have equal glyph names?"""
fonts = list(ttFonts)
all_glyphnames = set()
for ttFont in fonts:
all_glyphnames |= set(ttFont["glyf"].glyphs.keys())
missing = {}
available = {}
for glyphname in all_glyphnames:
missing[glyphname] ... | [
"def",
"com_google_fonts_check_family_equal_glyph_names",
"(",
"ttFonts",
")",
":",
"fonts",
"=",
"list",
"(",
"ttFonts",
")",
"all_glyphnames",
"=",
"set",
"(",
")",
"for",
"ttFont",
"in",
"fonts",
":",
"all_glyphnames",
"|=",
"set",
"(",
"ttFont",
"[",
"\"gl... | Fonts have equal glyph names? | [
"Fonts",
"have",
"equal",
"glyph",
"names?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L500-L542 |
9,785 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | registered_vendor_ids | def registered_vendor_ids():
"""Get a list of vendor IDs from Microsoft's website."""
from bs4 import BeautifulSoup
from pkg_resources import resource_filename
registered_vendor_ids = {}
CACHED = resource_filename('fontbakery',
'data/fontbakery-microsoft-vendorlist.cache')
cont... | python | def registered_vendor_ids():
"""Get a list of vendor IDs from Microsoft's website."""
from bs4 import BeautifulSoup
from pkg_resources import resource_filename
registered_vendor_ids = {}
CACHED = resource_filename('fontbakery',
'data/fontbakery-microsoft-vendorlist.cache')
cont... | [
"def",
"registered_vendor_ids",
"(",
")",
":",
"from",
"bs4",
"import",
"BeautifulSoup",
"from",
"pkg_resources",
"import",
"resource_filename",
"registered_vendor_ids",
"=",
"{",
"}",
"CACHED",
"=",
"resource_filename",
"(",
"'fontbakery'",
",",
"'data/fontbakery-micro... | Get a list of vendor IDs from Microsoft's website. | [
"Get",
"a",
"list",
"of",
"vendor",
"IDs",
"from",
"Microsoft",
"s",
"website",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L600-L630 |
9,786 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_unwanted_chars | def com_google_fonts_check_name_unwanted_chars(ttFont):
"""Substitute copyright, registered and trademark
symbols in name table entries."""
failed = False
replacement_map = [("\u00a9", '(c)'),
("\u00ae", '(r)'),
("\u2122", '(tm)')]
for name in ttFont['name'].names:... | python | def com_google_fonts_check_name_unwanted_chars(ttFont):
"""Substitute copyright, registered and trademark
symbols in name table entries."""
failed = False
replacement_map = [("\u00a9", '(c)'),
("\u00ae", '(r)'),
("\u2122", '(tm)')]
for name in ttFont['name'].names:... | [
"def",
"com_google_fonts_check_name_unwanted_chars",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"replacement_map",
"=",
"[",
"(",
"\"\\u00a9\"",
",",
"'(c)'",
")",
",",
"(",
"\"\\u00ae\"",
",",
"'(r)'",
")",
",",
"(",
"\"\\u2122\"",
",",
"'(tm)'",
")",
... | Substitute copyright, registered and trademark
symbols in name table entries. | [
"Substitute",
"copyright",
"registered",
"and",
"trademark",
"symbols",
"in",
"name",
"table",
"entries",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L666-L684 |
9,787 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | licenses | def licenses(family_directory):
"""Get a list of paths for every license
file found in a font project."""
found = []
search_paths = [family_directory]
gitroot = git_rootdir(family_directory)
if gitroot and gitroot not in search_paths:
search_paths.append(gitroot)
for directory in search_paths:
... | python | def licenses(family_directory):
"""Get a list of paths for every license
file found in a font project."""
found = []
search_paths = [family_directory]
gitroot = git_rootdir(family_directory)
if gitroot and gitroot not in search_paths:
search_paths.append(gitroot)
for directory in search_paths:
... | [
"def",
"licenses",
"(",
"family_directory",
")",
":",
"found",
"=",
"[",
"]",
"search_paths",
"=",
"[",
"family_directory",
"]",
"gitroot",
"=",
"git_rootdir",
"(",
"family_directory",
")",
"if",
"gitroot",
"and",
"gitroot",
"not",
"in",
"search_paths",
":",
... | Get a list of paths for every license
file found in a font project. | [
"Get",
"a",
"list",
"of",
"paths",
"for",
"every",
"license",
"file",
"found",
"in",
"a",
"font",
"project",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L740-L755 |
9,788 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_family_has_license | def com_google_fonts_check_family_has_license(licenses):
"""Check font has a license."""
if len(licenses) > 1:
yield FAIL, Message("multiple",
("More than a single license file found."
" Please review."))
elif not licenses:
yield FAIL, Message("no-license",... | python | def com_google_fonts_check_family_has_license(licenses):
"""Check font has a license."""
if len(licenses) > 1:
yield FAIL, Message("multiple",
("More than a single license file found."
" Please review."))
elif not licenses:
yield FAIL, Message("no-license",... | [
"def",
"com_google_fonts_check_family_has_license",
"(",
"licenses",
")",
":",
"if",
"len",
"(",
"licenses",
")",
">",
"1",
":",
"yield",
"FAIL",
",",
"Message",
"(",
"\"multiple\"",
",",
"(",
"\"More than a single license file found.\"",
"\" Please review.\"",
")",
... | Check font has a license. | [
"Check",
"font",
"has",
"a",
"license",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L775-L790 |
9,789 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_license | def com_google_fonts_check_name_license(ttFont, license):
"""Check copyright namerecords match license file."""
from fontbakery.constants import PLACEHOLDER_LICENSING_TEXT
failed = False
placeholder = PLACEHOLDER_LICENSING_TEXT[license]
entry_found = False
for i, nameRecord in enumerate(ttFont["name"].names... | python | def com_google_fonts_check_name_license(ttFont, license):
"""Check copyright namerecords match license file."""
from fontbakery.constants import PLACEHOLDER_LICENSING_TEXT
failed = False
placeholder = PLACEHOLDER_LICENSING_TEXT[license]
entry_found = False
for i, nameRecord in enumerate(ttFont["name"].names... | [
"def",
"com_google_fonts_check_name_license",
"(",
"ttFont",
",",
"license",
")",
":",
"from",
"fontbakery",
".",
"constants",
"import",
"PLACEHOLDER_LICENSING_TEXT",
"failed",
"=",
"False",
"placeholder",
"=",
"PLACEHOLDER_LICENSING_TEXT",
"[",
"license",
"]",
"entry_f... | Check copyright namerecords match license file. | [
"Check",
"copyright",
"namerecords",
"match",
"license",
"file",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L799-L830 |
9,790 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_license_url | def com_google_fonts_check_name_license_url(ttFont, familyname):
""""License URL matches License text on name table?"""
from fontbakery.constants import PLACEHOLDER_LICENSING_TEXT
LEGACY_UFL_FAMILIES = ["Ubuntu", "UbuntuCondensed", "UbuntuMono"]
LICENSE_URL = {
'OFL.txt': 'http://scripts.sil.org/OFL',
'... | python | def com_google_fonts_check_name_license_url(ttFont, familyname):
""""License URL matches License text on name table?"""
from fontbakery.constants import PLACEHOLDER_LICENSING_TEXT
LEGACY_UFL_FAMILIES = ["Ubuntu", "UbuntuCondensed", "UbuntuMono"]
LICENSE_URL = {
'OFL.txt': 'http://scripts.sil.org/OFL',
'... | [
"def",
"com_google_fonts_check_name_license_url",
"(",
"ttFont",
",",
"familyname",
")",
":",
"from",
"fontbakery",
".",
"constants",
"import",
"PLACEHOLDER_LICENSING_TEXT",
"LEGACY_UFL_FAMILIES",
"=",
"[",
"\"Ubuntu\"",
",",
"\"UbuntuCondensed\"",
",",
"\"UbuntuMono\"",
... | License URL matches License text on name table? | [
"License",
"URL",
"matches",
"License",
"text",
"on",
"name",
"table?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L848-L919 |
9,791 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_description_max_length | def com_google_fonts_check_name_description_max_length(ttFont):
"""Description strings in the name table must not exceed 200 characters."""
failed = False
for name in ttFont['name'].names:
if (name.nameID == NameID.DESCRIPTION and
len(name.string.decode(name.getEncoding())) > 200):
failed = True... | python | def com_google_fonts_check_name_description_max_length(ttFont):
"""Description strings in the name table must not exceed 200 characters."""
failed = False
for name in ttFont['name'].names:
if (name.nameID == NameID.DESCRIPTION and
len(name.string.decode(name.getEncoding())) > 200):
failed = True... | [
"def",
"com_google_fonts_check_name_description_max_length",
"(",
"ttFont",
")",
":",
"failed",
"=",
"False",
"for",
"name",
"in",
"ttFont",
"[",
"'name'",
"]",
".",
"names",
":",
"if",
"(",
"name",
".",
"nameID",
"==",
"NameID",
".",
"DESCRIPTION",
"and",
"... | Description strings in the name table must not exceed 200 characters. | [
"Description",
"strings",
"in",
"the",
"name",
"table",
"must",
"not",
"exceed",
"200",
"characters",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L935-L954 |
9,792 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_hinting_impact | def com_google_fonts_check_hinting_impact(font, ttfautohint_stats):
"""Show hinting filesize impact.
Current implementation simply logs useful info
but there's no fail scenario for this checker."""
hinted = ttfautohint_stats["hinted_size"]
dehinted = ttfautohint_stats["dehinted_size"]
increase = hin... | python | def com_google_fonts_check_hinting_impact(font, ttfautohint_stats):
"""Show hinting filesize impact.
Current implementation simply logs useful info
but there's no fail scenario for this checker."""
hinted = ttfautohint_stats["hinted_size"]
dehinted = ttfautohint_stats["dehinted_size"]
increase = hin... | [
"def",
"com_google_fonts_check_hinting_impact",
"(",
"font",
",",
"ttfautohint_stats",
")",
":",
"hinted",
"=",
"ttfautohint_stats",
"[",
"\"hinted_size\"",
"]",
"dehinted",
"=",
"ttfautohint_stats",
"[",
"\"dehinted_size\"",
"]",
"increase",
"=",
"hinted",
"-",
"dehi... | Show hinting filesize impact.
Current implementation simply logs useful info
but there's no fail scenario for this checker. | [
"Show",
"hinting",
"filesize",
"impact",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L982-L1012 |
9,793 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_version_format | def com_google_fonts_check_name_version_format(ttFont):
"""Version format is correct in 'name' table?"""
from fontbakery.utils import get_name_entry_strings
import re
def is_valid_version_format(value):
return re.match(r'Version\s0*[1-9]+\.\d+', value)
failed = False
version_entries = get_name_entry_st... | python | def com_google_fonts_check_name_version_format(ttFont):
"""Version format is correct in 'name' table?"""
from fontbakery.utils import get_name_entry_strings
import re
def is_valid_version_format(value):
return re.match(r'Version\s0*[1-9]+\.\d+', value)
failed = False
version_entries = get_name_entry_st... | [
"def",
"com_google_fonts_check_name_version_format",
"(",
"ttFont",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"import",
"re",
"def",
"is_valid_version_format",
"(",
"value",
")",
":",
"return",
"re",
".",
"match",
"(",
"r'Vers... | Version format is correct in 'name' table? | [
"Version",
"format",
"is",
"correct",
"in",
"name",
"table?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1018-L1043 |
9,794 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_has_ttfautohint_params | def com_google_fonts_check_has_ttfautohint_params(ttFont):
""" Font has ttfautohint params? """
from fontbakery.utils import get_name_entry_strings
def ttfautohint_version(value):
# example string:
#'Version 1.000; ttfautohint (v0.93) -l 8 -r 50 -G 200 -x 14 -w "G"
import re
results = re.search(r... | python | def com_google_fonts_check_has_ttfautohint_params(ttFont):
""" Font has ttfautohint params? """
from fontbakery.utils import get_name_entry_strings
def ttfautohint_version(value):
# example string:
#'Version 1.000; ttfautohint (v0.93) -l 8 -r 50 -G 200 -x 14 -w "G"
import re
results = re.search(r... | [
"def",
"com_google_fonts_check_has_ttfautohint_params",
"(",
"ttFont",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"def",
"ttfautohint_version",
"(",
"value",
")",
":",
"# example string:",
"#'Version 1.000; ttfautohint (v0.93) -l 8 -r 50 -... | Font has ttfautohint params? | [
"Font",
"has",
"ttfautohint",
"params?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1049-L1075 |
9,795 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_old_ttfautohint | def com_google_fonts_check_old_ttfautohint(ttFont, ttfautohint_stats):
"""Font has old ttfautohint applied?
1. find which version was used, by inspecting name table entries
2. find which version of ttfautohint is installed
"""
from fontbakery.utils import get_name_entry_strings
def ttfautohint_vers... | python | def com_google_fonts_check_old_ttfautohint(ttFont, ttfautohint_stats):
"""Font has old ttfautohint applied?
1. find which version was used, by inspecting name table entries
2. find which version of ttfautohint is installed
"""
from fontbakery.utils import get_name_entry_strings
def ttfautohint_vers... | [
"def",
"com_google_fonts_check_old_ttfautohint",
"(",
"ttFont",
",",
"ttfautohint_stats",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"def",
"ttfautohint_version",
"(",
"values",
")",
":",
"import",
"re",
"for",
"value",
"in",
"... | Font has old ttfautohint applied?
1. find which version was used, by inspecting name table entries
2. find which version of ttfautohint is installed | [
"Font",
"has",
"old",
"ttfautohint",
"applied?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1082-L1137 |
9,796 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_gasp | def com_google_fonts_check_gasp(ttFont):
"""Is 'gasp' table set to optimize rendering?"""
if "gasp" not in ttFont.keys():
yield FAIL, ("Font is missing the 'gasp' table."
" Try exporting the font with autohinting enabled.")
else:
if not isinstance(ttFont["gasp"].gaspRange, dict):
y... | python | def com_google_fonts_check_gasp(ttFont):
"""Is 'gasp' table set to optimize rendering?"""
if "gasp" not in ttFont.keys():
yield FAIL, ("Font is missing the 'gasp' table."
" Try exporting the font with autohinting enabled.")
else:
if not isinstance(ttFont["gasp"].gaspRange, dict):
y... | [
"def",
"com_google_fonts_check_gasp",
"(",
"ttFont",
")",
":",
"if",
"\"gasp\"",
"not",
"in",
"ttFont",
".",
"keys",
"(",
")",
":",
"yield",
"FAIL",
",",
"(",
"\"Font is missing the 'gasp' table.\"",
"\" Try exporting the font with autohinting enabled.\"",
")",
"else",
... | Is 'gasp' table set to optimize rendering? | [
"Is",
"gasp",
"table",
"set",
"to",
"optimize",
"rendering?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1185-L1234 |
9,797 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_familyname_first_char | def com_google_fonts_check_name_familyname_first_char(ttFont):
"""Make sure family name does not begin with a digit.
Font family names which start with a numeral are often not
discoverable in Windows applications.
"""
from fontbakery.utils import get_name_entry_strings
failed = False
for familyname... | python | def com_google_fonts_check_name_familyname_first_char(ttFont):
"""Make sure family name does not begin with a digit.
Font family names which start with a numeral are often not
discoverable in Windows applications.
"""
from fontbakery.utils import get_name_entry_strings
failed = False
for familyname... | [
"def",
"com_google_fonts_check_name_familyname_first_char",
"(",
"ttFont",
")",
":",
"from",
"fontbakery",
".",
"utils",
"import",
"get_name_entry_strings",
"failed",
"=",
"False",
"for",
"familyname",
"in",
"get_name_entry_strings",
"(",
"ttFont",
",",
"NameID",
".",
... | Make sure family name does not begin with a digit.
Font family names which start with a numeral are often not
discoverable in Windows applications. | [
"Make",
"sure",
"family",
"name",
"does",
"not",
"begin",
"with",
"a",
"digit",
"."
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1240-L1255 |
9,798 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_currency_chars | def com_google_fonts_check_currency_chars(ttFont):
"""Font has all expected currency sign characters?"""
def font_has_char(ttFont, codepoint):
for subtable in ttFont['cmap'].tables:
if codepoint in subtable.cmap:
return True
#otherwise
return False
failed = False
OPTIONAL = {
#T... | python | def com_google_fonts_check_currency_chars(ttFont):
"""Font has all expected currency sign characters?"""
def font_has_char(ttFont, codepoint):
for subtable in ttFont['cmap'].tables:
if codepoint in subtable.cmap:
return True
#otherwise
return False
failed = False
OPTIONAL = {
#T... | [
"def",
"com_google_fonts_check_currency_chars",
"(",
"ttFont",
")",
":",
"def",
"font_has_char",
"(",
"ttFont",
",",
"codepoint",
")",
":",
"for",
"subtable",
"in",
"ttFont",
"[",
"'cmap'",
"]",
".",
"tables",
":",
"if",
"codepoint",
"in",
"subtable",
".",
"... | Font has all expected currency sign characters? | [
"Font",
"has",
"all",
"expected",
"currency",
"sign",
"characters?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1262-L1293 |
9,799 | googlefonts/fontbakery | Lib/fontbakery/profiles/googlefonts.py | com_google_fonts_check_name_ascii_only_entries | def com_google_fonts_check_name_ascii_only_entries(ttFont):
"""Are there non-ASCII characters in ASCII-only NAME table entries?"""
bad_entries = []
for name in ttFont["name"].names:
if name.nameID == NameID.COPYRIGHT_NOTICE or \
name.nameID == NameID.POSTSCRIPT_NAME:
string = name.string.decode(n... | python | def com_google_fonts_check_name_ascii_only_entries(ttFont):
"""Are there non-ASCII characters in ASCII-only NAME table entries?"""
bad_entries = []
for name in ttFont["name"].names:
if name.nameID == NameID.COPYRIGHT_NOTICE or \
name.nameID == NameID.POSTSCRIPT_NAME:
string = name.string.decode(n... | [
"def",
"com_google_fonts_check_name_ascii_only_entries",
"(",
"ttFont",
")",
":",
"bad_entries",
"=",
"[",
"]",
"for",
"name",
"in",
"ttFont",
"[",
"\"name\"",
"]",
".",
"names",
":",
"if",
"name",
".",
"nameID",
"==",
"NameID",
".",
"COPYRIGHT_NOTICE",
"or",
... | Are there non-ASCII characters in ASCII-only NAME table entries? | [
"Are",
"there",
"non",
"-",
"ASCII",
"characters",
"in",
"ASCII",
"-",
"only",
"NAME",
"table",
"entries?"
] | b355aea2e619a4477769e060d24c32448aa65399 | https://github.com/googlefonts/fontbakery/blob/b355aea2e619a4477769e060d24c32448aa65399/Lib/fontbakery/profiles/googlefonts.py#L1313-L1337 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.