X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fline-run.h;h=f4d13e0955381ab2c8671036253232f1b91d5d4c;hp=c0bb095ad919cc42c3f10e818f4521b255173e7b;hb=HEAD;hpb=c1b19f0b24c482e2af7f555c00250bbbb32112e6 diff --git a/dali-toolkit/internal/text/line-run.h b/dali-toolkit/internal/text/line-run.h index c0bb095..12f3820 100644 --- a/dali-toolkit/internal/text/line-run.h +++ b/dali-toolkit/internal/text/line-run.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_LINE_RUN_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 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. @@ -33,19 +33,19 @@ namespace Text */ struct LineRun { - GlyphRun glyphRun; ///< The initial glyph index and the number of glyphs of the run. - CharacterRun characterRun; ///< The initial character index and the number of characters of the run. - float width; ///< The line's width. - float ascender; ///< The line's ascender. - float descender; ///< The line's descender. - float extraLength; ///< The length of the white spaces at the end of the line. - float alignmentOffset; ///< The horizontal alignment offset. - float lineSpacing; ///< The line's spacing - CharacterDirection direction : 1; ///< Direction of the first character of the paragraph. - bool ellipsis : 1; ///< Wheter ellipsis is added to the line. - bool isSplitToTwoHalves; ///< Whether the second half is defined. When split line to two halves to set Ellipsis in the MIDDLE of line. The second half is the second part of line after Ellipsis. - GlyphRun glyphRunSecondHalf; ///< The initial glyph index and the number of glyphs of the run for the second half of line. - CharacterRun characterRunForSecondHalfLine; ///< The initial character index and the number of characters of the run for the second half of line. + GlyphRun glyphRun{}; ///< The initial glyph index and the number of glyphs of the run. + CharacterRun characterRun{}; ///< The initial character index and the number of characters of the run. + float width; ///< The line's width. + float ascender; ///< The line's ascender. + float descender; ///< The line's descender. + float extraLength; ///< The length of the white spaces at the end of the line. + float alignmentOffset; ///< The horizontal alignment offset. + float lineSpacing; ///< The line's spacing + CharacterDirection direction : 1; ///< Direction of the first character of the paragraph. + bool ellipsis : 1; ///< Wheter ellipsis is added to the line. + bool isSplitToTwoHalves; ///< Whether the second half is defined. When split line to two halves to set Ellipsis in the MIDDLE of line. The second half is the second part of line after Ellipsis. + GlyphRun glyphRunSecondHalf{}; ///< The initial glyph index and the number of glyphs of the run for the second half of line. + CharacterRun characterRunForSecondHalfLine{}; ///< The initial character index and the number of characters of the run for the second half of line. }; /** @@ -56,6 +56,15 @@ struct LineRun */ float GetLineHeight(const LineRun lineRun, bool isLastLine); +/** + * @brief Get the line width for the specified line run. + * The width in the geometry = glyph.advance, not glyph.width. + * + * @param[in] lineRun The line runs to get the width for. + * @return the width of the line. + */ +float GetLineWidth(const LineRun& lineRun); + } // namespace Text } // namespace Toolkit