BUG: GetGlyphOutline() Returns Partial Glyph (87350)



The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) 3.1

This article was previously published under Q87350
3.10 WINDOWS kbprg kbbuglist

SYMPTOMS

In the Microsoft Windows graphical environment, when an application calls the GetGlyphOutline function to retrieve the bitmap for a rotated glyph (the lpmat2 matrix points to a nonidentity rotation matrix) and the glyph is larger than 75 pixels, the returned bitmap contains a partial, nonrotated, glyph.

RESOLUTION

To work around this problem, perform the following five steps:
  1. Select the font into an appropriate device context (DC).
  2. Determine the size of the bitmap required to hold the rotated glyph by performing the following three steps:
    1. Call the GetCharABCWidths() function to determine the (nonrotated) width of the black part of glyph. This information is returned in the abcB member of an ABC data structure.Call the GetTextMetrics() function to fill a TEXTMETRICS data structure with information about the font. Use the value of the tmHeight member of the TEXTMETRICS structure as the height.Use the angle of rotation to compute the width and height of the rotated glyph based on the information above.
    2. Call the GetTextMetrics() function to fill a TEXTMETRICS data structure with information about the font. Use the value of the tmHeight member of the TEXTMETRICS structure as the height.Use the angle of rotation to compute the width and height of the rotated glyph based on the information above.
    3. Use the angle of rotation to compute the width and height of the rotated glyph based on the information above.
  3. Create a bitmap of the size calculated in step 2 and select it into a memory DC.
  4. Create a rotated version of the font by specifying the rotation angle in the lfOrientation member of the LOGFONT data structure and select it into the memory DC.
  5. Call the TextOut() function to write the desired glyph into the memory DC.

STATUS

Microsoft has confirmed this to be a bug in Windows version 3.1.

Modification Type:MinorLast Reviewed:2/11/2005
Keywords:kbbug kbpending KB87350