#define ENABLE_TIZEN_FT_EMBOLDEN_FOR_SYNTHETIC_BOLD 1 /*Younghwan Cho(yhwan.cho@samsung.com) : Use freetype's 'embolden' instead of drawing twice for synthetic bold*/
#endif
#define ENABLE_TIZEN_CHECK_SPACE_FOR_AVG_CHAR_WIDTH 0 /* Himanshu Joshi (h.joshi@samsung.com : Added check to consider Space as possible way to calculate Average Char Width if '0' and 'x' are not present*/
+#define ENABLE_TIZEN_MIRROR_CHECK_FOR_RTL 1 /* Rachit Puri(rachit.puri@samsung.com) : Added mirror check for RTL */
#define ENABLE_TIZEN_ADD_AA_CONDITIONS_FOR_NINE_PATCH 1 /*Younghwan Cho(yhwan.cho@samsung.com) : Add conditions of antialias for fixing 9patch-problem */
#define ENABLE_TIZEN_WEBKIT_OWN_FONT_FILES 0 /*Younghwan Cho(yhwan.cho@samsung.com) : webkit's font-config is seperated from the system font's*/
return position;
}
+#if ENABLE(TIZEN_MIRROR_CHECK_FOR_RTL)
+static void normalizeCharacters(const UChar* source, UChar* destination, int length, bool isRTL = false)
+#else
static void normalizeCharacters(const UChar* source, UChar* destination, int length)
+#endif
{
int position = 0;
bool error = false;
character = ' ';
else if (Font::treatAsZeroWidthSpaceInComplexScript(character))
character = zeroWidthSpace;
+#if ENABLE(TIZEN_MIRROR_CHECK_FOR_RTL)
+ else if (isRTL)
+ character = u_charMirror(character);
+#endif
U16_APPEND(destination, position, length, character, error);
ASSERT_UNUSED(error, !error);
position = nextPosition;
{
m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
m_normalizedBufferLength = m_run.length();
+#if ENABLE(TIZEN_MIRROR_CHECK_FOR_RTL)
+ normalizeCharacters(m_run.characters(), m_normalizedBuffer.get(), m_normalizedBufferLength, m_run.rtl());
+#else
normalizeCharacters(m_run.characters(), m_normalizedBuffer.get(), m_normalizedBufferLength);
+#endif
setPadding(m_run.expansion());
setFontFeatures();
}