Re: Intercharacter Spacing of Screen Fonts
Apparently otmEMSquare obtained from GetOutlineTextMetrics() is the magic number
that represents the size of the font required to form the basis for device
independent layout of onscreen text. This allows the mapping from screen to
printout to have a one-to-one correspondence pertaining to layout. In other
words WYSIWYG, layout. I added these extra details for any reader that may come
later with this same problem.
It looks like other sources of this same information quote your book as their
reference. Thanks again for all of your help in solving this long standing
problem.
"Feng Yuan [MSFT]" <fyuan@online.microsoft.com> wrote in message
news:%23urcLGChGHA.1792@TK2MSFTNGP03.phx.gbl...
This is just my understanding 7 years ago:
http://safariexamples.informit.com/0130869856/Samples/include/FontText.cpp
BOOL KTextFormator::TextOut(HDC hDC, int x, int y, LPCTSTR pString, int
nCount)
{
int Dx[MAX_PATH];
int lastx = 0;
float sum = 0.0;
int sumdx = 0;
for (int i=0; i<nCount; i++)
{
sum = sum + m_fCharWidth[pString[i]];
int newx = (int) (sum + 0.5);
Dx[i] = newx - lastx;
lastx = newx;
sumdx += Dx[i];
}
return ExtTextOut(hDC, x, y, 0, NULL, pString, nCount, Dx);
}
"Peter Olcott" <olcott@att.net> wrote in message
news:Wt0fg.2166$f76.306@dukeread06...
You can find some sample code here:
http://safariexamples.informit.com/0130869856/
--
Feng Yuan [MSFT] http://blogs.msdn.com/fyuan
That is great, now all that I need to know is how they would go about doing
this glyph placement calculation. Is that located somewhere in your sample
code?