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

Text is overlapping/improperly cropped #1532

Closed
JarredAllen opened this issue Apr 24, 2021 · 2 comments
Closed

Text is overlapping/improperly cropped #1532

JarredAllen opened this issue Apr 24, 2021 · 2 comments

Comments

@JarredAllen
Copy link
Contributor

JarredAllen commented Apr 24, 2021

When I try to make any plots in a jupyter notebook using Gadfly, or when I look at the documentation, the text on the plots is messed up. Text overlaps other text, and some text gets cropped out of the plot when it shouldn't be.

For example, here is what I see when I go to http://gadflyjl.org/stable/man/compositing/#Facets:
image
I'd guess that the x-axis label is supposed to be "SepalLength by Species", but the end is cropped out of the image, and the beginning overlaps with the y-axis label. Other text in the plot is similarly messed up.

If this is relevant, I'm using Firefox 87.0 on Ubuntu 20.04.

@Mattriks
Copy link
Member

Mattriks commented Apr 25, 2021

Chrome renders the text correctly, so this looks like a FF issue e.g. google "firefox svg text too big".
Compose.jl (the Graphics package underlying Gadfly) for svg uses unitless values ("user units" set by the viewBox) similar to the first example shown here. So font-size is unitless in svgs drawn by Compose.

You can test what FF is doing by creating a simple plot:

p = plot(x=1:5, y=rand(5), Geom.point)
draw(SVG("test1.svg"), p)

Open "test1.svg" in a text editor, and add e.g. font-size=3.88px on line 18, and open the svg file in FF. Are unitless font-sizes a problem for FF? Or is it an issue with minimum font size setting?

@JarredAllen
Copy link
Contributor Author

It was the minimum font size setting. It seems that firefox defaulted to having it be 12pt font (at least for me, since I'm pretty sure I hadn't touched the advanced font settings), which was messing up the rendering. I've disabled that setting and now it seems to work normally.

JarredAllen added a commit to JarredAllen/Gadfly.jl that referenced this issue Apr 26, 2021
Add note explaining that a minimum font size in your browser can cause improper text rendering (as happened to me in issue GiovineItalia#1532 the other day).

Hopefully this will help others avoid this pain point that I hit.
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

2 participants