This is driving me nuts and I hope someone can point me in the right direction. Imagine the following picture:
[–A–][—-B—-]
[——-C——–]
where A, B and C are distances.
A is in pixels, C is in points.
I am trying to figure out the distance of B in points…
Well, obviously since A and C are in different units, C-A is not the answer.
A is a SPAN that contains text of different length, font face and font size so obviously it’s size varies. The clientWidth property of the span A always returns the value in pixels.
So, the answer is to convert pixels to points and then do my calculation. As I understand, I can get the current screen resolution from the browser but I can’t get dots per inch (DPI) making this calculation impossible(?)
So anyone have an idea? Thank you in advance.