1 #ifndef DALI_TOOLKIT_TEXT_LAYOUT_ENGINE_HELPER_FUNCTIONS_H
2 #define DALI_TOOLKIT_TEXT_LAYOUT_ENGINE_HELPER_FUNCTIONS_H
5 * Copyright (c) 2022 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-toolkit/internal/text/logical-model-impl.h>
23 #include <dali-toolkit/internal/text/visual-model-impl.h>
34 * @brief Calculate glyph positions when set glyph positions for left to right.
36 * @param[in] visualModel The visual model.
37 * @param[in] logicalModel The logical model.
38 * @param[in] interGlyphExtraAdvance Extra advance added to each glyph.
39 * @param[in] numberOfGlyphs The number of glyphs.
40 * @param[in] startIndexForGlyph The index of the first glyph in the line.
41 * @param[in] startIndexForGlyphPositions The index of the first glyph for GlyphPositions.
42 * @param[in,out] glyphPositionsBuffer The glyph positions buffer.
43 * @param[in,out] penX The current position for the horizontal pen.
45 void CalculateGlyphPositionsLTR(const VisualModelPtr& visualModel,
46 const LogicalModelPtr& logicalModel,
47 const float interGlyphExtraAdvance,
48 const Length numberOfGlyphs,
49 const GlyphIndex startIndexForGlyph,
50 const GlyphIndex startIndexForGlyphPositions,
51 Vector2* glyphPositionsBuffer,
55 * @brief Calculate glyph positions when set glyph positions for right to left.
57 * @param[in] visualModel The visual model.
58 * @param[in] logicalModel The logical model.
59 * @param[in] bidiLineIndex Index to the line's bidirectional info.
60 * @param[in] startGlyphIndex The index of the first glyph in the line.
61 * @param[in,out] glyphPositionsBuffer The glyph positions buffer.
62 * @param[in] characterVisualIndex The character visual index.
63 * @param[in] characterLogicalIndex The character logical index.
64 * @param[in,out] penX The current position for the horizontal pen.
66 void CalculateGlyphPositionsRTL(const VisualModelPtr& visualModel,
67 const LogicalModelPtr& logicalModel,
68 const BidirectionalLineRunIndex& bidiLineIndex,
69 const GlyphIndex& startGlyphIndex,
70 Vector2* glyphPositionsBuffer,
71 CharacterIndex& characterVisualIndex,
72 CharacterIndex& characterLogicalIndex,
76 * @brief Calculate glyph positions when set glyph positions for right to left.
78 * @param[in] visualModel The visual model.
79 * @param[in] textBuffer The text buffer.
80 * @param[in] startGlyphIndex The index of the first glyph in the line.
81 * @param[in] interGlyphExtraAdvance Extra advance added to each glyph.
82 * @param[in] bidiLineCharacterRun The initial character index within the whole text and the number of characters of the run for BidirectionalLine.
83 * @param[in] bidiLineVisualToLogicalMap Pointer to the visual to logical map table for BidirectionalLine.
84 * @param[in,out] glyphPositionsBuffer The glyph positions buffer.
85 * @param[in,out] characterLogicalIndex The character logical index.
86 * @param[in,out] penX The current position for the horizontal pen.
88 void TraversesCharactersForGlyphPositionsRTL(const VisualModelPtr& visualModel,
89 const Character* const textBuffer,
90 const GlyphIndex& startGlyphIndex,
91 const float interGlyphExtraAdvance,
92 const CharacterRun& bidiLineCharacterRun,
93 CharacterIndex* bidiLineVisualToLogicalMap,
94 Vector2* glyphPositionsBuffer,
95 CharacterIndex& characterLogicalIndex,
102 } // namespace Toolkit
106 #endif // DALI_TOOLKIT_TEXT_LAYOUT_ENGINE_HELPER_FUNCTIONS_H