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

[SVG] consider setting stroke-width to 0 #2859

Open
pkra opened this issue Apr 4, 2022 · 2 comments
Open

[SVG] consider setting stroke-width to 0 #2859

pkra opened this issue Apr 4, 2022 · 2 comments
Labels
Milestone

Comments

@pkra
Copy link
Contributor

pkra commented Apr 4, 2022

https://github.com/mathjax/MathJax-src/blob/2dd53ce6c8af3c9cceba0baf014ea9b065130774/ts/output/svg/Wrappers/TextNode.ts#L49-L53

sets the stroke-width to 3. This leads to weird rendering in edge cases (e.g. using print-to-PDF the output will look extremely bold in most PDF readers even if it will print fine).

I recall we discussed this for v2 ages ago and I think the original reason was to cover for flaky SVG rendering in old browser engines.

We've been using 0 in production for years now (in v2) and I just noticed that I had missed this declaration when we switched to v3 last year.

Running a small random sample through visual regression testing, it looks like switching to 0 can affect some stretchy constructions (for the better - they come out a hair thinner especially which improves where they connect with non-stretchy pieces). I didn't test ancient or dead browser engines but I used to test down to IE9 so I'm relatively certain this won't cause significant problems.

@pkra
Copy link
Contributor Author

pkra commented Apr 4, 2022

Feel free to close this if you would rather not - after all, it's easy for people to override this via CSS.

@dpvc
Copy link
Member

dpvc commented Feb 22, 2023

I've made a PR for this feature.

dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 3, 2023
Allow SVG character stroke-width to be specified. (mathjax/MathJax#2859)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants