-
Notifications
You must be signed in to change notification settings - Fork 72
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
Incorrect rendering of texts in Pluto markdown cells #228
Comments
Hi! I have no idea what's going on here. :) Without specifying a font for With a suitable font selected, I see the correct character: So what's the default font used by Luxor/Cairo if you don't specify a font before using (By the way, Luxor/Cairo SVG-generation doesn't embed fonts or glyph numbers; it always conveys the glyphs to graphic paths, so there are no font-embedding issues (or benefits).) |
I do not think it is a fontface issue, I tried monospace, JuliaMono-Light, DejaVu et al. None of them works. |
Ah, have you got more than one SVG image in your notebook? |
Might be MakieOrg/Makie.jl#952 but for Pluto... |
Yes. It is likely to be the reason. But when I do not use svg in md environment. Everything looks fine. |
Is it possible to circumvent this issue? Because I need to layout the images. |
Sorry, I don't know enough about Pluto's Markdown and the use of expressions here. If you just use simple code cells the SVGs don't look like they interact badly: Similarly, if you return a variable holding the drawing, it seems to work OK too: Perhaps you could ask the Pluto folks to help? They know more about the interaction between the display system, Markdown, macros, and cells than I will ever do. :) |
Hi, @fonsp . We need your help. Do you know why svg generated by Luxor interact so badly with the markdown environment in Pluto? This is the code that you can reproduce the issue, but you probably need a linux system. UPDATE: I tried to debug by disabling cell by cell, it can fix the problem if I disable the previous svg plots, which confirms it is a svg cross talk problem. |
Now I am almost sure it is a glyph id problem. The following PR is an approach to fix, but it is a kind of dirty fix, which basically replaces the ids using regular expression. https://github.com/JuliaPlots/CairoMakie.jl/pull/163/files In a Pluto cell output, the Drawing is rendered as an |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey @GiggleLiu ! Pluto doesn't really have control over how the Markdown stdlib handles interpolation. In this case, the Markdown stdlib runs this function which writes the SVG contents directly as HTML output. You want it to do this, replacing You could open a PR to julialang/julia to use this method for svg images, or you could add an override into your notebook, or into Luxor.jl. Something like this should work: import Markdown
Markdown.tohtml(io::IO, img::Luxor.SVGDrawing) = # replace SVGDrawing with the actual name
print(io, """<img src="data:image/svg+xml;base64,""")
print(io, Markdown.stringmime(MIME"image/svg+xml"(), img))
print(io, "\" />")
end This method overload is not type piracy because it only dispatches on a type from Luxor.jl. |
The subscripts in the svg plots are not rendered properly in Pluto markdown.
The png format looks good, the directly display of svg is also good.
The text was updated successfully, but these errors were encountered: