, __lineJoinStyle(LINE_JOIN_STYLE_ROUND)
, __isClipBoundsSet(false)
, __textOrigin(TEXT_ORIGIN_LEFT_TOP)
- , __textBidiHint(TEXT_BIDI_HINT_NONE)
, __applyEmoji(true)
, __bitmapDrawingQuality(BITMAP_DRAWING_QUALITY_LOW)
, __compositeMode(COMPOSITE_MODE_SRC_OVER)
bool __isClipBoundsSet;
Rectangle __clipBounds;
TextOrigin __textOrigin;
- TextBidiHint __textBidiHint;
bool __applyEmoji;
struct
}
}
-void
-_CanvasImpl::SetTextBidiHint(TextBidiHint bidiHint)
-{
- if (INSTANCE_IS_VALID)
- {
- switch (bidiHint)
- {
- case TEXT_BIDI_HINT_NONE:
- case TEXT_BIDI_HINT_LTR:
- case TEXT_BIDI_HINT_RTL:
- this->_pNativeCanvas->__textBidiHint = bidiHint;
- break;
- }
- }
-}
-
result
_CanvasImpl::SetClipBounds(const Rectangle& vcRect)
{
}
+namespace Tizen { namespace Graphics { namespace _Util
+{
+
+template <>
+inline Tizen::Graphics::_TextBidiProperty::BidiHint Convert<Tizen::Graphics::TextBidiHint, Tizen::Graphics::_TextBidiProperty::BidiHint>(const Tizen::Graphics::TextBidiHint& bidiHint)
+{
+ switch (bidiHint)
+ {
+ case TEXT_BIDI_HINT_LTR:
+ return _TextBidiProperty::BIDI_HINT_LTR;
+ case TEXT_BIDI_HINT_RTL:
+ return _TextBidiProperty::BIDI_HINT_RTL;
+ default:
+ return _TextBidiProperty::BIDI_HINT_NONE;
+ }
+}
+
+}}} // Tizen::Graphics::_Util
+
+
namespace Tizen { namespace Graphics
{
return E_SUCCESS;
}
- _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length);
+ _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length, _Util::Convert<TextBidiHint, _TextBidiProperty::BidiHint>(_GetTextBidiHint()));
if (bidiProperty.HasBidi())
{
while (right - left > width)
{
- _TextBidiPropertyWithReorder determinedBidiProperty(text.pStart, --tempCount);
+ _TextBidiPropertyWithReorder determinedBidiProperty(text.pStart, --tempCount, _Util::Convert<TextBidiHint, _TextBidiProperty::BidiHint>(_GetTextBidiHint()));
GapList determinedGapList;
return E_SUCCESS;
}
- _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length);
+ _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length, _Util::Convert<TextBidiHint, _TextBidiProperty::BidiHint>(_GetTextBidiHint()));
if (bidiProperty.HasBidi())
{
unsigned long canvasFgColor = canvas.__fgColor;
- _TextBidiPropertyWithReorder bidiProperty(pText, length);
+ _TextBidiPropertyWithReorder bidiProperty(pText, length, _Util::Convert<TextBidiHint, _TextBidiProperty::BidiHint>(_GetTextBidiHint()));
if (bidiProperty.HasBidi())
{
////////////////
BidiParagraph*
-_GetBidiParagraphProperty(const wchar_t* pText, size_t len, int* pSegmentIndex)
+_GetBidiParagraphProperty(const wchar_t* pText, size_t len, int* pSegmentIndex, Tizen::Graphics::_TextBidiProperty::BidiHint hint)
{
#define CHECK_IF(cond) if (!(cond)) return NULL
{
FriBidiParType direction = FRIBIDI_PAR_ON;
- for (size_t i = 0; i < len; i++)
+ switch (hint)
{
- if (FRIBIDI_IS_STRONG(bidiProperty->pCharTypes[i]))
+ case Tizen::Graphics::_TextBidiProperty::BIDI_HINT_LTR:
+ direction = FRIBIDI_PAR_LTR;
+ break;
+ case Tizen::Graphics::_TextBidiProperty::BIDI_HINT_RTL:
+ direction = FRIBIDI_PAR_RTL;
+ break;
+ default:
+ for (size_t i = 0; i < len; i++)
{
- if (FRIBIDI_IS_RTL(bidiProperty->pCharTypes[i]))
+ if (FRIBIDI_IS_STRONG(bidiProperty->pCharTypes[i]))
{
- direction = FRIBIDI_PAR_RTL;
- }
- else
- {
- direction = FRIBIDI_PAR_LTR;
- }
+ if (FRIBIDI_IS_RTL(bidiProperty->pCharTypes[i]))
+ {
+ direction = FRIBIDI_PAR_RTL;
+ }
+ else
+ {
+ direction = FRIBIDI_PAR_LTR;
+ }
- break;
+ break;
+ }
}
+ break;
}
bidiProperty->direction = direction;
namespace Tizen { namespace Graphics
{
-_TextBidiProperty::_TextBidiProperty(const wchar_t* pText, int length)
+_TextBidiProperty::_TextBidiProperty(const wchar_t* pText, int length, BidiHint hint)
: pEventText(0)
, pCharType(0)
, pEmbeddingLevels(0)
, length(0)
, pReserved(0)
{
- BidiParagraph* pBidiProperty = _GetBidiParagraphProperty(pText, length, NULL);
+ BidiParagraph* pBidiProperty = _GetBidiParagraphProperty(pText, length, NULL, hint);
if (pBidiProperty)
{
}
}
-_TextBidiPropertyWithReorder::_TextBidiPropertyWithReorder(const wchar_t* pText, int length)
- : _TextBidiProperty(pText, length)
+_TextBidiPropertyWithReorder::_TextBidiPropertyWithReorder(const wchar_t* pText, int length, BidiHint hint)
+ : _TextBidiProperty(pText, length, hint)
, pBidiIndex(0)
, __pReorderedText(0)
{
struct _TextBidiProperty
{
+ enum BidiHint
+ {
+ BIDI_HINT_NONE,
+ BIDI_HINT_LTR,
+ BIDI_HINT_RTL
+ };
+
const wchar_t* pEventText;
const FriBidiCharType* pCharType;
const FriBidiLevel* pEmbeddingLevels;
int length;
void* pReserved;
- _TextBidiProperty(const wchar_t* pText, int length);
+ _TextBidiProperty(const wchar_t* pText, int length, BidiHint hint = BIDI_HINT_NONE);
_TextBidiProperty(const _TextBidiProperty& refBidiProperty, int offset, int length);
virtual ~_TextBidiProperty(void);
{
const FriBidiStrIndex* pBidiIndex;
- _TextBidiPropertyWithReorder(const wchar_t* pText, int length);
+ _TextBidiPropertyWithReorder(const wchar_t* pText, int length, BidiHint hint = BIDI_HINT_NONE);
_TextBidiPropertyWithReorder(const _TextBidiProperty& refBidiProperty, int offset, int length);
virtual ~_TextBidiPropertyWithReorder(void);
{
IF_NOT_CONSTRUCTED(return -1);
- int pcMaxHeight = ceil(_pNativeFont->GetMaxHeight().ToDouble());
+ int pcMaxHeight = _DoubleToIntForPos(ceil(_pNativeFont->GetMaxHeight().ToDouble()));
for (int i = pcMaxHeight; i < INT_MAX; i++)
{
{
IF_NOT_CONSTRUCTED(return -1.0f);
- float pcMaxHeight = ceil(_pNativeFont->GetMaxHeight().ToDouble());
+ float pcMaxHeight = float(ceil(_pNativeFont->GetMaxHeight().ToDouble()));
float vcMaxHeight = _ResUtil::ConvertToVirCoordY(pcMaxHeight);
return vcMaxHeight;
{
IF_NOT_CONSTRUCTED(return -1);
- int pcLeading = ceil(_pNativeFont->GetLeading().ToDouble());
+ int pcLeading = _DoubleToIntForPos(ceil(_pNativeFont->GetLeading().ToDouble()));
for (int i = pcLeading; i < INT_MAX; i++)
{
{
IF_NOT_CONSTRUCTED(return -1.0f);
- float pcLeading = ceil(_pNativeFont->GetLeading().ToDouble());
+ float pcLeading = float(ceil(_pNativeFont->GetLeading().ToDouble()));
float vcLeading = _ResUtil::ConvertToVirCoordY(pcLeading);
return vcLeading;
}} // Tizen::Graphics
+namespace Tizen { namespace Graphics
+{
+
+TextBidiHint _bidiHint = TEXT_BIDI_HINT_NONE;
+
+void
+_SetTextBidiHint(TextBidiHint bidiHint)
+{
+ switch (bidiHint)
+ {
+ case TEXT_BIDI_HINT_NONE:
+ case TEXT_BIDI_HINT_LTR:
+ case TEXT_BIDI_HINT_RTL:
+ _bidiHint = bidiHint;
+ break;
+ }
+}
+
+TextBidiHint
+_GetTextBidiHint(void)
+{
+ return _bidiHint;
+}
+
+}} // Tizen::Graphics
////////////////////////////////////////////////////////////////////////////////
//
TEXT_ORIGIN_BASELINE
};
-enum TextBidiHint
-{
- TEXT_BIDI_HINT_NONE,
- TEXT_BIDI_HINT_LTR,
- TEXT_BIDI_HINT_RTL
-};
-
class _OSP_EXPORT_ _CanvasImpl
: public Tizen::Base::Object
{
Font* GetFontN(void);
void SetTextOrigin(TextOrigin origin);
- void SetTextBidiHint(TextBidiHint bidiHint);
result DrawText(const Point& point, const Tizen::Base::String& text);
result DrawText(const Point& point, const Tizen::Base::String& text, int startIndex, int length);
}; // _FontImpl
+enum TextBidiHint
+{
+ TEXT_BIDI_HINT_NONE,
+ TEXT_BIDI_HINT_LTR,
+ TEXT_BIDI_HINT_RTL
+};
+
+_OSP_EXPORT_ void _SetTextBidiHint(TextBidiHint bidiHint);
+_OSP_EXPORT_ TextBidiHint _GetTextBidiHint(void);
+
}} // Tizen::Graphics
#endif // _FGRP_INTERNAL_FONT_IMPL_H_