<div dir="ltr">Forgive my ignorance, but it seems like Philip's suggestion (<a href="http://tug.org/pipermail/texhax/2008-September/010964.html">http://tug.org/pipermail/texhax/2008-September/010964.html</a>) gives a way to get a compact pdf file for a given text (or equation) string, and that your suggestion is to do this procedure for each character, and then compute the dimensions of each resulting image as the bounding box for the respective character. But that is not what I want at all!<br>
<br>Following the above procedure would give me the dimensions that each character requires *in isolation*. Working with my previous example, if my text is $y = x ^2$, I want the coordinates (not the dimensions!) of the bounding boxes of the individual characters ("y", "=", etc.) as they would occur when rendered within the whole $y=x^2$ string. <br>
<br>Consider the image obtained from rendering $y=x^2$. Imagine a 2D coordinate system on this image with the origin at the bottom left of the image, its x axis ranging from 0 to the width of the image and its y-axis ranging from 0 to the height of the image. I'd like output in the form of a set of tuples (left, top, right, bottom) for each of the 4 characters in the y=x^2 example, and the resulting bbox coordinates of "y" should reflect, for instance, that its "left" field is smaller in value than, say, that of the "=" character which is placed to the right of "y" when rendered in the image. So I'm essentially looking the intermediate results after the procedure that decides where exactly the characters are to be placed in the image of $y=x^2$.<br>
<br>And no, these values cannot be obtained by simply using the bounding box dimensions of the characters rendered in isolation. For instance the dimensions of the "2" would be much larger when rendered in isolation as $2$, than when it appears as a superscript to "x" in $y=x^2$.<br>
<br>Hope that makes the problem a little clearer. Suggestions? Thanks!<br>~R<br><br><br><br><br><div class="gmail_quote">On Wed, Sep 24, 2008 at 8:09 AM, William Adams <span dir="ltr"><<a href="mailto:will.adams@frycomm.com">will.adams@frycomm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Sep 24, 2008, at 10:35 AM, Ranjith Unnikrishnan wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
My intention is *not* to get one bounding box for all the characters together, but to get the bounding box coordinates of *each* character in the input text. So if the text I want to render is "$y = x^2$", I'd like to be able to obtain the bbox coordinates of "y", "=", "x" and "2".<br>
</blockquote>
<br>
<br></div>
Then put each character into a box and measure each box.<br>
<br>
See Philip Taylor's response in the ``compile to a small pdf'' thread for a code sample which can be adapted to single characters.<div><div></div><div class="Wj3C7c"><br>
<br>
William<br>
<br>
-- <br>
William Adams<br>
senior graphic designer<br>
Fry Communications<br>
<br>
<br>
</div></div></blockquote></div><br></div>