X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Frendering%2Ftext-typesetter.h;h=296126e1ef450b70d29ad7bcae9fa012a2a2f038;hb=refs%2Fchanges%2F87%2F277487%2F3;hp=51ac259cba5b841d9a585313c211efea49b4c12a;hpb=fa834a987e844fb79531954c882581624aef0e68;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/rendering/text-typesetter.h b/dali-toolkit/internal/text/rendering/text-typesetter.h index 51ac259..296126e 100644 --- a/dali-toolkit/internal/text/rendering/text-typesetter.h +++ b/dali-toolkit/internal/text/rendering/text-typesetter.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_TYPESETTER_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,48 +144,37 @@ private: * * @return An image buffer with the text. */ - Devel::PixelBuffer CreateImageBuffer(const unsigned int bufferWidth, const unsigned int bufferHeight, Typesetter::Style style, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat, int horizontalOffset, int verticalOffset, TextAbstraction::GlyphIndex fromGlyphIndex, TextAbstraction::GlyphIndex toGlyphIndex); + Devel::PixelBuffer CreateImageBuffer(const uint32_t bufferWidth, const uint32_t bufferHeight, const Typesetter::Style style, const bool ignoreHorizontalAlignment, const Pixel::Format pixelFormat, const int32_t horizontalOffset, const int32_t verticalOffset, const TextAbstraction::GlyphIndex fromGlyphIndex, const TextAbstraction::GlyphIndex toGlyphIndex); /** - * @brief Create an initialized image buffer. + * @brief Apply markup underline tags. * - * Creates the pixel data used to generate the final image with the given size. - * - * @param[in] bufferWidth The width of the image buffer. - * @param[in] bufferHeight The height of the image buffer. - * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8). - * - * @return An image buffer. - */ - Devel::PixelBuffer CreateImageBuffer(const unsigned int bufferWidth, const unsigned int bufferHeight, Pixel::Format pixelFormat); - - /** - * @brief Combine the two RGBA image buffers together. - * - * The top layer buffer will blend over the bottom layer buffer: - * - If the pixel is not fully opaque from either buffer, it will be blended with - * the pixel from the other buffer and copied to the combined buffer. - * - If the pixels from both buffers are fully opaque, the pixels from the top layer - * buffer will be copied to the combined buffer. + * The properties on TextLabel override the behavior of Markup. + * Because the markup will be the bottom layer buffer + * - i.e: If you set property UNDERLINE to enabled and blue. + * And the TEXT is "Hello World Hello World". + * Then the output of the whole text is underlined by blue line. * * @param[in] topPixelBuffer The top layer buffer. - * @param[in] bottomPixelBuffer The bottom layer buffer. * @param[in] bufferWidth The width of the image buffer. * @param[in] bufferHeight The height of the image buffer. + * @param[in] ignoreHorizontalAlignment Whether to ignore the horizontal alignment, not ignored by default. + * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8). + * @param[in] horizontalOffset The horizontal offset to be added to the glyph's position. + * @param[in] verticalOffset The vertical offset to be added to the glyph's position. * - * @return The combined image buffer with the text. - * + * @return The image buffer with the markup. */ - Devel::PixelBuffer CombineImageBuffer(Devel::PixelBuffer topPixelBuffer, Devel::PixelBuffer bottomPixelBuffer, const unsigned int bufferWidth, const unsigned int bufferHeightbool); + Devel::PixelBuffer ApplyUnderlineMarkupImageBuffer(Devel::PixelBuffer topPixelBuffer, const uint32_t bufferWidth, const uint32_t bufferHeight, const bool ignoreHorizontalAlignment, const Pixel::Format pixelFormat, const int32_t horizontalOffset, const int32_t verticalOffset); /** - * @brief Apply behaviour of tags if the markup-processor is enabled. + * @brief Apply markup strikethrough tags. * * The properties on TextLabel override the behavior of Markup. * Because the markup will be the bottom layer buffer - * - i.e: If you set property UNDERLINE to enabled and blue. - * And the TEXT is "Hello World Hello World". - * Then the output of the whole text is underlined by blue line. + * - i.e: If you set property STRIKETHROUGH to enabled and blue. + * And the TEXT is "Hello World Hello World". + * Then the whole text will have a blue line strikethrough. * * @param[in] topPixelBuffer The top layer buffer. * @param[in] bufferWidth The width of the image buffer. @@ -197,7 +186,7 @@ private: * * @return The image buffer with the markup. */ - Devel::PixelBuffer ApplyMarkupProcessorOnPixelBuffer(Devel::PixelBuffer topPixelBuffer, const unsigned int bufferWidth, const unsigned int bufferHeight, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat, int horizontalOffset, int verticalOffset); + Devel::PixelBuffer ApplyStrikethroughMarkupImageBuffer(Devel::PixelBuffer topPixelBuffer, const uint32_t bufferWidth, const uint32_t bufferHeight, const bool ignoreHorizontalAlignment, const Pixel::Format pixelFormat, const int32_t horizontalOffset, const int32_t verticalOffset); protected: /**