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`.
This commit is contained in:
Rich Kadel
2020-09-16 08:10:06 -07:00
parent f7aee330c7
commit 5c29332ace
4 changed files with 17 additions and 11 deletions

View File

@@ -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 {