Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to SVG text paint-order = "stroke" #217

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Merge branch 'master' into patch-3
  • Loading branch information
aziesemer authored Nov 26, 2018
commit bf35c0b1f75ca32242a8bc1824ab336a9d4fe8a8
15 changes: 8 additions & 7 deletions cairosvg/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,12 @@ def draw(self, node):
cairo.FILL_RULE_EVEN_ODD)
self.context.set_source_rgba(
*color(paint_color, fill_opacity))
if i == order[1]:
self.context.fill()
else:
if TAGS[node.tag] == text:
self.cursor_position = save_cursor[0]
self.cursor_d_position = save_cursor[1]
self.text_path_width = save_cursor[2]
text(self, node, draw_as_text=True)
else:
self.context.fill_preserve()
self.context.restore()
else:
Expand All @@ -447,11 +450,9 @@ def draw(self, node):
if not gradient_or_pattern(self, node, paint_source):
self.context.set_source_rgba(
*color(paint_color, stroke_opacity))
if i == order[1]:
self.context.stroke()
else:
self.context.stroke_preserve()
self.context.stroke_preserve()
self.context.restore()
self.context.new_path()
elif not visible:
self.context.new_path()

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.