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

Font size not applied properly in composite diagram #66

Closed
cchalmers opened this issue Nov 16, 2014 · 2 comments · Fixed by #74
Closed

Font size not applied properly in composite diagram #66

cchalmers opened this issue Nov 16, 2014 · 2 comments · Fixed by #74
Labels

Comments

@cchalmers
Copy link
Member

Applying fontSize to a composite diagram doesn't render properly:

rightSize = square 3 <> text "hi" # fontSizeL 2
wrongSize = (square 3 <> text "hi") # fontSizeL 2

Inspecting the SVG output shows the correct size is applied in an outer group but the Recommended size is used in an inner group and that's what gets shown. I suspect this is from the recent changes to Measure. It doesn't happen in the rasterific or pgf backends.

@cchalmers
Copy link
Member Author

On a related issue, certain attributes are being output several times even though they're identical. Here's the gradient example from the tutorial: http://lpaste.net/129623. Each gradient is defined an applied 3 times even though they're identical.

I think if we accumulate the style in the state and only apply the style when it's used, like the other backends, both these issues should be fixed.

@jeffreyrosenbluth
Copy link
Member

The reason that the SVG backend doesn't accumulate styles using the state stack is probably a bit of a historical accident. When i switched to an RTree instead of a list of primitives one of the first things i did was to port the svg backend. Hence the RTree based backend probably inherited these redundancies from the list based backend. This was before byorgey designed the state stack to convert the cairo backend. It's probably worth looking into @cchalmers suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants