Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

font-size flag in embedded stylesheet doesn't work #106

Description

@Knochi

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"))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions