qApplied Float api
authorYunji Park <yunji19.park@samsung.com>
Mon, 8 Apr 2013 06:16:22 +0000 (15:16 +0900)
committerYunji Park <yunji19.park@samsung.com>
Mon, 8 Apr 2013 07:15:35 +0000 (16:15 +0900)
Change-Id: I328a780c78a23c4ccb00faae9516ea7ad6b9bb44

src/graphics/FGrp_EnrichedTextImpl.cpp
src/graphics/inc/FGrp_EnrichedTextImpl.h
src/graphics/text/FGrp_TextTextComposite.cpp
src/graphics/text/FGrp_TextTextObject.cpp

index d7f8dcc..3bc7f74 100644 (file)
@@ -78,6 +78,14 @@ _EnrichedTextImpl::~_EnrichedTextImpl(void)
 result
 _EnrichedTextImpl::Construct(const Tizen::Graphics::Dimension& dim)
 {
+       FloatDimension dimF = _CoordinateSystemUtils::ConvertToFloat(dim);
+
+       return Construct(dimF);
+}
+
+result
+_EnrichedTextImpl::Construct(const Tizen::Graphics::FloatDimension& dim)
+{
        SysTryReturn(NID_GRP, (dim.width > 0) && (dim.height > 0), E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The argument is invalid. (width = %d height = %d)", dim.width, dim.height);
 
@@ -103,7 +111,7 @@ _EnrichedTextImpl::Construct(const Tizen::Graphics::Dimension& dim)
                        , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Fails to create a TextObject.", GetErrorMessage(r));
 
        __pTextObject->Construct();
-       __pTextObject->SetBounds(Rectangle(0, 0, __width, __height));
+       __pTextObject->SetBounds(FloatRectangle(0, 0, __width, __height));
        __pTextObject->SetCutLinkViewMode(true);
        __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT);
        __pTextObject->HideFrontSpace(TEXT_OBJECT_SPACE_HIDE_TYPE_ONE);
@@ -130,13 +138,6 @@ CATCH:
 }
 
 result
-_EnrichedTextImpl::Construct(const Tizen::Graphics::FloatDimension& dim)
-{
-       Dimension newDim = _CoordinateSystemUtils::ConvertToInteger(dim);
-       return Construct(newDim);
-}
-
-result
 _EnrichedTextImpl::InsertAt(int elementIndex, Tizen::Graphics::TextElement& element)
 {
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
@@ -397,12 +398,20 @@ _EnrichedTextImpl::GetTextElementCount(void) const
 result
 _EnrichedTextImpl::SetSize(const Tizen::Graphics::Dimension& size)
 {
+       FloatDimension sizeF = _CoordinateSystemUtils::ConvertToFloat(size);
+
+       return SetSize(sizeF);
+}
+
+result
+_EnrichedTextImpl::SetSize(const Tizen::Graphics::FloatDimension& size)
+{
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
        SysTryReturn(NID_GRP, (size.width > 0) && (size.height > 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
                        , "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", size.width, size.height);
 
-       Rectangle rect(0, 0, size.width, size.height);
+       FloatRectangle rect(0, 0, size.width, size.height);
 
        __pTextObject->SetBounds(rect);
        __width = rect.width;
@@ -412,33 +421,26 @@ _EnrichedTextImpl::SetSize(const Tizen::Graphics::Dimension& size)
 }
 
 result
-_EnrichedTextImpl::SetSize(const Tizen::Graphics::FloatDimension& size)
+_EnrichedTextImpl::SetSize(int width, int height)
 {
-       Dimension newSize = _CoordinateSystemUtils::ConvertToInteger(size);
-       return SetSize(newSize);
+       return SetSize(_CoordinateSystemUtils::ConvertToFloat(width),_CoordinateSystemUtils::ConvertToFloat(height));
 }
 
 result
-_EnrichedTextImpl::SetSize(int width, int height)
+_EnrichedTextImpl::SetSize(float width, float height)
 {
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
        SysTryReturn(NID_GRP, (width > 0) && (height > 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
                        , "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", width, height);
 
-       Dimension dim(width, height);
+       FloatDimension dim(width, height);
 
        result r = SetSize(dim);
 
        return r;
 }
 
-result
-_EnrichedTextImpl::SetSize(float width, float height)
-{
-       return SetSize(_CoordinateSystemUtils::ConvertToInteger(width),_CoordinateSystemUtils::ConvertToInteger(height));
-}
-
 Tizen::Graphics::Dimension
 _EnrichedTextImpl::GetSize(void) const
 {
@@ -447,8 +449,8 @@ _EnrichedTextImpl::GetSize(void) const
 
        Dimension dim;
 
-       dim.width = __width;
-       dim.height = __height;
+       dim.width = _CoordinateSystemUtils::ConvertToInteger(__width);
+       dim.height = _CoordinateSystemUtils::ConvertToInteger(__height);
 
        return dim;
 }
@@ -456,13 +458,13 @@ _EnrichedTextImpl::GetSize(void) const
 Tizen::Graphics::FloatDimension
 _EnrichedTextImpl::GetSizeF(void) const
 {
-       SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(0.0f, 0.0f), E_OPERATION_FAILED
+       SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(0, 0), E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
        FloatDimension dim;
 
-       dim.width = _CoordinateSystemUtils::ConvertToFloat(__width);
-       dim.height = _CoordinateSystemUtils::ConvertToFloat(__height);
+       dim.width = __width;
+       dim.height = __height;
 
        return dim;
 }
@@ -473,8 +475,8 @@ _EnrichedTextImpl::GetSize(int& width, int& height) const
        SysTryReturn(NID_GRP, __pTextObject != null, , E_OPERATION_FAILED
                                , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       width = __width;
-       height = __height;
+       width = _CoordinateSystemUtils::ConvertToInteger(__width);
+       height = _CoordinateSystemUtils::ConvertToInteger(__height);
 }
 
 void
@@ -483,8 +485,8 @@ _EnrichedTextImpl::GetSize(float& width, float& height) const
        SysTryReturn(NID_GRP, __pTextObject != null, , E_OPERATION_FAILED
                                , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       width = _CoordinateSystemUtils::ConvertToFloat(__width);
-       height = _CoordinateSystemUtils::ConvertToFloat(__height);
+       width = __width;
+       height = __height;
 }
 
 int
@@ -493,7 +495,7 @@ _EnrichedTextImpl::GetWidth(void) const
        SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       return __width;
+       return _CoordinateSystemUtils::ConvertToInteger(__width);
 }
 
 float
@@ -502,7 +504,7 @@ _EnrichedTextImpl::GetWidthF(void) const
        SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       return _CoordinateSystemUtils::ConvertToFloat(__width);
+       return __width;
 }
 
 int
@@ -511,7 +513,7 @@ _EnrichedTextImpl::GetHeight(void) const
        SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       return __height;
+       return _CoordinateSystemUtils::ConvertToInteger(__height);
 }
 
 float
