Skip to content

Commit ef12e49

Browse files
authored
Address #837 and add in some more places where is better for optional values (#838)
1 parent 6d79818 commit ef12e49

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ build/*
1111
dist/*
1212
.eggs/
1313
.vscode
14+
*-venv/
1415

1516
documentation/build/*
1617
documentation/.sass-cache/*
@@ -22,4 +23,4 @@ doc/*
2223
htmlcov
2324

2425
# scm version
25-
Lib/fontParts/_version.py
26+
Lib/fontParts/_version.py

Lib/fontParts/base/glyph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ def _fromMathGlyph(self, mathGlyph, toThisGlyph=False, filterRedundantPoints=Tru
16961696
a = copied.appendAnchor(
16971697
name=anchor.get("name"),
16981698
position=(anchor["x"], anchor["y"]),
1699-
color=anchor["color"]
1699+
color=anchor.get("color")
17001700
)
17011701
identifier = anchor.get("identifier")
17021702
if identifier is not None:
@@ -1705,8 +1705,8 @@ def _fromMathGlyph(self, mathGlyph, toThisGlyph=False, filterRedundantPoints=Tru
17051705
g = copied.appendGuideline(
17061706
position=(guideline["x"], guideline["y"]),
17071707
angle=guideline["angle"],
1708-
name=guideline["name"],
1709-
color=guideline["color"]
1708+
name=guideline.get("name"),
1709+
color=guideline.get("color")
17101710
)
17111711
identifier = guideline.get("identifier")
17121712
if identifier is not None:

NEWS.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.12.7 (released 2025-05-30)
2+
---------------------------
3+
- Fix getting `color` and `name` in _fromMathGlyph`
4+
15
0.12.6 (released 2025-05-27)
26
---------------------------
37
- Fix guideline normalization when value is `None`. See #834. Thanks @typemytype!

0 commit comments

Comments
 (0)