I am working on a DWF reader , parse wt_ Object::Text_ The height of the font cannot be obtained correctly . The following is my code, please help guide
WT_Result CFrame::DWFText_Action(WT_Text& Text, WT_File& file, Gdiplus::Graphics* pGraphicsDwf)
{
WT_Result res = WT_Result::Success;
WT_Font dwffont = file.rendition().font();
WT_RGBA32 fdf = file.rendition().color().rgba();
const WT_String fontName = dwffont.font_name().name();
const wchar_t* wide_text = WT_String::to_wchar(fontName.length(), fontName.unicode());
WT_Byte family = dwffont.family().family();
float iFontHeight = dwffont.height().height();
int iRo = dwffont.rotation().rotation();
float fRo = iRo * 360 / 65536;
int iWidScale = dwffont.width_scale().width_scale();
CString szText(Text.string().ascii());
WT_Logical_Point wtPoint = Text.position();
PointTransform(wtPoint);
Gdiplus::SolidBrush solidBrush(Color(fdf.m_rgb.r, fdf.m_rgb.g, fdf.m_rgb.b));
Gdiplus::FontFamily font_family(wide_text);
Gdiplus::Font font(&font_family, iFontHeight, Gdiplus::FontStyleRegular, Gdiplus::UnitPixel);
Gdiplus::PointF pointF(wtPoint.m_x, wtPoint.m_y);
Gdiplus::Status sta = pGraphicsDwf->DrawString(szText.GetBuffer(), -1, &font, pointF, &solidBrush);
return res;
}