textWidth and html formmated text

Hi there,
I have trouble detecting width of html formatted text,
I am using textWidth property, but it looks like it gives width of default formatted text, not detecting html formating.

Is there some way to detect real width?