b73da2fe1a522d6f69d073c9b86e73614e71a8dc
[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) 2016 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
31 namespace Toolkit
32 {
33
34 namespace Text
35 {
36
37 /**
38  * @brief Merges the font descriptions to retrieve the font Id for each character.
39  *
40  * @param[in] fontDescriptions The font descriptions.
41  * @param[out] fontIds The font id for each character.
42  * @param[in] defaultFontDescription The default font description.
43  * @param[in] defaultPointSize The default font size.
44  * @param[in] startIndex The character from where the fonts are merged.
45  * @param[in] numberOfCharacters The number of characters to set the font.
46  */
47 void MergeFontDescriptions( const Vector<FontDescriptionRun>& fontDescriptions,
48                             Vector<FontId>& fontIds,
49                             const TextAbstraction::FontDescription& defaultFontDescription,
50                             TextAbstraction::PointSize26Dot6 defaultPointSize,
51                             CharacterIndex startIndex,
52                             Length numberOfCharacters );
53
54 /**
55  * @brief Retrieves the script Id from the script run for a given character's @p index.
56  *
57  * If the character's index exceeds the current script run it increases the iterator to get the next one.
58  *
59  * @param[in] index The character's index.
60  * @param[in,out] scriptRunIt Iterator to the current script run.
61  * @param[in] scriptRunEndIt Iterator to one after the last script run.
62  *
63  * @return The script.
64  */
65 Script GetScript( Length index,
66                   Vector<ScriptRun>::ConstIterator& scriptRunIt,
67                   const Vector<ScriptRun>::ConstIterator& scriptRunEndIt );
68
69 } // namespace Text
70
71 } // namespace Toolkit
72
73 } // namespace Dali
74
75 #endif // __DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_HELPER_FUNCTIONS_H__