Ignore vertical line alignment when the line spacing is negative
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / font-description-run.h
1 #ifndef DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H
2 #define DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_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/devel-api/text-abstraction/font-list.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/text/character-run.h>
26 #include <dali-toolkit/internal/text/text-definitions.h>
27
28 namespace Dali
29 {
30 namespace Toolkit
31 {
32 namespace Text
33 {
34 /**
35  * @brief Run of characters with the same font.
36  */
37 struct FontDescriptionRun
38 {
39   /**
40    * Default constructor to set the default values of bitfields
41    */
42   FontDescriptionRun()
43   : characterRun{},
44     familyName{nullptr},
45     familyLength{0u},
46     weight{FontWeight::NONE},
47     width{FontWidth::NONE},
48     slant{FontSlant::NONE},
49     size{0u},
50     familyDefined{false},
51     weightDefined{false},
52     widthDefined{false},
53     slantDefined{false},
54     sizeDefined{false}
55   {
56   }
57
58   FontDescriptionRun(const CharacterRun& characterRun,
59                      char*               familyName,
60                      Length              familyLength,
61                      FontWeight          weight,
62                      FontWidth           width,
63                      FontSlant           slant,
64                      PointSize26Dot6     size,
65                      bool                familyDefined,
66                      bool                weightDefined,
67                      bool                widthDefined,
68                      bool                slantDefined,
69                      bool                sizeDefined)
70   : characterRun{characterRun},
71     familyName{familyName},
72     familyLength{familyLength},
73     weight{weight},
74     width{width},
75     slant{slant},
76     size{size},
77     familyDefined{familyDefined},
78     weightDefined{weightDefined},
79     widthDefined{widthDefined},
80     slantDefined{slantDefined},
81     sizeDefined{sizeDefined}
82   {
83   }
84
85   CharacterRun    characterRun; ///< The initial character index and the number of characters of the run.
86   char*           familyName;   ///< The font's family name.
87   Length          familyLength; ///< The length of the font's family name.
88   FontWeight      weight;       ///< The font's weight.
89   FontWidth       width;        ///< The font's width.
90   FontSlant       slant;        ///< The font's slant.
91   PointSize26Dot6 size;         ///< The font's size.
92
93   bool familyDefined : 1; ///< Whether the font's family is defined.
94   bool weightDefined : 1; ///< Whether the font's weight is defined.
95   bool widthDefined : 1;  ///< Whether the font's width is defined.
96   bool slantDefined : 1;  ///< Whether the font's slant is defined.
97   bool sizeDefined : 1;   ///< Whether the font's size is defined.
98 };
99
100 } // namespace Text
101
102 } // namespace Toolkit
103
104 } // namespace Dali
105
106 #endif // DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H