Re: GetTextExtentExPoint slow for characters greater than codepoint 127

Tech-Archive recommends: Fix windows errors by optimizing your registry



David,

I would not cache the data for all characters in the font, only the 7-bit
part (most use US-ASCII or the trivial western codepages anyway). The rest I
would query on demand.

But that's a decision that's up to you and some performance measurements.

Sorry I cannot help you with the other problem - but what do you care what
GEtTextExtent...() do when you can do that yourself? Possibly some kind of
rounding? I use GetCharABCWidthsFloat() on NT systems and round it after
adding all values as floats or doubles.

Christian

"David Liebtag" <DavidLiebtag@xxxxxxxxxxxxx> wrote in message
news:uU4FbCxRHHA.488@xxxxxxxxxxxxxxxxxxxxxxx
I have added code my WM_SETFONT handler to query the sizes of all the
characters in the font. This information is cached and used later during
string processing. It works terrific! Thanks!

However, I still have a question or two,,,

Initially, I built a string containing all the characters in the font and
then called GetTextExtentExPointW to query the character sizes. This
works,
but I notice the first time I call it for a large font, like Arial Unicode
MS, it takes a long time,,, about 4 seconds on my 3.4 ghz machine.
Although
subsequent calls are fast, the first call is too slow and adversely
impacts
my application initialization. So, I tried to find another technique.

I tried GetCharABCWidths and found that when I add the abc values
together,
I get the same character widths as GetTextExtentExPointW for most
characters
and for those characters it works beautifully. However, for some
characters, I get different results. For example, if I query the ABC
widths
for U+01F6, I get values of 2, 12, and 2 for a total of 16 pixels wide.
GetTextExtentExpoint reports that this character is 17 pixels wide.

Can anyone explain to me the relationship between the abc widths and the
width returned by GetTextExtentExPoint?

Or, can anyone tell me a high performance way to accurately retrieve the
widths of all the characters in a font?

Thanks a lot.

David Liebtag




.



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)
  • Re: How to set menu shortcuts, and fonts?
    ... So instead of appending a shortcut letter in parentheses I used ... In Vista this doesn't work. ... In Vista the title bar and menu bar are in Meiryo and are antialiased even at font size 9. ... (Somehow foreign versions of XP understand a default font of MS Gothic and they use a different font instead, which works if only Italian characters are used in the captions. ...
    (microsoft.public.dotnet.languages.csharp)
  • 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)