Problem w/ TIG and Arial font w/ underline attributes

I have been using the TIG w/ decent success on a Windows machine w/ a DPI of 120.
I am having some problems w/ the standard Windows DPI of 96, but that is not the main point of this email.

Regardless of the font DPI, there are problems w/ the TIG when using underlined characters (especially bold) on even “simple” fonts such as Arial.

  1. Depending on the font size, when a character is underlined, part of the character may extend in to the underline. Example:p and y The extent of a “p” or “y” in a TIG image seems to be slightly different from what is actually in Windows (specifically, in IE). This causes TIG to fail to find the text, even w/ Tollerance set to 100.

  2. TIG scaled the height of the underline relative to the size of the font. This does not work well w/ IE hyperlinks. Unless a page specifies otherwise, IE almost always underlines a hyperlink w/ a single line, no matter of its bold or normal, H1 or H6. This causes TIG to fail to find the text, even w/ Tollerance set to 100.

#1 and #2 combined means that I cannot find a way to use TIG to find IE hyperlinks of text that is either bold or has characters that extend in to the underline.

Unfortunately the product I work on must support IE.

I could try to define a cliprect, but that would have to be discovered for each text and might be difficult to make reliable.

Would Redstone be willing to provide a new search option for the TIG search to make it work better w/ underlined fonts?

Hyperlink underlines are typically NOT rendered through the font rasterizer but are drawn in as graphics making them very difficult to match with a generated underlined text image. Therefore, it is best if you do NOT use the underline property to generate hyperlink text that is underlined.

Also, if you are scripting against IE7 make sure that you enable clear type font smoothing for your system. You should be able to specify this in the display settings for your system. IE7 uses the clear type setting for text.


I will also play with removing IE hyperlink underlines on the system via:
Tools->Options->Advanced->Browsing->Underline Links->Never

I may have to do the same w/ Firefox and other browsers.
It is unfortunate that this work around is needed.


FYI: I fixed the 120/96 DPI problem by trying fractional font sizes.
In 120 DPI, I could find the correct text by specifying a size 10 font.
In 96 DPI I could not find the text in either …, 8, 9, 10, 11…
I had the epihany to try 8.0, 8.5, 9.0, 9.5…and I got a hit on 9.5!

So, if you can’t find your text, try fractional font sizes!