Revert "Revert "bug fix GetFontN()""
authorYoung Ki Ahn <ykahn@samsung.com>
Wed, 3 Jul 2013 04:50:44 +0000 (04:50 +0000)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 3 Jul 2013 04:50:44 +0000 (04:50 +0000)
This reverts commit 555d696c04600d9182125d7c0f6b3457780669f1

Change-Id: Id02c5d9683476f0e522f792d9753c194ac2798d6

src/graphics/FGrp_CanvasImpl.cpp

index b778c63..c6ecf2e 100755 (executable)
@@ -2777,12 +2777,16 @@ _CanvasImpl::GetFontN(void)
        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);