mirror of
https://github.com/google/fonts.git
synced 2024-11-28 02:17:11 +03:00
remove preprocessing of fallback names
and simplify API usage.
This commit is contained in:
parent
997e558dfe
commit
a2b0d67270
@ -1,5 +1,8 @@
|
|||||||
Below are the most important changes from each release.
|
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)
|
## 0.1.1 (2022-Mar-14)
|
||||||
- Fix typos on cursive and monospace axes descriptions.
|
- Fix typos on cursive and monospace axes descriptions.
|
||||||
- Remove space characteres from fallback name entries of all axes. (issue #7)
|
- Remove space characteres from fallback name entries of all axes. (issue #7)
|
||||||
|
@ -19,11 +19,8 @@ def AxisRegistry():
|
|||||||
return message
|
return message
|
||||||
|
|
||||||
def append_AxisMessage(path):
|
def append_AxisMessage(path):
|
||||||
axis_dict = {"message": get_Protobuf_Message(AxisProto, path),
|
axis = get_Protobuf_Message(AxisProto, path)
|
||||||
"fallbacks": {}}
|
registry[axis.tag] = axis # pylint: disable=E1101
|
||||||
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
|
|
||||||
|
|
||||||
for axis in ["casual.textproto",
|
for axis in ["casual.textproto",
|
||||||
"cursive.textproto",
|
"cursive.textproto",
|
||||||
|
@ -4,12 +4,10 @@ from axisregistry import AxisRegistry
|
|||||||
def test_AxisRegistry():
|
def test_AxisRegistry():
|
||||||
registry = AxisRegistry()
|
registry = AxisRegistry()
|
||||||
assert 'GRAD' in registry.keys()
|
assert 'GRAD' in registry.keys()
|
||||||
assert 'message' in registry['GRAD']
|
|
||||||
assert 'fallbacks' in registry['GRAD']
|
|
||||||
for axis_tag in registry.keys():
|
for axis_tag in registry.keys():
|
||||||
assert len(axis_tag) == 4
|
assert len(axis_tag) == 4
|
||||||
for f in range(len(registry[axis_tag]["message"].fallback)):
|
for f in range(len(registry[axis_tag].fallback)):
|
||||||
fallback = registry[axis_tag]["message"].fallback[f]
|
fallback = registry[axis_tag].fallback[f]
|
||||||
|
|
||||||
# fallback names should not be space-separated.
|
# fallback names should not be space-separated.
|
||||||
# (see: https://github.com/googlefonts/axisregistry/issues/7)
|
# (see: https://github.com/googlefonts/axisregistry/issues/7)
|
||||||
|
Loading…
Reference in New Issue
Block a user