Generate "device independant" SVG on Windows

Hi,

I’m using the Graphviz library to generate SVG graphs in both a CLI and GUI application. On Windows, the CLI works fine. However, since enabling DPI awareness in the GUI manifest, the dimensions of the generated SVG change based on the desktop scaling setting.

For example, with the same .dot input, at 100% scaling:

<svg width="490pt" height="655pt" viewBox="0.00 0.00 490.00 654.93" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><script xmlns=""/>
...

And at 200% scaling:

<svg width="914pt" height="992pt" viewBox="0.00 0.00 914.00 991.86" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><script xmlns=""/>
...

Is there a way to prevent this behavior?

Not convinced I understand the issue, but maybe one of these will help:

  • add size=N, (where N in inches) to set graph display size
  • try -Tsvg:cairo on the command line (it will use a different svg renderer) (see Command Line | Graphviz)

Thanks!

Cairo renderer output is more consistent. Now I have to rebuild my graphviz plugin with this renderer.