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

Local fontsize renders inconsistentl on diffrent backends #243

Closed
jeffreyrosenbluth opened this issue Mar 23, 2015 · 7 comments
Closed

Local fontsize renders inconsistentl on diffrent backends #243

jeffreyrosenbluth opened this issue Mar 23, 2015 · 7 comments

Comments

@jeffreyrosenbluth
Copy link
Member

Local font scaling on svg, cairo, rasterific and canvas produced different results.
rasterific and canvas are similar.

eff = text "F" <> square 1

 example = hcat
   [eff, eff # scale 2, eff # scaleX 2, eff # scaleY 2, eff # rotateBy (1/12)]
         # fontSize (Local 1)
@cchalmers
Copy link
Member

I'm getting reasonably consistent results:

svg
svg

rasterific
rasterific

pgf
pgf

html5
html5

Note that the fontSize (local 1) doesn't have the scales applied because it's applied after the transforms (I think this is different from old behaviour). If the font size is transformed too I get these:

svg
svg

rasterific
rasterific

pgf
pgf

html5
html5

I haven't got Cairo installed here so I haven't tested it. What are you seeing?

@cchalmers
Copy link
Member

Sorry, I'm blind -- SVG is clearly wrong. I even made an issue about it diagrams/diagrams-svg#66. I think it has something to do with the weird way SVG handles font-size precedence. I didn't look at it properly.

@jeffreyrosenbluth
Copy link
Member Author

Ah, I didn't realize the semantics changed. Thanks for putting together this comparison.
So the only thing broken is diagrams-svg. I guess we should change the user manual example to

eff = text "F" <> square 1 # fontSize (Local 1)
 example = hcat
   [eff, eff # scale 2, eff # scaleX 2, eff # scaleY 2, eff # rotateBy (1/12)]

@cchalmers
Copy link
Member

In you're example you're only changing the font size of the square :)

Note that the default font size is local 1 anyway, but it seems like a good idea to make it explicit in case it ever changes.

@byorgey
Copy link
Member

byorgey commented Mar 23, 2015

Aha, I was confused, thanks all!

On 5:25am, Mon, Mar 23, 2015 Chris notifications@github.com wrote:

In you're example you're only changing the font size of the square :)

Note that the default font size is local 1 anyway, but it seems like a
good idea to make it explicit in case it ever changes.


Reply to this email directly or view it on GitHub
#243 (comment)
.

@jeffreyrosenbluth
Copy link
Member Author

Still not sure his is correct. What should this look like?

eff = text "F" <> square 1 # fontSize (Normalized 0.1)
 example = hcat
   [eff, eff # scale 2, eff # scaleX 2, eff # scaleY 2, eff # rotateBy (1/12)]

@jeffreyrosenbluth
Copy link
Member Author

Never mind, I was missing the parenthesis.
eff = (text "F" <> square 1) # fontSize (Normalized 0.1)

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

No branches or pull requests

3 participants