Revert "[Tizen] Add text wrapping hyphen mode support"
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / text-typesetter.cpp
index 40d96b8..60888db 100644 (file)
@@ -618,9 +618,6 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
   const Vector2* const    positionBuffer     = mModel->GetLayout();
   const Vector4* const    colorsBuffer       = mModel->GetColors();
   const ColorIndex* const colorIndexBuffer   = mModel->GetColorIndices();
-  const GlyphInfo*        hyphens            = mModel->GetHyphens();
-  const Length*           hyphenIndices      = mModel->GetHyphenIndices();
-  const Length            hyphensCount       = mModel->GetHyphensCount();
 
   // Whether to use the default color.
   const bool     useDefaultColor = (NULL == colorsBuffer);
@@ -646,8 +643,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
   }
 
   // Get a handle of the font client. Used to retrieve the bitmaps of the glyphs.
-  TextAbstraction::FontClient fontClient  = TextAbstraction::FontClient::Get();
-  Length                      hyphenIndex = 0;
+  TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
 
   // Traverses the lines of the text.
   for(LineIndex lineIndex = 0u; lineIndex < modelNumberOfLines; ++lineIndex)
@@ -712,7 +708,6 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
     float lineExtentLeft  = bufferWidth;
     float lineExtentRight = 0.0f;
     float baseline        = 0.0f;
-    bool  addHyphen       = false;
 
     // Traverses the glyphs of the line.
     const GlyphIndex endGlyphIndex = std::min(numberOfGlyphs, line.glyphRun.glyphIndex + line.glyphRun.numberOfGlyphs);
@@ -725,17 +720,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
       }
 
       // Retrieve the glyph's info.
-      const GlyphInfo* glyphInfo;
-
-      if(addHyphen && hyphens)
-      {
-        glyphInfo = hyphens + hyphenIndex;
-        hyphenIndex++;
-      }
-      else
-      {
-        glyphInfo = glyphsBuffer + glyphIndex;
-      }
+      const GlyphInfo* const glyphInfo = glyphsBuffer + glyphIndex;
 
       if((glyphInfo->width < Math::MACHINE_EPSILON_1000) ||
          (glyphInfo->height < Math::MACHINE_EPSILON_1000))
@@ -755,29 +740,21 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
       } // underline
 
       // Retrieves the glyph's position.
-      Vector2 position = *(positionBuffer + glyphIndex);
-
-      if(addHyphen)
-      {
-        GlyphInfo tempInfo = *(glyphsBuffer + glyphIndex);
-        position.x         = position.x + tempInfo.advance - tempInfo.xBearing + glyphInfo->xBearing;
-        position.y         = -glyphInfo->yBearing;
-      }
-
-      if(baseline < position.y + glyphInfo->yBearing)
+      const Vector2* const position = positionBuffer + glyphIndex;
+      if(baseline < position->y + glyphInfo->yBearing)
       {
-        baseline = position.y + glyphInfo->yBearing;
+        baseline = position->y + glyphInfo->yBearing;
       }
 
       // Calculate the positions of leftmost and rightmost glyphs in the current line
-      if(position.x < lineExtentLeft)
+      if(position->x < lineExtentLeft)
       {
-        lineExtentLeft = position.x;
+        lineExtentLeft = position->x;
       }
 
-      if(position.x + glyphInfo->width > lineExtentRight)
+      if(position->x + glyphInfo->width > lineExtentRight)
       {
-        lineExtentRight = position.x + glyphInfo->width;
+        lineExtentRight = position->x + glyphInfo->width;
       }
 
       // Retrieves the glyph's color.
@@ -835,7 +812,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
 
         // Set the buffer of the glyph's bitmap into the final bitmap's buffer
         TypesetGlyph(glyphData,
-                     &position,
+                     position,
                      &color,
                      style,
                      pixelFormat);
@@ -851,17 +828,6 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
         delete[] glyphData.glyphBitmap.buffer;
         glyphData.glyphBitmap.buffer = NULL;
       }
-
-      while((hyphenIndex < hyphensCount) && (glyphIndex > hyphenIndices[hyphenIndex]))
-      {
-        hyphenIndex++;
-      }
-
-      addHyphen = ((hyphenIndex < hyphensCount) && hyphenIndices && ((glyphIndex + 1) == hyphenIndices[hyphenIndex]));
-      if(addHyphen)
-      {
-        glyphIndex--;
-      }
     }
 
     // Draw the underline from the leftmost glyph to the rightmost glyph