@@ -520,7 +522,7 @@ _EnrichedTextImpl::GetHeightF(void) const
        SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       return _CoordinateSystemUtils::ConvertToFloat(__height);
+       return __height;
 }
 
 result
@@ -657,7 +659,7 @@ _EnrichedTextImpl::SetLineSpace(int lineSpace)
        SysTryReturn(NID_GRP, lineSpace > 0, E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The argument is invalid.");
 
-       __lineSpace = lineSpace;
+       __lineSpace = _CoordinateSystemUtils::ConvertToFloat(lineSpace);
        __pTextObject->SetLineSpace(__lineSpace);
 
        return E_SUCCESS;
@@ -671,7 +673,7 @@ _EnrichedTextImpl::SetLineSpace(float lineSpace)
        SysTryReturn(NID_GRP, lineSpace > 0, E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The argument is invalid.");
 
-       __lineSpace = _CoordinateSystemUtils::ConvertToInteger(lineSpace);
+       __lineSpace = lineSpace;
        __pTextObject->SetLineSpace(__lineSpace);
 
        return E_SUCCESS;
@@ -680,13 +682,13 @@ _EnrichedTextImpl::SetLineSpace(float lineSpace)
 int
 _EnrichedTextImpl::GetLineSpace(void) const
 {
-       return __lineSpace;
+       return _CoordinateSystemUtils::ConvertToInteger(__lineSpace);
 }
 
 float
 _EnrichedTextImpl::GetLineSpaceF(void) const
 {
-       return _CoordinateSystemUtils::ConvertToFloat(__lineSpace);
+       return __lineSpace;
 }
 
 void
@@ -712,22 +714,21 @@ _EnrichedTextImpl::GetTotalLineCount(void) const
 int
 _EnrichedTextImpl::GetTotalLineHeight(void) const
 {
+       return _CoordinateSystemUtils::ConvertToInteger(GetTotalLineHeightF());
+}
+
+float
+_EnrichedTextImpl::GetTotalLineHeightF(void) const
+{
        SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
 
-       int height = __pTextObject->GetTotalHeight();
-
        __pTextObject->Compose();
+       float height = __pTextObject->GetTotalHeightF();
 
        return height;
 }
 
-float
-_EnrichedTextImpl::GetTotalLineHeightF(void) const
-{
-       return _CoordinateSystemUtils::ConvertToFloat(GetTotalLineHeight());
-}
-
 int
 _EnrichedTextImpl::GetDisplayLineCount(void) const
 {
@@ -842,6 +843,12 @@ _EnrichedTextImpl::GetLineIndex(int textIndex) const
 int
 _EnrichedTextImpl::GetLineHeight(int lineIndex) const
 {
+       return _CoordinateSystemUtils::ConvertToInteger(GetLineHeightF(lineIndex));
+}
+
+float
+_EnrichedTextImpl::GetLineHeightF(int lineIndex) const
+{
        SysTryReturn(NID_GRP, __pTextObject != null, -1, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
        SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG
@@ -857,18 +864,12 @@ _EnrichedTextImpl::GetLineHeight(int lineIndex) const
                return -1;
        }
 
-       int height = __pTextObject->GetLineHeightAt(lineIndex);
+       float height = __pTextObject->GetLineHeightAtF(lineIndex);
 
        SetLastResult(E_SUCCESS);
        return height;
 }
 
-float
-_EnrichedTextImpl::GetLineHeightF(int lineIndex) const
-{
-       return _CoordinateSystemUtils::ConvertToFloat(GetLineHeight(lineIndex));
-}
-
 int
 _EnrichedTextImpl::GetTextLength(void) const
 {
@@ -887,6 +888,20 @@ _EnrichedTextImpl::GetTextLength(void) const
 result
 _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, int& width, int& height, int& actualLength) const
 {
+       float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+       float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+
+       result r = GetTextExtent(startTextIndex, textLength, widthF, heightF, actualLength);
+
+       width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+       height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+
+       return r;
+}
+
+result
+_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const
+{
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
        SysTryReturn(NID_GRP, textLength >= 0, E_INVALID_ARG, E_INVALID_ARG
@@ -894,7 +909,7 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, int& width,
        SysTryReturn(NID_GRP, startTextIndex <= GetTextLength(), E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] 'startTextIndex' is greater than or equal to the text length.");
 
-       Dimension textSize;
+       FloatDimension textSize;
 
        actualLength = 0;
 
@@ -915,7 +930,7 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, int& width,
        }
 
        __pTextObject->Compose();
-       textSize = __pTextObject->GetTextExtent(startTextIndex, textLength);
+       textSize = __pTextObject->GetTextExtentF(startTextIndex, textLength);
        width = textSize.width;
        height = textSize.height;
 
@@ -931,23 +946,21 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, int& width,
        return E_SUCCESS;
 }
 
+
 result
-_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const
+_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int &actualLength) const
 {
-       int intWidth = _CoordinateSystemUtils::ConvertToInteger(width);
-       int intHeight = _CoordinateSystemUtils::ConvertToInteger(height);
+       FloatDimension sizeF = _CoordinateSystemUtils::ConvertToFloat(size);
 
-       result r = GetTextExtent(startTextIndex, textLength, intWidth, intHeight, actualLength);
+       result r = GetTextExtent(startTextIndex, textLength, sizeF, actualLength);
 
-       width = _CoordinateSystemUtils::ConvertToFloat(intWidth);
-       height = _CoordinateSystemUtils::ConvertToFloat(intHeight);
+       size = _CoordinateSystemUtils::ConvertToInteger(sizeF);
 
        return r;
 }
 
-
 result
-_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int &actualLength) const
+_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int &actualLength) const
 {
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n");
        SysTryReturn(NID_GRP, textLength >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given text length(%d) is invalid\n", textLength);
@@ -974,7 +987,7 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Grap
 
        __pTextObject->Compose();
 
-       size = __pTextObject->GetTextExtent(startTextIndex, textLength);
+       size = __pTextObject->GetTextExtentF(startTextIndex, textLength);
        if (GetTextLength() - startTextIndex > textLength)
        {
                actualLength = textLength;
@@ -987,24 +1000,18 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Grap
        return E_SUCCESS;
 }
 
-result
-_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int &actualLength) const
+Tizen::Graphics::Dimension
+_EnrichedTextImpl::GetTextExtent(void) const
 {
-       Dimension intSize = _CoordinateSystemUtils::ConvertToInteger(size);
-
-       result r = GetTextExtent(startTextIndex, textLength, intSize, actualLength);
-
-       size = _CoordinateSystemUtils::ConvertToFloat(intSize);
-
-       return r;
+       return _CoordinateSystemUtils::ConvertToInteger(GetTextExtentF());
 }
 
-Tizen::Graphics::Dimension
-_EnrichedTextImpl::GetTextExtent(void) const
+Tizen::Graphics::FloatDimension
+_EnrichedTextImpl::GetTextExtentF(void) const
 {
-       SysTryReturn(NID_GRP, __pTextObject != null, Dimension(-1, -1), E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n");
+       SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(-1, -1), E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n");
 
-       Dimension size(0,0);
+       FloatDimension size(0,0);
        if (GetTextLength() == 0)
        {
                return size;
@@ -1012,11 +1019,11 @@ _EnrichedTextImpl::GetTextExtent(void) const
 
        __pTextObject->Compose();
 
-       Rectangle rtBound = __pTextObject->GetBounds();
-       if (rtBound.width >= 0 && rtBound.height >= 0)
+       FloatRectangle rtBound = __pTextObject->GetBoundsF();
+       if (rtBound.width >= 0.0f && rtBound.height >= 0.0f)
        {
                size.width = rtBound.width;
-               size.height = __pTextObject->GetTotalHeight();
+               size.height = __pTextObject->GetTotalHeightF();
 
                return size;
        }
@@ -1029,12 +1036,6 @@ _EnrichedTextImpl::GetTextExtent(void) const
        }
 }
 
-Tizen::Graphics::FloatDimension
-_EnrichedTextImpl::GetTextExtentF(void) const
-{
-       return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent());
-}
-
 result
 _EnrichedTextImpl::Add(const Tizen::Graphics::Bitmap& bitmap)
 {
@@ -1055,7 +1056,7 @@ _EnrichedTextImpl::Add(const Tizen::Graphics::Bitmap& bitmap)
                return E_OUT_OF_MEMORY;
        }
 
-       r = pNewBitmap->Construct(*pBitmap, Rectangle(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()));
+       r = pNewBitmap->Construct(*pBitmap, FloatRectangle(0, 0, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
        SysTryCatch(NID_GRP
                        , r == E_SUCCESS
                        , , r, "[%s] Fails to append image.", GetErrorMessage(r));
@@ -1113,7 +1114,7 @@ _EnrichedTextImpl::InsertAt(int elementIndex, const Tizen::Graphics::Bitmap& bit
                return E_OUT_OF_MEMORY;
        }
 
-       r = pNewBitmap->Construct(*pBitmap, Rectangle(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()));
+       r = pNewBitmap->Construct(*pBitmap, FloatRectangle(0, 0, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
        SysTryCatch(NID_GRP
                        , r == E_SUCCESS
                        , , r, "[%s] Fails to insert image.", GetErrorMessage(r));
@@ -1155,37 +1156,43 @@ CATCH:
 result
 _EnrichedTextImpl::GetLinkInfoFromPosition(const Point& point, Tizen::Base::Utility::LinkInfo& linkInfo) const
 {
+       return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToFloat(point), linkInfo);
+}
+
+result
+_EnrichedTextImpl::GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const
+{
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
        SysTryReturn(NID_GRP, GetTextElementCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND
                        , "[E_OBJ_NOT_FOUND] The TextElement does not exist.");
-       SysTryReturn(NID_GRP, point.x >= 0 && point.y >= 0, E_INVALID_ARG, E_INVALID_ARG
+       SysTryReturn(NID_GRP, point.x >= 0.0f && point.y >= 0.0f, E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The invalid position is given.");
-       SysTryReturn(NID_GRP, GetWidth() >= point.x && GetHeight() >= point.y, E_INVALID_ARG, E_INVALID_ARG
+       SysTryReturn(NID_GRP, GetWidthF() >= point.x && GetHeightF() >= point.y, E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The invalid position is given.");
 
        return GetLinkInfoFromPosition(point.x, point.y, linkInfo);
 }
 
 result
-_EnrichedTextImpl::GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const
+_EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const
 {
-       return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToInteger(point), linkInfo);
+       return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), linkInfo);
 }
 
 result
-_EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const
+_EnrichedTextImpl::GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const
 {
        SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
                        , "[E_OPERATION_FAILED] This instance is not constructed yet.");
        SysTryReturn(NID_GRP, GetTextElementCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND
                        , "[E_OBJ_NOT_FOUND] The TextElement does not exist.");
-       SysTryReturn(NID_GRP, x >= 0 && y >= 0, E_INVALID_ARG, E_INVALID_ARG
+       SysTryReturn(NID_GRP, x >= 0.0f && y >= 0.0f, E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The invalid position is given.");
-       SysTryReturn(NID_GRP, GetWidth() >= x && GetHeight() >= y, E_INVALID_ARG, E_INVALID_ARG
+       SysTryReturn(NID_GRP, GetWidthF() >= x && GetHeightF() >= y, E_INVALID_ARG, E_INVALID_ARG
                        , "[E_INVALID_ARG] The invalid position is given.");
 
-       Point point(x, y);
+       FloatPoint point(x, y);
 
        int textElementIndex = GetTextElementIndexFromPosition(point);
 
@@ -1205,12 +1212,6 @@ _EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::L
        return E_SUCCESS;
 }
 
-result
-_EnrichedTextImpl::GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const
-{
-       return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), linkInfo);
-}
-
 TextVerticalAlignment
 _EnrichedTextImpl::GetElementVerticalAlignment(void) const
 {
@@ -1245,7 +1246,7 @@ _EnrichedTextImpl::SetElementVerticalAlignment(TextVerticalAlignment alignment)
 Tizen::Graphics::Rectangle
 _EnrichedTextImpl::GetBounds() const
 {
-       Rectangle rect(0, 0, __width, __height);
+       Rectangle rect(0, 0, _CoordinateSystemUtils::ConvertToInteger(__width), _CoordinateSystemUtils::ConvertToInteger(__height));
 
        return rect;
 }
@@ -1253,9 +1254,7 @@ _EnrichedTextImpl::GetBounds() const
 Tizen::Graphics::FloatRectangle
 _EnrichedTextImpl::GetBoundsF() const
 {
-       float newWidth = _CoordinateSystemUtils::ConvertToFloat(__width);
-       float newHeight = _CoordinateSystemUtils::ConvertToFloat(__height);
-       FloatRectangle rect(0.0f, 0.0f, newWidth, newHeight);
+       FloatRectangle rect(0, 0, __width, __height);
 
        return rect;
 }
@@ -1269,6 +1268,14 @@ _EnrichedTextImpl::IndexOfFromLinkedList(TextElement& textElement, int& index)
 int
 _EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::Point& point) const
 {
+       FloatPoint pointF = _CoordinateSystemUtils::ConvertToFloat(point);
+
+       return GetTextElementIndexFromPosition(pointF);
+}
+
+int
+_EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::FloatPoint& point) const
+{
        _TextElementImpl* pElement = null;
        TextElementType type;
        int length = 0;
@@ -1315,13 +1322,6 @@ _EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::Point& point
        return -1;
 }
 
-int
-_EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::FloatPoint& point) const
-{
-       Point intPoint = _CoordinateSystemUtils::ConvertToInteger(point);
-       return GetTextElementIndexFromPosition(intPoint);
-}
-
 TextObject*
 _EnrichedTextImpl::GetTextObject(void) const
 {
@@ -1352,13 +1352,13 @@ _EnrichedTextImpl::GetTypeFromIndex(int textObjectIndex) const
 int
 _EnrichedTextImpl::GetIndexFromTouchPosition(int posX, int posY) const
 {
-       return __pTextObject->GetTextIndexFromPosition(posX, posY, true);
+       return GetIndexFromTouchPosition(_CoordinateSystemUtils::ConvertToFloat(posX), _CoordinateSystemUtils::ConvertToFloat(posY));
 }
 
 int
 _EnrichedTextImpl::GetIndexFromTouchPosition(float posX, float posY) const
 {
-       return GetIndexFromTouchPosition(_CoordinateSystemUtils::ConvertToInteger(posX), _CoordinateSystemUtils::ConvertToInteger(posY));
+       return __pTextObject->GetTextIndexFromPosition(posX, posY, true);
 }
 
 result
@@ -1597,11 +1597,11 @@ _EnrichedTextImpl::_EnrichedTextImpl(const _EnrichedTextImpl& rhs)
        SysTryReturnVoidResult(NID_GRP, rhs.__pTextObject, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not initialized.");
 
        result r = E_SUCCESS;
-       Dimension size = rhs.GetSize();
+       FloatDimension size = rhs.GetSizeF();
 
        __width = size.width;
        __height = size.height;
-       __lineSpace = GetLineSpace();
+       __lineSpace = GetLineSpaceF();
        __count = 0;
        __verticalAlignment = rhs.GetVerticalAlignment();
        __horizontalAlignment = rhs.GetHorizontalAlignment();
index b6b7fcc..de3593f 100644 (file)
@@ -162,9 +162,9 @@ public:
        static const _EnrichedTextImpl* GetInstance(const EnrichedText& enrichedText);
 
 private:
-       int __width;
-       int __height;
-       int __lineSpace;
+       float __width;
+       float __height;
+       float __lineSpace;
        int __count;
        TextVerticalAlignment __verticalAlignment;
        TextHorizontalAlignment __horizontalAlignment;
index 1f8c6c2..0ad7a58 100644 (file)
@@ -3550,6 +3550,8 @@ TextComposite::GetTextExtentList(TextLine* pTextLine) const
 CATCH:
        Release(pEnum);
 
+       Release(pGapListF);
+
        return r;
 }
 
index f7b8bb0..bf1f21f 100644 (file)
@@ -286,7 +286,7 @@ TextObject::Draw(_CanvasImpl& canvasImpl)
 {
        IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
 
-       if (__rect.width == 0 || __rect.height == 0)
+       if (__rect.width == 0.0f || __rect.height == 0.0f)
        {
                return E_SUCCESS;
        }
@@ -299,7 +299,7 @@ TextObject::Draw(_CanvasImpl& canvasImpl)
        float totalHeight = 0;
        float slidingWidth = 0;
 
-       SysTryReturn(NID_GRP, __rect.width > 0 && __rect.height > 0, E_INVALID_STATE, E_INVALID_STATE
+       SysTryReturn(NID_GRP, __rect.width > 0.0f && __rect.height > 0.0f, E_INVALID_STATE, E_INVALID_STATE
                        , "[E_INVALID_STATE] This instance is not constructed yet. (width = %d, height = %d)", __rect.width, __rect.height);
 
        r = Compose();
@@ -308,7 +308,7 @@ TextObject::Draw(_CanvasImpl& canvasImpl)
        if (__pTextColumn->GetTotalLineCount() <= 1)
        {
                __pTextColumn->SetFirstDisplayLineIndex(0);
-               __pTextColumn->SetFirstDisplayPositionY(0);
+               __pTextColumn->SetFirstDisplayPositionY(0.0f);
        }
 
        targetBounds = __rect;
@@ -342,7 +342,7 @@ TextObject::Draw(_CanvasImpl& canvasImpl)
                        break;
 
                case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-                       targetBounds.y += (targetBounds.height - totalHeight) / 2;
+                       targetBounds.y += (targetBounds.height - totalHeight) / 2.0f;
                        break;
 
                case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -407,7 +407,7 @@ TextObject::Draw(_CanvasImpl& canvasImpl)
                        break;
 
                case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-                       targetBounds.y += (targetBounds.height - totalHeight) / 2;
+                       targetBounds.y += (targetBounds.height - totalHeight) / 2.0f;
                        break;
 
                case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -426,7 +426,7 @@ CONTINUE_PROC:
        finalClipRect.width = (clipRect.x + clipRect.width > targetBounds.x + targetBounds.width) ? (targetBounds.x + targetBounds.width) - finalClipRect.x : (clipRect.x + clipRect.width) - finalClipRect.x;
        finalClipRect.height = (clipRect.y + clipRect.height > targetBounds.y + targetBounds.height) ? (targetBounds.y + targetBounds.height) - finalClipRect.y : (clipRect.y + clipRect.height) - finalClipRect.y;
 
-       SysTryReturn(NID_GRP, 0 <= finalClipRect.width && 0 <= finalClipRect.height, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle.");
+       SysTryReturn(NID_GRP, 0.0f <= finalClipRect.width && 0.0f <= finalClipRect.height, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle.");
 
        canvasImpl.SetClipBounds(finalClipRect);
 
@@ -477,7 +477,7 @@ CONTINUE_PROC:
        case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
        {
                FloatRectangle slidingRect = targetBounds;
-               slidingRect.y += __pTextColumn->GetSlidingPosition();
+               slidingRect.y += __pTextColumn->GetSlidingPositionF();
 
                int lineCount = __pTextColumn->GetTotalLineCount();
                for (int i = 0; i < lineCount; i++)
@@ -547,7 +547,7 @@ TextObject::DrawLine(_CanvasImpl& canvasImpl, int lineIndex)
        result r = E_SUCCESS;
        TextLine* pTextLine = null;
        FloatRectangle lineBounds;
-       int firstDisplayY = __pTextColumn->GetFirstDisplayPositionY();
+       float firstDisplayY = __pTextColumn->GetFirstDisplayPositionYF();
 
        r = Compose();
        SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -598,7 +598,7 @@ TextObject::DrawWithOffset(_CanvasImpl& canvasImpl)
                }
                else
                {
-                       if (0 < slidingStartIndex + slidingDim.width)
+                       if (0.0f < slidingStartIndex + slidingDim.width)
                        {
                                slidingStartIndex -= __slidingStep;
                        }
@@ -611,7 +611,7 @@ TextObject::DrawWithOffset(_CanvasImpl& canvasImpl)
                break;
 
        case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
-               if (slidingStartIndex + slidingDim.height >= 0)
+               if (slidingStartIndex + slidingDim.height >= 0.0f)
                {
                        slidingStartIndex -= __slidingStep;
                }
@@ -685,7 +685,7 @@ TextObject::Compose(void)
 {
        IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
 
-       SysTryReturn(NID_GRP, __rect.width >= 0 && __rect.height >= 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
+       SysTryReturn(NID_GRP, __rect.width >= 0.0f && __rect.height >= 0.0f, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
 
        int lineCount = 0;
        FloatRectangle rect = __rect;
@@ -715,7 +715,7 @@ TextObject::Compose(void)
        {
                __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_UNKONWN, 0, 0);
                __pTextColumn->SetFirstDisplayLineIndex(0);
-               __pTextColumn->SetFirstDisplayPositionY(0);
+               __pTextColumn->SetFirstDisplayPositionY(0.0f);
        }
 
        ResetSweepInfo();
@@ -734,7 +734,7 @@ TextObject::Compose(void)
                        if (lineLength < totalLength)
                        {
                                __isActionOn = true;
-                               __pTextColumn->SetSlidingPosition(0);
+                               __pTextColumn->SetSlidingPosition(0.0f);
 
                                FloatDimension slidingDim;
                                FloatDimension lineTextSize;
@@ -757,7 +757,7 @@ TextObject::Compose(void)
 
        case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
        {
-               __pTextColumn->SetSlidingPosition(0);
+               __pTextColumn->SetSlidingPosition(0.0f);
 
                float totalHeight = __pTextColumn->GetTotalHeightF();
                FloatDimension slidingDim;
@@ -847,8 +847,8 @@ TextObject::SetFirstDisplayLineIndex(int lineIndex)
        result r = E_SUCCESS;
        FloatRectangle lineBounds;
        TextLine* pTextLine = null;
-       float firstDisplayPositionY = 0;
-       float rollbackFirstDisplayPositionY = 0;
+       float firstDisplayPositionY = 0.0f;
+       float rollbackFirstDisplayPositionY = 0.0f;
        int rollbackFirstDisplayLineIndex = 0;
 
        rollbackFirstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
@@ -933,7 +933,7 @@ TextObject::IsDisplayedAtStartPosition(void) const
 
        float firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
 
-       bool isDisplayedAtStartPosition = (firstDisplayPositionY == 0) ? true : false;
+       bool isDisplayedAtStartPosition = (firstDisplayPositionY == 0.0f) ? true : false;
 
        return isDisplayedAtStartPosition;
 }
@@ -943,8 +943,8 @@ TextObject::IsDisplayedAtEndPosition(void) const
 {
        IF_NOT_CONSTRUCTED(return false);
 
-       float totalHeight = 0;
-       float firstDisplayPositionY = 0;
+       float totalHeight = 0.0f;
+       float firstDisplayPositionY = 0.0f;
 
        firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
        totalHeight = __pTextColumn->GetTotalHeightF();
@@ -1011,7 +1011,7 @@ TextObject::SetBounds(const FloatRectangle& rect)
 {
        IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
 
-       SysTryReturn(NID_GRP, (rect.width >= 0) && (rect.height >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
+       SysTryReturn(NID_GRP, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_OUT_OF_RANGE, E_OUT_OF_RANGE
                        , "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", rect.width, rect.height);
 
        if (__rect.width != rect.width)
@@ -1035,7 +1035,7 @@ TextObject::SetLineSpace(float lineSpacing)
 {
        IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
 
-       SysTryReturn(NID_GRP, lineSpacing >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. lineSpacing(%d)", lineSpacing);
+       SysTryReturn(NID_GRP, lineSpacing >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. lineSpacing(%d)", lineSpacing);
 
        if (__pCompositeText->GetLineSpace() != lineSpacing)
        {
@@ -1377,20 +1377,26 @@ TextObject::SetDefaultFontSize(float size)
 int
 TextObject::GetDefaultFontSize(void) const
 {
-       IF_NOT_CONSTRUCTED(return -1);
-
-       return _FontImpl::GetInstance(*__pDefaultFont)->GetSize();
+       return _CoordinateSystemUtils::ConvertToInteger(GetDefaultFontSizeF());
 }
 
 float
 TextObject::GetDefaultFontSizeF(void) const
 {
-       return _CoordinateSystemUtils::ConvertToFloat(GetDefaultFontSize());
+       IF_NOT_CONSTRUCTED(return -1);
+
+       return _FontImpl::GetInstance(*__pDefaultFont)->GetSizeF();
 }
 
 result
 TextObject::SetFontSize(int size, int startTextIndex, int textLength)
 {
+       return SetFontSize(_CoordinateSystemUtils::ConvertToFloat(size), startTextIndex, textLength);
+}
+
+result
+TextObject::SetFontSize(float size, int startTextIndex, int textLength)
+{
        IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
 
        SysTryReturn(NID_GRP
@@ -1404,14 +1410,14 @@ TextObject::SetFontSize(int size, int startTextIndex, int textLength)
        return E_SUCCESS;
 }
 
-result
-TextObject::SetFontSize(float size, int startTextIndex, int textLength)
+int
+TextObject::GetFontSize(int textIndex) const
 {
-       return SetFontSize(_CoordinateSystemUtils::ConvertToInteger(size),startTextIndex,textLength);
+       return _CoordinateSystemUtils::ConvertToInteger(GetFontSizeF(textIndex));
 }
 
-int
-TextObject::GetFontSize(int textIndex) const
+float
+TextObject::GetFontSizeF(int textIndex) const
 {
        IF_NOT_CONSTRUCTED(return -1);
 
@@ -1419,13 +1425,7 @@ TextObject::GetFontSize(int textIndex) const
                , textIndex >= 0
                , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
-       return __pCompositeText->GetFontSize(textIndex);
-}
-
-float
-TextObject::GetFontSizeF(int textIndex) const
-{
-       return _CoordinateSystemUtils::ConvertToFloat(GetFontSize(textIndex));
+       return __pCompositeText->GetFontSizeF(textIndex);
 }
 
 result
@@ -1841,7 +1841,7 @@ TextObject::GetTextIndexFromPositionAtLine(int lineIndex, float x, bool cursorMo
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               x -= (lineBounds.width - lineTextSize.width) / 2;
+               x -= (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -1849,7 +1849,7 @@ TextObject::GetTextIndexFromPositionAtLine(int lineIndex, float x, bool cursorMo
                break;
        }
 
-       x = (x < 0) ? 0 : x;
+       x = (x < 0.0f) ? 0.0f : x;
        __pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
 
        int endType = 0;
@@ -1970,8 +1970,8 @@ TextObject::GetCutLinkIndexFromPositionData(float x, float y) const
                return -1;
        }
 
-       float width = 0;
-       float height = 0;
+       float width = 0.0f;
+       float height = 0.0f;
        FloatPoint absPoint;
        FloatPoint relPoint;
 
@@ -2107,8 +2107,8 @@ TextObject::GetCutLinkBounds(int cutLinkIndex, FloatPoint& startPoint, FloatPoin
        result r = E_SUCCESS;
        int textIndex = 0;
        int textLength = 0;
-       float width = 0;
-       float heigth = 0;
+       float width = 0.0f;
+       float heigth = 0.0f;
        FloatPoint tempPoint;
 
        r = __pCompositeText->GetCutLinkObjectInfo(cutLinkIndex, textIndex, textLength);
@@ -2184,10 +2184,10 @@ TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, fl
                SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
 
                float maxHeight = TextUtility::GetFontMaxHeightF(pFont);
-               float posX = 0;
-               float posY = 0;
-               absX = 0;
-               absY = 0;
+               float posX = 0.0f;
+               float posY = 0.0f;
+               absX = 0.0f;
+               absY = 0.0f;
 
                if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
                {
@@ -2197,7 +2197,7 @@ TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, fl
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-                               posY += (__rect.height - maxHeight) / 2;
+                               posY += (__rect.height - maxHeight) / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2212,7 +2212,7 @@ TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, fl
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_CENTER:
-                               posX += __rect.width / 2;
+                               posX += __rect.width / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -2233,7 +2233,7 @@ TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, fl
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-                               posY += (lineHeight - maxHeight) / 2;
+                               posY += (lineHeight - maxHeight) / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2247,7 +2247,7 @@ TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, fl
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_CENTER:
-                               posX += __rect.width / 2;
+                               posX += __rect.width / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -2259,7 +2259,7 @@ TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, fl
                        logicalY = posY + __rect.y;
                }
 
-               width = 0;
+               width = 0.0f;
                height = maxHeight;
                absX = posX;
                absY = posY;
@@ -2311,10 +2311,10 @@ TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& heigh
                SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
 
                float maxHeight = TextUtility::GetFontMaxHeightF(pFont);
-               float posX = 0;
-               float posY = 0;
-               absX = 0;
-               absY = 0;
+               float posX = 0.0f;
+               float posY = 0.0f;
+               absX = 0.0f;
+               absY = 0.0f;
 
                if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
                {
@@ -2324,7 +2324,7 @@ TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& heigh
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-                               posY += (__rect.height - maxHeight) / 2;
+                               posY += (__rect.height - maxHeight) / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2339,7 +2339,7 @@ TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& heigh
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_CENTER:
-                               posX += __rect.width / 2;
+                               posX += __rect.width / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -2360,7 +2360,7 @@ TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& heigh
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-                               posY += (lineHeight - maxHeight) / 2;
+                               posY += (lineHeight - maxHeight) / 2.0f;
                                break;
 
                        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2372,7 +2372,7 @@ TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& heigh
                        logicalY = posY + __rect.y;
                }
 
-               width = 0;
+               width = 0.0f;
                height = maxHeight;
                absX = posX;
                absY = posY;
@@ -2464,7 +2464,7 @@ TextObject::GetTextIndexFromPositionInWrap(float x, float y, bool cursorMode) co
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               y -= (__rect.height - totalHeight) / 2;
+               y -= (__rect.height - totalHeight) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2517,7 +2517,7 @@ TextObject::GetTextIndexFromPositionInWrap(float x, float y, bool cursorMode) co
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               x -= (lineBounds.width - lineTextSize.width) / 2;
+               x -= (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -2525,9 +2525,9 @@ TextObject::GetTextIndexFromPositionInWrap(float x, float y, bool cursorMode) co
                break;
        }
 
-       if (x < 0)
+       if (x < 0.0f)
        {
-               x = 0;
+               x = 0.0f;
        }
 
        int index = pTextLine->GetTextIndexFromPosition(x, cursorMode);
@@ -2566,7 +2566,7 @@ TextObject::GetTextIndexFromPositionInNoneWrap(float x, float y, bool cursorMode
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               x -= (lineBounds.width - lineTextSize.width) / 2;
+               x -= (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -2580,7 +2580,7 @@ TextObject::GetTextIndexFromPositionInNoneWrap(float x, float y, bool cursorMode
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               y -= (__rect.height - lineTextSize.height) / 2;
+               y -= (__rect.height - lineTextSize.height) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2588,9 +2588,9 @@ TextObject::GetTextIndexFromPositionInNoneWrap(float x, float y, bool cursorMode
                break;
        }
 
-       if (x < 0)
+       if (x < 0.0f)
        {
-               x = 0;
+               x = 0.0f;
        }
 
        int index = pTextLine->GetTextIndexFromPosition(x, cursorMode);
@@ -2604,12 +2604,12 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
 {
        result r = E_SUCCESS;
        FloatRectangle lineBounds;
-       float firstDisplayPositionY = 0;
+       float firstDisplayPositionY = 0.0f;
        int currentTextIndex = textIndex;
        int firstDisplayLineIndex = 0;
        int lineIndex = 0;
        int lineCount = 0;
-       float remainingHeight = 0;
+       float remainingHeight = 0.0f;
        TextLine* pTextLine = null;
        bool isChanged = false;
 
@@ -2640,9 +2640,9 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
 
                remainingHeight = __rect.height;
 
-               while ((remainingHeight != 0) && firstDisplayLineIndex < lineCount)
+               while ((remainingHeight != 0.0f) && firstDisplayLineIndex < lineCount)
                {
-                       if (remainingHeight < 0)
+                       if (remainingHeight < 0.0f)
                        {
                                break;
                        }
@@ -2662,7 +2662,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
 
                if (lineIndex < firstDisplayLineIndex + displayLineCount)
                {
-                       if (0 < remainingHeight && 0 < firstDisplayLineIndex)
+                       if (0.0f < remainingHeight && 0 < firstDisplayLineIndex)
                        {
                                pTextLine = __pTextColumn->GetTextLine(firstDisplayLineIndex - 1);
                                SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
@@ -2672,7 +2672,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
                                        lineBounds = pTextLine->GetBoundsF();
                                        remainingHeight -= lineBounds.height;
 
-                                       if (remainingHeight < 0)
+                                       if (remainingHeight < 0.0f)
                                        {
                                                firstDisplayPositionY = lineBounds.y + remainingHeight;
                                                displayLineCount++;
@@ -2692,7 +2692,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
 
                                isChanged = true;
                        }
-                       else if (remainingHeight < 0 && (lineIndex == firstDisplayLineIndex + displayLineCount - 1))
+                       else if (remainingHeight < 0.0f && (lineIndex == firstDisplayLineIndex + displayLineCount - 1))
                        {
                                pTextLine = __pTextColumn->GetTextLine(lineIndex);
                                SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
@@ -2707,7 +2707,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
                                int currentLineIndex = lineIndex - 1;
                                pTextLine = __pTextColumn->GetTextLine(currentLineIndex);
 
-                               while ((pTextLine != null) && 0 < firstDisplayLineIndex && 0 < remainingHeight)
+                               while ((pTextLine != null) && 0 < firstDisplayLineIndex && 0.0f < remainingHeight)
                                {
                                        lineBounds = pTextLine->GetBoundsF();
 
@@ -2745,7 +2745,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
                        int currentLineIndex = lineIndex - 1;
                        pTextLine = __pTextColumn->GetTextLine(currentLineIndex);
 
-                       while (pTextLine && 0 < firstDisplayLineIndex && 0 < remainingHeight)
+                       while (pTextLine && 0 < firstDisplayLineIndex && 0.0f < remainingHeight)
                        {
                                lineBounds = pTextLine->GetBoundsF();
 
@@ -2823,7 +2823,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInNoneWrap(int textIndex)
                                                                                __wrap, lineLength, lineTextSize.width, lineTextSize.height);
 
                lineBounds.height = (lineBounds.height > lineTextSize.height) ? lineBounds.height : lineTextSize.height;
-               if (lineBounds.height == 0)
+               if (lineBounds.height == 0.0f)
                {
                        lineBounds.height = TextUtility::GetFontMaxHeightF(pFont);
                }
@@ -2835,9 +2835,9 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInNoneWrap(int textIndex)
        }
        else if (lineEndIndex <= currentTextIndex)
        {
-               float gapWidth = 0;
-               float gapHeight = 0;
-               float tempWidth = 0;
+               float gapWidth = 0.0f;
+               float gapHeight = 0.0f;
+               float tempWidth = 0.0f;
                int textCount = 0;
 
                r = __pCompositeText->GetRegion(lineEndIndex, currentTextIndex - lineEndIndex, gapWidth, gapHeight);
@@ -2861,7 +2861,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInNoneWrap(int textIndex)
                                                                                __wrap, lineLength, lineTextSize.width, lineTextSize.height);
 
                lineBounds.height = (lineBounds.height > lineTextSize.height) ? lineBounds.height: lineTextSize.height;
-               if (lineBounds.height == 0)
+               if (lineBounds.height == 0.0f)
                {
                        lineBounds.height = TextUtility::GetFontMaxHeightF(pFont);
                }
@@ -2874,7 +2874,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInNoneWrap(int textIndex)
        }
 
        __pTextColumn->SetFirstDisplayLineIndex(0);
-       __pTextColumn->SetFirstDisplayPositionY(0);
+       __pTextColumn->SetFirstDisplayPositionY(0.0f);
 
        return E_SUCCESS;
 }
@@ -2915,9 +2915,9 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& heig
        int lineOffset = 0;
        int lineLength = 0;
        int textIndexFromLineOffset = 0;
-       float lineY = 0;
-       float posX = 0;
-       float posY = 0;
+       float lineY = 0.0f;
+       float posX = 0.0f;
+       float posY = 0.0f;
 
        _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
        SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
@@ -2967,7 +2967,7 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& heig
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               posX += (lineBounds.width - lineTextSize.width) / 2;
+               posX += (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -2981,7 +2981,7 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& heig
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2;
+               posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -2989,21 +2989,21 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& heig
                break;
        }
 
-       if (posX < 0)
+       if (posX < 0.0f)
        {
-               posX = 0;
+               posX = 0.0f;
        }
 
-       if (posY < 0)
+       if (posY < 0.0f)
        {
-               posY = 0;
+               posY = 0.0f;
        }
 
        FloatRectangle textExtent = pTextLine->GetTextExtentF(textIndexFromLineOffset, 1);
 
        if (lineIndex == lineCount)
        {
-               textExtent.width = 0;
+               textExtent.width = 0.0f;
        }
 
        if (textIndex >= 1)
@@ -3012,7 +3012,7 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& heig
                textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
        }
 
-       if (textExtent.height < 0)
+       if (textExtent.height < 0.0f)
        {
                textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
        }
@@ -3026,7 +3026,7 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& heig
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               lineY = lineY + (lineBounds.height - textExtent.height) / 2;
+               lineY = lineY + (lineBounds.height - textExtent.height) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -3080,9 +3080,9 @@ TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float&
        int lineOffset = 0;
        int lineLength = 0;
        int textIndexFromLineOffset = 0;
-       float lineY = 0;
-       float posX = 0;
-       float posY = 0;
+       float lineY = 0.0f;
+       float posX = 0.0f;
+       float posY = 0.0f;
 
        _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
        SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
@@ -3118,12 +3118,12 @@ TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float&
                textIndexFromLineOffset = textIndex - lineOffset;
        }
 
-       Dimension lineTextSize;
+       FloatDimension lineTextSize;
        pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
 
-       if (lineTextSize.height == 0)
+       if (lineTextSize.height == 0.0f)
        {
-               lineTextSize.height = TextUtility::GetFontMaxHeight(pFont);
+               lineTextSize.height = TextUtility::GetFontMaxHeightF(pFont);
        }
 
        switch (__align & TEXT_ALIGNMASK_HORIZ)
@@ -3132,7 +3132,7 @@ TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float&
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               posX += (lineBounds.width - lineTextSize.width) / 2;
+               posX += (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -3146,29 +3146,29 @@ TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float&
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               posY += (__rect.height - __pTextColumn->GetDisplayHeight()) / 2;
+               posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
-               posY += (__rect.height - __pTextColumn->GetDisplayHeight());
+               posY += (__rect.height - __pTextColumn->GetDisplayHeightF());
                break;
        }
 
-       if (posX < 0)
+       if (posX < 0.0f)
        {
-               posX = 0;
+               posX = 0.0f;
        }
 
-       if (posY < 0)
+       if (posY < 0.0f)
        {
-               posY = 0;
+               posY = 0.0f;
        }
 
        FloatRectangle textExtent = pTextLine->GetBlockTextExtentF(textIndexFromLineOffset, 1);
 
        if (lineIndex == lineCount)
        {
-               textExtent.width = 0;
+               textExtent.width = 0.0f;
        }
 
        if (textIndex >= 1)
@@ -3191,7 +3191,7 @@ TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float&
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               lineY = lineY + (lineBounds.height - textExtent.height) / 2;
+               lineY = lineY + (lineBounds.height - textExtent.height) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -3242,8 +3242,8 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
        SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
 
        int lineLength = pTextLine->GetTextLength();
-       float posX = 0;
-       float posY = 0;
+       float posX = 0.0f;
+       float posY = 0.0f;
 
        _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
        SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
@@ -3253,7 +3253,7 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
        lineBounds = pTextLine->GetBoundsF();
        pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
 
-       if (lineTextSize.height == 0 || pTextLine->GetTextLength() == 0)
+       if (lineTextSize.height == 0.0f || pTextLine->GetTextLength() == 0.0f)
        {
                lineTextSize.height = TextUtility::GetFontMaxHeightF(pFont);
        }
@@ -3264,7 +3264,7 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               posX += (lineBounds.width - lineTextSize.width) / 2;
+               posX += (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT:
@@ -3278,7 +3278,7 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               posY += (__rect.height - lineTextSize.height) / 2;
+               posY += (__rect.height - lineTextSize.height) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -3286,8 +3286,8 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
                break;
        }
 
-       posX = (posX < 0) ? 0 : posX;
-       posY = (posY < 0) ? 0 : posY;
+       posX = (posX < 0.0f) ? 0.0f : posX;
+       posY = (posY < 0.0f) ? 0.0f : posY;
 
        FloatRectangle textExtent = pTextLine->GetTextExtentF(textIndex - pTextLine->GetTextOffset(), 1);
 
@@ -3297,7 +3297,7 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
                textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
        }
 
-       if (textExtent.height < 0)
+       if (textExtent.height < 0.0f)
        {
                textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
        }
@@ -3311,7 +3311,7 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
                break;
 
        case TEXT_OBJECT_ALIGNMENT_MIDDLE:
-               posY = posY + (lineBounds.height - textExtent.height) / 2;
+               posY = posY + (lineBounds.height - textExtent.height) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_BOTTOM:
@@ -3320,7 +3320,7 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
        }
 
        absX = posX + textExtent.x;
-       logicalX = (absX >= 0) ? absX + __rect.x : absX;
+       logicalX = (absX >= 0.0f) ? absX + __rect.x : absX;
        absY = posY;
        logicalY = absY + __rect.y;
        width = textExtent.width;
@@ -3332,13 +3332,13 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float&
 int
 TextObject::GetTotalComposedHeight(void) const
 {
-       return __pCompositeText->GetTotalComposedHeight();
+       return _CoordinateSystemUtils::ConvertToInteger(GetTotalComposedHeightF());
 }
 
 float
 TextObject::GetTotalComposedHeightF(void) const
 {
-       return _CoordinateSystemUtils::ConvertToFloat(GetTotalComposedHeight());
+       return __pCompositeText->GetTotalComposedHeightF();
 }
 
 int
@@ -3382,7 +3382,7 @@ TextObject::GetTotalHeightF(void) const
 {
        IF_NOT_CONSTRUCTED(return -1);
 
-       float height = 0;
+       float height = 0.0f;
        if (IsPartialComposingModeEnabled())
        {
                height = __pCompositeText->GetAnalysedTotalHeightF();
@@ -3551,7 +3551,7 @@ TextObject::GetTextLengthAt(int lineIndex) const
 Rectangle
 TextObject::GetBounds(void) const
 {
-       IF_NOT_CONSTRUCTED(return Rectangle(0,0,0,0));
+       IF_NOT_CONSTRUCTED(return Rectangle(0, 0, 0, 0));
 
        return _CoordinateSystemUtils::ConvertToInteger(__rect);
 }
@@ -3559,7 +3559,7 @@ TextObject::GetBounds(void) const
 FloatRectangle
 TextObject::GetBoundsF(void) const
 {
-       return _CoordinateSystemUtils::ConvertToFloat(GetBounds());
+       return __rect;
 }
 
 int
@@ -3567,13 +3567,15 @@ TextObject::GetLineSpace(void) const
 {
        IF_NOT_CONSTRUCTED(return -1);
 
-       return __pCompositeText->GetLineSpace();
+       return _CoordinateSystemUtils::ConvertToInteger(GetLineSpaceF());
 }
 
 float
 TextObject::GetLineSpaceF(void) const
 {
-       return _CoordinateSystemUtils::ConvertToFloat(GetLineSpace());
+       IF_NOT_CONSTRUCTED(return -1);
+
+       return __pCompositeText->GetLineSpaceF();
 }
 
 int
@@ -3974,7 +3976,7 @@ TextObject::GetDisplayPositionAtLineF(int lineIndex, int textIndexFromLineOffset
                break;
 
        case TEXT_OBJECT_ALIGNMENT_CENTER:
-               extentDim.width += (lineBounds.width - lineTextSize.width) / 2;
+               extentDim.width += (lineBounds.width - lineTextSize.width) / 2.0f;
                break;
 
        case TEXT_OBJECT_ALIGNMENT_RIGHT: