svgwrite icon indicating copy to clipboard operation
svgwrite copied to clipboard

font-size flag in embedded stylesheet doesn't work

Open Knochi opened this issue 4 years ago • 0 comments

So from the "using fonts" example i tried the embedded font. Changing the font-size doesn't effect the output.

import svgwrite

dwg = svgwrite.Drawing('font_embedded.svg', (800, 200), debug=True)
# font data has to be downloaded to the local file system
dwg.embed_font(name="Indie Flower", filename='fonts/IndieFlower-Regular.ttf')
dwg.embed_stylesheet("""
.flower14 {
    font-family: "Indie Flower";
    font-size: 14;
}
""")
# This should work stand alone and embedded in a website!
paragraph = dwg.add(dwg.g(class_="flower14", ))
paragraph.add(dwg.text("Font 'Indie Flower' embedded from local file system.", insert=(10, 40)))
dwg.save(pretty=True)

When i "override" the font-size with the style attribute it works

paragraph = dwg.add(dwg.g(class_="flower14", ))
paragraph.add(dwg.text("Font 'Indie Flower' embedded from local file system.", insert=(10, 40), style="font-size : 16"))

Knochi avatar Feb 16 '22 11:02 Knochi