Hi GSP_T,
My solution is bit redundant but the solution that I got is:
...
//calculate font metrics
DWRITE_FONT_METRICS fontMetrics;
font->GetMetrics(&fontMetrics); //font is the object of IDWriteFont uses for the text rendering.
ascent = MulDiv( fontMetrics.ascent, fontSize,fontMetrics.designUnitsPerEm);
descent = MulDiv(fontMetrics.descent, fontSize,fontMetrics.designUnitsPerEm);
...
// Specify the baseline of the text explicitly
textFormat->SetLineSpacing(DWRITE_LINE_SPACING_METHOD_UNIFORM, ascent + descent, ascent); // textFotmat is the object of IDWriteTextFormat used for text rendering.
...
// Calculate layoutY from the baseLineY
layoutY = baseLineY - ascent;
// Render the text using layoutY
...
The real code that I have caches the metrics of the font and bit more complecated but the code above explains the idea enough I think.
HTH
Takuji