Skip to content

Commit

Permalink
make-xges: use 'fill:currentcolor' to set text colour
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenstridge committed Apr 9, 2021
1 parent ef9976e commit 13ef84a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions make-xges.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def add_webcams(self):
def _clean_shape(self, shape):
# Shapes are hidden by default, as the JavaScript player would
# make the visible as appropriate.
shape.set('style', shape.get('style').replace('visibility:hidden;', ''))
style = shape.get('style').replace('visibility:hidden;', '')

# Add an SVG <text> fallback to text shapes
switch = shape.find('./{http://www.w3.org/2000/svg}switch')
Expand All @@ -198,10 +198,12 @@ def _clean_shape(self, shape):
tspan.text = line
text.append(tspan)

shape.set('style', shape.get('style').replace('color:', 'fill:'))
style += ';fill:currentcolor'.replace('color:', 'fill:')
shape.remove(switch)
shape.append(text)

shape.set('style', style)

def add_slides(self, with_annotations):
layer = self._add_layer('Slides')
doc = ET.parse(os.path.join(self.opts.basedir, 'shapes.svg'))
Expand Down

0 comments on commit 13ef84a

Please sign in to comment.