if (this->_pFont)
{
pFont = _FontImpl::CloneN(*(this->_pFont));
- SysTryCatch(NID_GRP, pFont, r = E_OUT_OF_MEMORY, E_OPERATION_FAILED, "[E_OUT_OF_MEMORY] Failed to create Font instance.");
+ SysTryCatch(NID_GRP, pFont, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create Font instance.");
}
else
{
- // make font instance with the attribute of system default font
- // shkim, TODO
+ pFont = new Font();
+ SysTryCatch(NID_GRP, pFont, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
+
+ const float defaultFontSize = _ResUtil::ConvertToVirCoordY(16.0f);
+ result r = pFont->Construct(FONT_STYLE_PLAIN, defaultFontSize);
+ SysTryCatch(NID_GRP, IsSucceeded(r), , r, "[%s] Propagating.", GetErrorMessage(r));
}
SetLastResult(r);