-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Add -Zgraphviz_dark_mode and monospace font fix #76500
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
a16f025
to
c0c806f
Compare
@tmandry @wesleywiser ... FYI |
Many developers use a dark theme with editors and IDEs, but this typically doesn't extend to graphviz output. When I bring up a MIR graphviz document, the white background is strikingly bright. This new option changes the colors used for graphviz output to work better in dark-themed UIs.
c0c806f
to
c19b237
Compare
Note: I just realized how to fix the text width rendering issues (for example, see the attached image in the PR description). All of the VS Code extensions for graphviz rendering have this problem. I noticed one of the renderers credits Apparently the node size is computed by the graphviz engine, which has access to a different set of fonts than the renderer (such as Chromium or Firefox), so the I can change the Since this is changing the same lines I've already changed for the dark mode option, I'm going to add a commit to this PR with this proposed change as well (to avoid the merge conflicts likely to happen with separate PRs). |
VS code graphviz extensions use d3-graphviz, which supports `Courier` fontname but does not support `monospace`. This caused graphs to render poorly because the text sizes were wrong.
Nice, this is great :). Thanks!! @bors r+ rollup |
📌 Commit f7aee33 has been approved by |
Add -Zgraphviz_dark_mode and monospace font fix Many developers use a dark theme with editors and IDEs, but this typically doesn't extend to graphviz output. When I bring up a MIR graphviz document, the white background is strikingly bright. This new option changes the colors used for graphviz output to work better in dark-themed UIs. <img width="1305" alt="Screen Shot 2020-09-09 at 3 00 31 PM" src="https://user-images.githubusercontent.com/3827298/92659478-4b9bff00-f2ad-11ea-8894-b40d3a873cb9.png"> Also fixed the monospace font for common graphviz renders (e.g., VS Code extensions), as described in rust-lang#76500 (comment) **Before:** <img width="943" alt="Screen Shot 2020-09-09 at 2 48 44 PM" src="https://user-images.githubusercontent.com/3827298/92658939-47231680-f2ac-11ea-97ac-96727e4dd622.png"> **Now with fix:** <img width="943" alt="Screen Shot 2020-09-09 at 2 49 02 PM" src="https://user-images.githubusercontent.com/3827298/92658959-51451500-f2ac-11ea-9aae-de982d466d6a.png">
Rollup of 7 pull requests Successful merges: - rust-lang#74787 (Move `rustllvm` into `compiler/rustc_llvm`) - rust-lang#76458 (Add drain_filter method to HashMap and HashSet) - rust-lang#76472 (rustbuild: don't set PYTHON_EXECUTABLE and WITH_POLLY cmake vars since they are no longer supported by llvm) - rust-lang#76497 (Use intra-doc links in `core::ptr`) - rust-lang#76500 (Add -Zgraphviz_dark_mode and monospace font fix) - rust-lang#76543 (Document btree's unwrap_unchecked) - rust-lang#76556 (Revert rust-lang#76285) Failed merges: r? `@ghost`
Add -Zgraphviz_dark_mode and monospace font fix Many developers use a dark theme with editors and IDEs, but this typically doesn't extend to graphviz output. When I bring up a MIR graphviz document, the white background is strikingly bright. This new option changes the colors used for graphviz output to work better in dark-themed UIs. <img width="1305" alt="Screen Shot 2020-09-09 at 3 00 31 PM" src="https://user-images.githubusercontent.com/3827298/92659478-4b9bff00-f2ad-11ea-8894-b40d3a873cb9.png"> Also fixed the monospace font for common graphviz renders (e.g., VS Code extensions), as described in rust-lang/rust#76500 (comment) **Before:** <img width="943" alt="Screen Shot 2020-09-09 at 2 48 44 PM" src="https://user-images.githubusercontent.com/3827298/92658939-47231680-f2ac-11ea-97ac-96727e4dd622.png"> **Now with fix:** <img width="943" alt="Screen Shot 2020-09-09 at 2 49 02 PM" src="https://user-images.githubusercontent.com/3827298/92658959-51451500-f2ac-11ea-9aae-de982d466d6a.png">
Many developers use a dark theme with editors and IDEs, but this
typically doesn't extend to graphviz output.
When I bring up a MIR graphviz document, the white background is
strikingly bright. This new option changes the colors used for graphviz
output to work better in dark-themed UIs.
Also fixed the monospace font for common graphviz renders (e.g., VS Code extensions), as described in #76500 (comment)
Before:

Now with fix:
