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 appears to be 33% too big #72

Closed
Nicjmit opened this issue Sep 30, 2016 · 0 comments
Closed

Font size appears to be 33% too big #72

Nicjmit opened this issue Sep 30, 2016 · 0 comments

Comments

@Nicjmit
Copy link

Nicjmit commented Sep 30, 2016

Was getting overlapping text in a pretty simple legend from ggplot:

image

After a bit of playing with the svg I found if you replaced the pt sizes with px instead it produced correctly sized text.

So just made the two following changes to get the output I was expecting:

double svg_strwidth(const char *str, const pGEcontext gc, pDevDesc dd) {
  // ... the rest
  return fm.width;//formerly * 96 / 72;
}

inline void write_style_fontsize(SvgStreamPtr stream, double value, bool first = false) {
  if(!first)  (*stream) << ' ';
  (*stream) << "font-size: " << value << "px;"; //formerly pt
}
@hadley hadley closed this as completed in 799fe8e Oct 24, 2016
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

1 participant