Fix svg text alignment for "middle"
See https://stackoverflow.com/questions/19212498/firefox-support-for-alignment-baseline-property/21373135#21373135
This commit is contained in:
parent
4a339a31db
commit
ec0d24efd2
|
@ -361,10 +361,10 @@ class Boxes:
|
|||
self.ctx.rectangle(0, 0, self.reference, 10)
|
||||
if self.reference < 40:
|
||||
self.text("%.fmm" % self.reference, self.reference + 5, 5,
|
||||
align="middle left")
|
||||
align="middle left", fontsize=8, color=Color.ETCHING)
|
||||
else:
|
||||
self.text("%.fmm" % self.reference, self.reference / 2.0, 5,
|
||||
align="middle center")
|
||||
align="middle center", fontsize=8, color=Color.ETCHING)
|
||||
self.move(10, 10, "up")
|
||||
self.ctx.stroke()
|
||||
|
||||
|
|
|
@ -546,7 +546,7 @@ Creation date: {date}
|
|||
t.text = text
|
||||
t.set("font-size", f"{params['fs']}px")
|
||||
t.set("text-anchor", params.get('align', 'left'))
|
||||
t.set("alignment-baseline", 'hanging')
|
||||
t.set("dominant-baseline", 'hanging')
|
||||
else:
|
||||
print("Unknown", c)
|
||||
|
||||
|
|
Loading…
Reference in New Issue