+ return renderer.Render(rendererParameters);
+}
+
+Devel::PixelBuffer Render(const RendererParameters& textParameters, Vector<EmbeddedItemInfo>& embeddedItemLayout)
+{
+ if(textParameters.text.empty())
+ {
+ Dali::Devel::PixelBuffer pixelBuffer = Dali::Devel::PixelBuffer::New(textParameters.textWidth,
+ textParameters.textHeight,
+ Dali::Pixel::RGBA8888);
+
+ const unsigned int bufferSize = textParameters.textWidth * textParameters.textHeight * Dali::Pixel::GetBytesPerPixel(Dali::Pixel::RGBA8888);
+ unsigned char* buffer = pixelBuffer.GetBuffer();
+ memset(buffer, 0, bufferSize);
+
+ return pixelBuffer;
+ }
+
+ FontClient fontClient = FontClient::Get();
+ MetricsPtr metrics;
+ // Use this to access FontClient i.e. to get down-scaled Emoji metrics.
+ metrics = Metrics::New(fontClient);
+
+ Text::ModelPtr textModel = Text::Model::New();
+ InternalDataModel internalData(fontClient, metrics, textModel);
+
+ TextAbstraction::TextRenderer::Parameters rendererParameters(internalData.textModel->mVisualModel->mGlyphs,
+ internalData.textModel->mVisualModel->mGlyphPositions,
+ internalData.textModel->mVisualModel->mColors,
+ internalData.textModel->mVisualModel->mColorIndices,
+ internalData.blendingMode,
+ internalData.isEmoji);
+
+ rendererParameters.width = textParameters.textWidth;
+ rendererParameters.height = textParameters.textHeight;
+ rendererParameters.pixelFormat = TextAbstraction::TextRenderer::Parameters::RGBA8888; // @note: At the moment all textures are generated RGBA8888
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Process the markup string if the mark-up processor is enabled.
+ ////////////////////////////////////////////////////////////////////////////////
+ ShapeTextPreprocess(textParameters, rendererParameters, internalData);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Retrieve the glyphs. Text shaping
+ ////////////////////////////////////////////////////////////////////////////////
+ ShapeText(rendererParameters, embeddedItemLayout, internalData);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Retrieve the glyph's metrics.
+ ////////////////////////////////////////////////////////////////////////////////
+
+ metrics->GetGlyphMetrics(rendererParameters.glyphs.Begin(), internalData.numberOfGlyphs);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Set the color runs in glyphs.
+ ////////////////////////////////////////////////////////////////////////////////
+ SetColorSegmentation(textParameters, internalData);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Set the isEmoji Vector
+ ////////////////////////////////////////////////////////////////////////////////
+ SetEmojiVector(internalData);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Layout the text
+ ////////////////////////////////////////////////////////////////////////////////
+ Size newLayoutSize = LayoutText(textParameters, rendererParameters, embeddedItemLayout, internalData);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Align the text.
+ ////////////////////////////////////////////////////////////////////////////////
+ Align(textParameters, rendererParameters, embeddedItemLayout, internalData, newLayoutSize);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Ellipsis the text.
+ ////////////////////////////////////////////////////////////////////////////////
+ Ellipsis(textParameters, rendererParameters, embeddedItemLayout, internalData);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Render the text.
+ ////////////////////////////////////////////////////////////////////////////////
+ return RenderText(textParameters, rendererParameters);