Hi,

i'm developing a program that dumps windows fonts to a multipage tiff file.
My problem is that i can calculate fine the width of a character if it's Regular or Bold, but i'cant do it always with Italic. Sometimes the font get cuted in the saved file cause the width returned by GetTextExtentPoint32,GetCharWidth32 or GetCharABCWidths it's not enough.

Any advice?

Thanks anyway,
Mariano.
Posted on 2003-10-14 05:23:23 by Eternal Idol Birmingham
Standard italics is intended to create characters that are a bit wider than their reported size; this allows Windows to keep the characters from looking like they have spaces between them, by overlapping the upper parts of one italicized letter over the lower parts of another. Unfortunately, the amount of extra space taken up by the italicized character is different for every character, font, and screen mode, and there's no simple formula for determining it, nor does Windows offer any methods for calculating it.

If your program absolutely MUST crop the tiff files precisely at the end of the text, the only way to do this is to disallow italics entirely. Otherwise, you can automatically add an extra half-space at the end of every italicized text string. This will also prevent italicized text from overlapping adjacent non-italicized text, but the size of the half-space character itself shouldn't be considered a reliable measure of the added size of an italicized character.
Posted on 2003-10-15 00:00:53 by Tatterdemalian
Thanks for the answer, finally I'm using the DrawText() API with DT_CALCRECT option on.
I still need to add some width with italic fonts but it's better than it was with any of the other APIS.

See you.
Posted on 2003-10-15 03:02:28 by Eternal Idol Birmingham