Rollup merge of #76794 - richkadel:graphviz-font, r=ecstatic-morse
Make graphviz font configurable Alternative to PR #76776. To change the graphviz output to use an alternative `fontname` value, add a command line option like: `rustc --graphviz-font=monospace`. r? @ecstatic-morse
This commit is contained in:
commit
3bf66ae25f
5 changed files with 22 additions and 11 deletions
|
@ -306,7 +306,8 @@ where
|
|||
let mut buf = Vec::new();
|
||||
|
||||
let graphviz = graphviz::Formatter::new(body, def_id, results, style);
|
||||
let mut render_opts = vec![dot::RenderOption::Monospace];
|
||||
let mut render_opts =
|
||||
vec![dot::RenderOption::Fontname(tcx.sess.opts.debugging_opts.graphviz_font.clone())];
|
||||
if tcx.sess.opts.debugging_opts.graphviz_dark_mode {
|
||||
render_opts.push(dot::RenderOption::DarkTheme);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ where
|
|||
writeln!(w, "{} {}Mir_{} {{", kind, cluster, def_name)?;
|
||||
|
||||
// Global graph properties
|
||||
let font = r#"fontname="Courier, monospace""#;
|
||||
let mut graph_attrs = vec![font];
|
||||
let mut content_attrs = vec![font];
|
||||
let font = format!(r#"fontname="{}""#, tcx.sess.opts.debugging_opts.graphviz_font);
|
||||
let mut graph_attrs = vec![&font[..]];
|
||||
let mut content_attrs = vec![&font[..]];
|
||||
|
||||
let dark_mode = tcx.sess.opts.debugging_opts.graphviz_dark_mode;
|
||||
if dark_mode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue