[Issue#] N_SE-51504
[Problem] Search box of google.com not displayed properly when the display language is Arabic and the region is Arabic.
[Cause] Average Char width was not picked.
[Solution] Added code to calculate Average Width from Space.
[Developer] h.joshi@samsung.com
Change-Id: Ia27ea4e70bffac311223a5e94c6f52a169811a52
#if USE(FREETYPE)
#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 1 /* 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_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*/
if (m_avgCharWidth <= 0.f)
m_avgCharWidth = m_fontMetrics.xHeight();
+#if ENABLE(TIZEN_CHECK_SPACE_FOR_AVG_CHAR_WIDTH)
+ if (m_avgCharWidth <= 0.f) {
+ Glyph spaceGlyph = glyphPageZero->glyphDataForCharacter(' ').glyph;
+ m_avgCharWidth = widthForGlyph(spaceGlyph);
+ }
+#endif
+
if (m_maxCharWidth <= 0.f)
m_maxCharWidth = max(m_avgCharWidth, m_fontMetrics.floatAscent());
}