So I'm making a photo frame designer. Instead of a fiddle have the website as it's so much easier. Here it is.
Basically on the text input it prints the text to the SVG frame which uses an embedded foreign object tag so I can access it's auto text wrap. The problem comes with the positioning of the text. When the words are on two lines the positioning is correct. However whilst on a single line, the text is too high. I need it to be center between the photo slots and the bottom of the frame. This can be done easily by adjusting the foreign object's "y" value. However this then causes the two line text to be two low and out of position. I have no idea how I can fix this. Perhaps jQuery or javascript? Thanks.
The code:
<foreignObject x="78" y="460" width="1100" height="220" style="color:white;text-align:center">
<body xmlns="http://www.w3.org/1999/xhtml">
<p id="text">Your words here</p>
</body>
</foreignObject>