Skip to content

Commit

Permalink
Merge pull request #95 from BlackFoundryCom/fix-issue93
Browse files Browse the repository at this point in the history
Fix for issue #93: reverse application order of transform and clip path
  • Loading branch information
justvanrossum authored Jun 9, 2022
2 parents 8ff8b36 + 2e05cca commit 5538aab
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/blackrenderer/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ def _ensureClipAndPushPath(self, canvas, path):
self.currentPath = path
self.currentTransform = Identity
with canvas.savedState():
if currentTransform != Identity:
canvas.transform(currentTransform)
if currentPath is not None:
canvas.clipPath(currentPath)
if currentTransform != Identity:
canvas.transform(currentTransform)
yield
self.currentPath = currentPath
self.currentTransform = currentTransform
Expand Down
Binary file added Tests/data/nested-paintglyph.ttf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Tests/expectedOutput/glyph_nested_paintglyph_A_svg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Tests/test_glyph_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"twemoji": dataDir / "TwemojiMozilla.subset.default.3299.ttf",
"more_samples": dataDir / "more_samples-glyf_colr_1.ttf",
"crash": dataDir / "crash.subset.otf",
"nested_paintglyph": dataDir / "nested-paintglyph.ttf",
}


Expand Down Expand Up @@ -91,6 +92,7 @@
("more_samples", "skew_25_0_center_500.0_500.0", None),
("more_samples", "skew_0_15_center_0_0", None),
("more_samples", "upem_box_glyph", None),
("nested_paintglyph", "A", None),
]


Expand Down

0 comments on commit 5538aab

Please sign in to comment.