Forum Moderators: open

Message Too Old, No Replies

VML and textbox

How to make width fit to text

         

Robert2

11:09 am on Jan 14, 2008 (gmt 0)

10+ Year Member



Hi,

I am thinking about creating a ruler in SVG and VML.
I am currently stuck in writing text in VML. The problem
is that I can't seem to create a textbox that has a width
dependent on the contents of the textbox.

Example:


<v:group id="vml" style="width: 100%; height:100%"
coordorigin="0,0"
coordsize="100,100">
<v:rect style="position: absolute; left: 20px; top: 20px; stroked="true">
<v:textbox style="border: 2px solid blue; font-size: 18pt;">TextBox&nbsp;Test</v:textbox>
</v:rect>
</v:group>

As you can see I use absolute positioning to position the text at
the correct position, but this absolute positioning causes the box to have a width of 0 pixels.

I have no way of knowing how big the textboxes should be beforehand. I saw that there is an
attribute mso-fit-shape-to-text, but this attribute seems to have no effect.

Any suggestions?
Or does someone know any already implemented ruler with generated text on it?
It could be commercial too.

cmarshall

2:10 pm on Jan 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's a good question. As I have no experience in VML, I can't answer it, but maybe someone else here can.

httpwebwitch

2:06 pm on Jan 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ditto here... you might try posting in Webmaster General to find someone else who knows VML