See the question and my original answer on StackOverflow

Instead of using TextOut, you can use DrawText which is a bit more hi-level, like this:

for (int i = 0; i < 12; i++)
{
    RECT rc;
    rc.left = i * tm.tmAveCharWidth;
    rc.top = tm.tmHeight;
    rc.right = rc.left + 50; // todo: make sure this is ok
    rc.bottom = rc.top + 100;
    DrawText(hdc, (LPWSTR)&str[i], 1, &rc, 0);
}

And it seems to fix the "lineness" of it, although it's not 100% exactly the same (there are some pixels that show a difference):

enter image description here