1
0
mirror of https://github.com/google/fonts.git synced 2024-11-24 09:43:46 +03:00

remove preprocessing of fallback names

and simplify API usage.
This commit is contained in:
Felipe Corrêa da Silva Sanches 2022-03-14 04:43:56 -03:00
parent 997e558dfe
commit a2b0d67270
3 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,8 @@
Below are the most important changes from each release.
## 0.2.0 (2022-Mar-14)
- Remove pre-processing of fallback names and simplify API
## 0.1.1 (2022-Mar-14)
- Fix typos on cursive and monospace axes descriptions.
- Remove space characteres from fallback name entries of all axes. (issue #7)

View File

@ -19,11 +19,8 @@ def AxisRegistry():
return message
def append_AxisMessage(path):
axis_dict = {"message": get_Protobuf_Message(AxisProto, path),
"fallbacks": {}}
for fb in axis_dict["message"].fallback: # pylint: disable=E1101
axis_dict["fallbacks"][fb.name] = fb.value
registry[axis_dict["message"].tag] = axis_dict # pylint: disable=E1101
axis = get_Protobuf_Message(AxisProto, path)
registry[axis.tag] = axis # pylint: disable=E1101
for axis in ["casual.textproto",
"cursive.textproto",

View File

@ -4,12 +4,10 @@ from axisregistry import AxisRegistry
def test_AxisRegistry():
registry = AxisRegistry()
assert 'GRAD' in registry.keys()
assert 'message' in registry['GRAD']
assert 'fallbacks' in registry['GRAD']
for axis_tag in registry.keys():
assert len(axis_tag) == 4
for f in range(len(registry[axis_tag]["message"].fallback)):
fallback = registry[axis_tag]["message"].fallback[f]
for f in range(len(registry[axis_tag].fallback)):
fallback = registry[axis_tag].fallback[f]
# fallback names should not be space-separated.
# (see: https://github.com/googlefonts/axisregistry/issues/7)