-
-
Notifications
You must be signed in to change notification settings - Fork 224
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 cut off in Mermaid #1345
Comments
By default, Mermaid is using the following font: |
Probably related to mermaid-js/mermaid#1540 |
For reference, here's how the font looks on the container: As you can see, the font rendering is different and text is not cut off. |
Mermaid could use something like https://github.com/danmarshall/google-font-to-svg-path which relies on https://maker.js.org/ to convert all text to SVG path that would be neat! |
I did some tests and unfortunately each solution has drawbacks. |
I encountered this too! Would be great to have it fixed :) on mermaid.live and here on github it works correct. Anyway great tool! |
It's the same issue. |
Given that font is a configureable option in Mermaid.js would you consider making it an option which can be passed to Kroki? |
The problem is that the font might or might not exist server-side and might or might not render the same server-side. For now, the best workaround is to use a font that displays as uniformly as possible across all operating systems and web browsers. |
Yeah I absolutely agree, but the question is who decides what font to use? Do we wait for mermaid to fix it? Does Kroki set a default you believe is best? Should the Kroki docker image have the mermaid default font installed into it? Should the end user be able to provide an override font (assuming it is available)? We self-host Kroki so we don't really care which option is chosen, but we would like to fix it sooner rather than later if possible. Ultimately it's your project and we will defer to your preferred approach here. |
A workaround for us is to tweak the margin settings for generated mermaid diagrams in https://github.com/yuzutech/kroki/blob/main/mermaid/src/task.js. Within
This probably still might not work for some fonts, though. |
Large Mermaid diagrams have parts that get cut off when generated as SVG.
This example diagram from Mermaid causes issues
The text was updated successfully, but these errors were encountered: