Article ID: 244798 - View products that this article applies to.
This article was previously published under Q244798
This article has been archived. It is offered "as is" and will no longer be updated.
When a sequence of italic text is immediately followed by regular text, and if the placement of the text is not correct, the italic characters can overlap the other trailing text.
To resolve this issue, compensate for both the overhang of the trailing character of the first substring and for the underhang of the lead character of second substring. For TrueType fonts, use GetCharABCWidths to retrieve these values.
The sample code that follows outputs the string "fff" in italic text, and immediately follows it with the string "ggg" in regular (non-italic) text. If you do not compensate for the overhang and underhang values of the trailing italic character and leading non-italic character, these two substrings typically overlap.
For more information, visit the following MSDN Web sites:
Windows GDI - Fonts and Text
How to Fit Text in a Rectangle
Article ID: 244798 - Last Review: January 11, 2015 - Revision: 1.6