bug fix GetFontN()
authorSungyeon Woo <s.woo@samsung.com>
Mon, 1 Jul 2013 08:16:32 +0000 (17:16 +0900)
committerSungyeon Woo <s.woo@samsung.com>
Mon, 1 Jul 2013 11:23:33 +0000 (20:23 +0900)
Change-Id: I3a0e1d3bdfffe87f2c83986ec745ea691ecb2b92
Signed-off-by: Sungyeon Woo <s.woo@samsung.com>
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);