![](https://secure.gravatar.com/avatar/43d614f0b85861515f7ca51380433c9c.jpg?s=120&d=mm&r=g)
What objects/methods would one extract the list of character widths (kerns?) for a text string starting from its Style? Basically what I'm looking for is just the widths in pixels along the line for each character in the string. Here is an example pulled out of an EMF made on Windows:
One line of Arial (45 px)
had widths
700,501,501,250,200,200,501,501,250,501,250,250,600,300,200,501,200,250,300,501,501,250,501,450,300
(That is, "l" and "i" are width 200, "O" is 700.)
In this example those widths were determined by GDI subsequent to a TextOutW() call with the string. That method won't work for the EMF implementation I'm working on for Linux/Mac because there the "graphics device context" doesn't actually have anything like a rendering of the object, so the information must be provided by Inkscape (and ExtTextOutW used instead of TextOutW).
Alternatively, since the font height, weight, and face are known, something like this would work as well:
width_of_char('l',"bold","Arial",45); // returns 200, as per example above
where 45 is the font height and the rest is self explanatory. Except I have no idea what function this would be either.
Thanks,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech