How long is my SVG element?
SVG layout requires that the developer be in control of the dimensions of the objects that must be placed in the coordinate space. It is easy to specify (or compute based on other specifications) the size (bounding box height and width) of many SVG objects (e.g., rectangles, circles, lines), but identifying the bounding box for text is challenging because SVG text does not know its own length. In this report we explore two methods for working around this limitation. The first method, implemented in XSLT, consults exported font metrics to determine the length of SVG <text> elements and uses that information to make layout decisions as the SVG is created. The second method, implemented in JavaScript, determines the length of SVG <text> objects as the SVG is rendered in a browser and uses the information to control the layout at rendering time.