1 #ifndef DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H
2 #define DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/math/vector2.h>
25 #include <dali-toolkit/internal/text/text-definitions.h>
26 #include <dali-toolkit/internal/text/text-model.h>
27 #include <dali-toolkit/public-api/text/text-enumerations.h>
35 struct BidirectionalLineInfoRun;
40 * @brief Struct used to pass parameters.
45 * Constructor with the needed parameters to layout the text.
47 * @param[in] boundingBox The size of the box containing the text.
48 * @param[in,out] textModel The text's model.
50 Parameters(const Vector2& boundingBox,
52 : boundingBox{boundingBox},
54 lineBidirectionalInfoRunsBuffer{nullptr},
55 numberOfBidirectionalInfoRuns{0u},
59 estimatedNumberOfLines{0u},
60 interGlyphExtraAdvance{0.f},
61 isLastNewParagraph{false}
65 Vector2 boundingBox; ///< The size of the box containing the text.
67 BidirectionalLineInfoRun* lineBidirectionalInfoRunsBuffer; ///< Bidirectional conversion tables per line.
68 Length numberOfBidirectionalInfoRuns; ///< The number of lines with bidirectional info.
69 GlyphIndex startGlyphIndex; ///< Index to the first glyph to layout.
70 Length numberOfGlyphs; ///< The number of glyphs to layout.
71 LineIndex startLineIndex; ///< The line index where to insert the new lines.
72 Length estimatedNumberOfLines; ///< The estimated number of lines.
73 float interGlyphExtraAdvance; ///< Extra advance added to each glyph.
74 bool isLastNewParagraph : 1; ///< Whether the last character is a new paragraph character.
81 } // namespace Toolkit
85 #endif // DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H