jonhoo / inferno

A Rust port of FlameGraph
Other
1.65k stars 118 forks source link

Not possible to set font in flamegraphs to default fonts #244

Closed itamarst closed 2 years ago

itamarst commented 2 years ago

In CSS I can do:

body {
     font-family: monospace;
}

but I can't do that with flamegraph, because it turns it into:

body {
     font-family: "monospace";
}

which means "the font called monospace" rather than "default monospace font".

jonhoo commented 2 years ago

Ah, yes, that happens here: https://github.com/jonhoo/inferno/blob/b8b2f0d9dfab6f85acc42f65a8504b6baab69848/src/flamegraph/svg.rs#L125

I think we just need to teach that code path about the "special" font names so that it doesn't escape those! I'd be happy to take a look at a PR :+1: