I am trying to create a bitmap font rendering, however I am having problems displaying the actual placements of individual letters.
I will get font character information through GetCharABCWidthsFloat and GetTextMetricsW, however I'm not sure how to use ABC width correctly ... or do I need more information for this?
I do not want to use FreeType or any other libraries for this, I am trying to do this with standard functions available through C ++ \ Windows.
Without kerning information, the letters will not display correctly. For example, take a look at βTimes new romanβ when βfβ and βtβ are next to each other. Without the correct spacing between letters, they will look too far apart. Algorithm Example ---
float letterBottomLeftX = 0.0f;
float letterHeight = 1.0f;
float letterWidth = 1.0f;
float scale = 1.0f;
for(U32 c = 0; c < numberOfCharacters; ++c)
{
fon->GetCharcterInfo(charValue, charInfo);
letterWidth = charInfo.B * scale;
letterHeight = textMetrics.Height * scale;
if(c == 0)
{
letterBottomLeftX = -(charInfo.A * scale);
}
letterBottomLeftX += (charInfo.A + charInfo.B + charInfo.C) * scale;
}
, , . ( UV, , ).
http://img88.imageshack.us/img88/4015/njpjp2.png