From fa657c9f457a76b3352277a6b5a6dbf3c7fdd079 Mon Sep 17 00:00:00 2001 From: Young Ki Ahn Date: Wed, 3 Jul 2013 04:50:44 +0000 Subject: [PATCH] Revert "Revert "bug fix GetFontN()"" This reverts commit 555d696c04600d9182125d7c0f6b3457780669f1 Change-Id: Id02c5d9683476f0e522f792d9753c194ac2798d6 --- src/graphics/FGrp_CanvasImpl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/graphics/FGrp_CanvasImpl.cpp b/src/graphics/FGrp_CanvasImpl.cpp index b778c63..c6ecf2e 100755 --- a/src/graphics/FGrp_CanvasImpl.cpp +++ b/src/graphics/FGrp_CanvasImpl.cpp @@ -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); -- 2.7.4