DrawText by default processes prefix characters in the manner you
describe. Unfortunately it does not support Fonts that have an
escapement(rotation) value greater than 0. Since TextOut cannot print a
line of Text with mixed attributes, I think you will have to break up
your string and print the strings before and after the character with
the desired underline. Unfortunately this is going to make it somewhat
difficult determining X,Y starting positions for the next string of
Anyhow, on my Web page is a Rotated Text ActiveX control for Microsoft
Access. It is written in VB6 and posted with source code. Rod Stephens
was kind enough to give me permission to use his example of trig
routines to calculate bounding rectangles of rotated text. You will need
this functionality of you try to print several seperate strings of
rotated text on the same angle.
Personally, I think it might be easier for you to render your rotated
text as one complete string. Then simply go back and draw a line under
the characters you want underlined.
It's really a shame, but understandable, that DrawText doesn't support
rotated fonts. The formatting capabilities of DrawText are obviously far
superior to plain jane TextOut.
Good luck .
> I'm looking to draw a string onto a Form or UserControl given an HDC,
> and Y co-ords, and the string.
> Ordinarily this is simple enough using the TextOut() api.
> The problems that I face are twofold :
> The first is that TextOut does not replace the '&' character in the
> with an underline under the next character.
> The second is that I need to be able to rotate the string (at the
> only by 0, 90, or 270 degrees, but I'm trying to write some generic
> routines that can handle any angle...)
> The DrawText() api does support this replacement, but does not support
> rotated text.