Remove useless iteration when debug mode
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / multi-language-helper-functions.h
1 #ifndef DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_HELPER_FUNCTIONS_H
2 #define DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_HELPER_FUNCTIONS_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/text/font-description-run.h>
26 #include <dali-toolkit/internal/text/script-run.h>
27
28 namespace Dali
29 {
30 namespace Toolkit
31 {
32 namespace Text
33 {
34 /**
35  * @brief Merges font's descriptions to retrieve the combined font's description for a given character.
36  *
37  * @param[in] fontDescriptions The font's descriptions for the whole text.
38  * @param[in] defaultFontDescription The default font's description.
39  * @param[in] defaultPointSize The default font's point size.
40  * @param[in] characterIndex Index to the character to retrieve its font's description.
41  * @param[out] fontDescription The font's description for the character.
42  * @param[out] fontPointSize The font's point size for the character.
43  * @param[out] isDefaultFont Whether the font is a default one.
44  */
45 void MergeFontDescriptions(const Vector<FontDescriptionRun>&       fontDescriptions,
46                            const TextAbstraction::FontDescription& defaultFontDescription,
47                            TextAbstraction::PointSize26Dot6        defaultPointSize,
48                            CharacterIndex                          characterIndex,
49                            TextAbstraction::FontDescription&       fontDescription,
50                            TextAbstraction::PointSize26Dot6&       fontPointSize,
51                            bool&                                   isDefaultFont);
52
53 /**
54  * @brief Retrieves the script Id from the script run for a given character's @p index.
55  *
56  * If the character's index exceeds the current script run it increases the iterator to get the next one.
57  *
58  * @param[in] index The character's index.
59  * @param[in,out] scriptRunIt Iterator to the current script run.
60  * @param[in] scriptRunEndIt Iterator to one after the last script run.
61  *
62  * @return The script.
63  */
64 Script GetScript(Length                                  index,
65                  Vector<ScriptRun>::ConstIterator&       scriptRunIt,
66                  const Vector<ScriptRun>::ConstIterator& scriptRunEndIt);
67
68 } // namespace Text
69
70 } // namespace Toolkit
71
72 } // namespace Dali
73
74 #endif // DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_HELPER_FUNCTIONS_H