BUG: Left Part of Character Is Clipped with ExtTextOut/TextOut

Last reviewed: July 23, 1997
Article ID: Q111649
3.10 WINDOWS kbprg kbbuglist

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SYMPTOMS

The left part of a TrueType character such as an italic "f" is clipped.

CAUSE

There is a bug in the TextOut() and ExtTextOut() functions that occurs with complex clipping regions. In this case, GDI considers the left edge of the string to be the X coordinate used in the TextOut() or ExtTextOut() call. This works for bitmap fonts, but not TrueType fonts because the "A" part of a TrueType font's ABC width may be negative (as it normally is with an italic "f").

Because this problem only occurs with complex clipping regions, the character may appear to be randomly clipped as the clipping region changes. For example, clipping may be tied to the presence of a dialog box or other window over the client area, because that may create a complex clipping region.

RESOLUTION

An application can correct this problem by calling ExtTextOut() and passing in a clipping rectangle that accounts for the portion of the text going to the left of the starting point.

For example, in the following call, the string origin is offset within the clipping rectangle so the string will not be clipped:

   ExtTextOut(hdc, rc.left+10, // text origin (offset by 10 into cliprect)
              rc.top, ETO_CLIPPED,
              &rc, "ffff", 4, NULL);

STATUS

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

This problem does not occur in Windows 95.

MORE INFORMATION

Steps to Reproduce Problem

This problem can be reproduced in Windows Write as follows:

  1. Start Write.

  2. Switch to the Times New Roman Italic font in a 72 point size and type an "f".

  3. Display Write's About box and move it off of the "f". When the window is repainted, the left serif of the "f" will be clipped.


Additional reference words: buglist3.10 3.10 sporadic
KBCategory: kbprg kbbuglist
KBSubcategory: GdiDrw
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.