Re: DrawText DrawText msdn documentation clarification

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Sigurd Stenersen (sigurds_at_utvikling.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 12:03:47 +0200

vipin wrote:
> "Rhett Gong [MSFT]" <v-raygon@online.microsoft.com> wrote in message
>> It depends on the font used, among other things.
>>
>> I also add the output for rect.botton. In my test, I get the same
>> output (see below) no matter I use "Hello Windows 98!" or "Hegpo
>> Windows 98!" //-------------------------------------------------
>> rect.bottom is: 116
>> Return value from DrawText is: 16
>> //-------------------------------------------------
>> Do you mean the return value should be less than 16 when drawing
>> "Hello Windows 98!", since it doesn't rest on the bottom of the rect?
>>
> Exactly, I expected the return code to be less for
> "Hello Windows 98!".
>
> So I assume it is some problem with the API.

There is no problem with the API, it's your understanding of it that's off.
If text was aligned like you suggest, it would be next to impossible to make
a straight line of text by several calls to DrawText().

The alignment does of course depend on the font being used, but no sensibly
designed font wastes any space - unless it's called for. There is internal
and external leading, tho, to improve readability.

Some characters generally use more space under the baseline than others, but
the fact that a given character doesn't *use* that space does not mean that
that space isn't there...

You'll find a lot of information about fonts etc at msdn, for instance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_56yb.asp

-- 
Sigurd
http://utvikling.com


Relevant Pages

  • The font "Arabic Transparent" (artro.ttf) is invalid
    ... This font, when installed, causes WEFT to crash. ... Error code Message Details ... I2100 Characters in a unicode range are present in the font, ...
    (microsoft.public.windowsxp.general)
  • Re: apostrophe with space in Word
    ... Helvetica as known in the computing world didn't get going until Apple included it in the Mac Operating system. ... Because it became so popular, Microsoft decide to add to their font collection, but because it was patented they decide to create their own version. ... So it may help to explain that the Unicode character set now defines about ... important to know the answer to the question "How many glyphs (characters) ...
    (microsoft.public.mac.office.word)
  • Re: Russian language support
    ... Actually in our previous test we didnt do language transition properly ... bytes, or if in Unicode, just a string of 2-byte values, each of which is ... it selects a font to use to display ... TTF fonts in Windows CE map Unicode characters into suitable glyphs. ...
    (microsoft.public.windowsce.platbuilder)
  • Font Problems when embedding Visio 2003 files into Word 2003
    ... are having with fonts and text using Visio 2003. ... Unicode characters ... Everything looks correct on-screen in Visio, but when the drawing is ... Symbol font characters get changed to other characters when viewed in Word. ...
    (microsoft.public.visio.troubleshoot)
  • Re: Russian language support
    ... The characters in Unicode are just values. ... Whether a given font that you ... A glyph is a drawing ...
    (microsoft.public.windowsce.platbuilder)