Number: 1351
Title: Incorrect units in SVG width and height
Submitter: Tom Moore
Date: Wed May 7 11:00:24 2008
Subsys: Dot
Version: 2.8
System: *-*-*
Severity: minor
Problem:
The generator for SVG output creates the following element:

  <svg width="330pt" height="290pt"
    viewBox = "0 0 330 290"
 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

where the values for 330 and 290 depend on the size of the figure.

The problem is that the width and height values are in points, and the viewbox values are in pixels, so this causes the figure to be scaled with something other than 1:1. As a result, the rendered figure comes out larger than intended, and fonts are not in the requested size.

Removing the "pt" specifier from the width and height attributes seems to correct the problem.
Input:

It looks like this is quite generic and any input will cause this bug.
Fix:
It looks to me that just removing the "pt" specification from the code that generates the "svg" element will fix this bug.
Owner: *
Status: *