1 #ifndef __DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H__
2 #define __DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H__
5 * Copyright (c) 2015 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>
36 struct BidirectionalLineInfoRun;
39 * @brief Struct used to pass parameters.
41 struct LayoutParameters
44 * Constructor with the needed parameters to layout the text.
46 * @param[in] boundingBox The size of the box containing the text.
47 * @param[in] textBuffer The text buffer.
48 * @param[in] lineBreakInfoBuffer The line break info.
49 * @param[in] wordBreakInfoBuffer The word break info.
50 * @param[in] totalNumberOfGlyphs The number of glyphs.
51 * @param[in] glyphsBuffer A vector with glyphs.
52 * @param[in] glyphsToCharactersBuffer Vector with indices pointing the first character of each glyph.
53 * @param[in] charactersPerGlyphBuffer Vector with the number of characters that forms each glyph.
55 LayoutParameters( const Vector2& boundingBox,
56 const Character* const textBuffer,
57 const LineBreakInfo* const lineBreakInfoBuffer,
58 const WordBreakInfo* const wordBreakInfoBuffer,
59 const CharacterDirection* const characterDirectionBuffer,
60 Length totalNumberOfGlyphs,
61 const GlyphInfo* const glyphsBuffer,
62 const CharacterIndex* const glyphsToCharactersBuffer,
63 const Length* const charactersPerGlyphBuffer )
64 : boundingBox( boundingBox ),
65 textBuffer( textBuffer ),
66 lineBreakInfoBuffer( lineBreakInfoBuffer ),
67 wordBreakInfoBuffer( wordBreakInfoBuffer ),
68 characterDirectionBuffer( characterDirectionBuffer ),
69 totalNumberOfGlyphs( totalNumberOfGlyphs ),
70 glyphsBuffer( glyphsBuffer ),
71 glyphsToCharactersBuffer( glyphsToCharactersBuffer ),
72 charactersPerGlyphBuffer( charactersPerGlyphBuffer ),
73 charactersToGlyphsBuffer( NULL ),
74 glyphsPerCharacterBuffer( NULL ),
75 lineBidirectionalInfoRunsBuffer( NULL ),
76 numberOfBidirectionalInfoRuns( 0u ),
77 isLastNewParagraph( false )
81 const Character* const textBuffer;
82 const LineBreakInfo* const lineBreakInfoBuffer;
83 const WordBreakInfo* const wordBreakInfoBuffer;
84 const CharacterDirection* const characterDirectionBuffer;
85 Length totalNumberOfGlyphs;
86 const GlyphInfo* const glyphsBuffer;
87 const CharacterIndex* const glyphsToCharactersBuffer;
88 const Length* const charactersPerGlyphBuffer;
89 GlyphIndex* charactersToGlyphsBuffer; ///< The character to glyph conversion table.
90 Length* glyphsPerCharacterBuffer; ///< The number of glyphs per character.
91 BidirectionalLineInfoRun* lineBidirectionalInfoRunsBuffer; ///< Bidirectional conversion tables per line.
92 Length numberOfBidirectionalInfoRuns; ///< The number of lines with bidirectional info.
93 bool isLastNewParagraph; ///< Whether the last character is a new paragraph character.
98 } // namespace Toolkit
102 #endif // __DALI_TOOLKIT_TEXT_LAYOUT_PARAMETERS_H__