fix bidi font cache bug
authorSungyeon Woo <s.woo@samsung.com>
Fri, 12 Apr 2013 04:24:23 +0000 (13:24 +0900)
committerSungyeon Woo <s.woo@samsung.com>
Fri, 12 Apr 2013 04:48:43 +0000 (13:48 +0900)
Change-Id: If1d14c95fec00da0d467dca6af449d42e723ac3c
Signed-off-by: Sungyeon Woo <s.woo@samsung.com>
src/graphics/FGrp_FontFt2.cpp

index 509321e..a040269 100644 (file)
@@ -937,7 +937,20 @@ _FontFt2::GetGlyphList(const _Util::String& reorderedText, Tizen::Base::Collecti
 
                if (rtn)
                {
-                       out.Add(pFontGlyphData);
+                       int bufferSize = sizeof(_IFont::Glyph) + (pFontGlyphData->image.bytesPerLine * pFontGlyphData->image.height);
+
+                       _IFont::Glyph* pTempGlyphData = (_IFont::Glyph*) new (std::nothrow) char[bufferSize];
+
+                       if (pTempGlyphData)
+                       {
+                               memcpy(pTempGlyphData, pFontGlyphData, bufferSize);
+
+                               pTempGlyphData->image.pBitmap = (unsigned char*)(pTempGlyphData + 1);
+                               pTempGlyphData->hasOwnerShip = 1;
+
+                               out.Add(pTempGlyphData);
+                       }
+
                        continue;
                }