PDA

View Full Version : Vertical text in OpenGL/Win32



1stChineseAstronaut
10-29-2003, 03:56 PM
Does anybody know how to render (in 2D) verticaly (or generaly) oriented line of text in OpenGL running under Win32? I've already tested wglUseFontBitmaps() which creates a call lists of glyphs using current GDI font. Such font I've created before and selected to the GDI DC, with proper orientation settings. Although text was rendered with correct family, size, etc., its baseline remained horizontal, only particular characters were rotated.

Thanks in advance.

*Aaron*
10-30-2003, 07:45 AM
Are you saying that you got text to draw with the individual characters rotated, but in a horizontal line? I didn't know you could do that. If that's the case, you could write a function that draws the text one character at a time and calculate the position of the next character yourself.

Would you mind telling me how to rotate a font in Win32?

*Aaron*
10-30-2003, 07:50 AM
And congratulations on the whole space flight thing.

1stChineseAstronaut
10-30-2003, 10:44 AM
Originally posted by *Aaron*:
Are you saying that you got text to draw with the individual characters rotated, but in a horizontal line? I didn't know you could do that. If that's the case, you could write a function that draws the text one character at a time and calculate the position of the next character yourself.

Would you mind telling me how to rotate a font in Win32?

You have to create a new logical font to reach the text rotation in Win32 GDI. Call CreateFont() or CreateFontIndirect() API functions (or corresponding methods of CDC object in MFC) with proper setting of Escapement and Orientation parameters.