Merge "Set proper locale to harfbuzz" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / font-list.h
1 #ifndef __DALI_TEXT_ABSTRACTION_FONT_LIST_H__
2 #define __DALI_TEXT_ABSTRACTION_FONT_LIST_H__
3
4 /*
5  * Copyright (c) 2015 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 <string>
23 #include <iostream>
24 #include <dali/public-api/common/vector-wrapper.h>
25
26 namespace Dali
27 {
28
29 namespace TextAbstraction
30 {
31 typedef std::string FontPath;
32 typedef std::string FontFamily;
33 typedef std::string FontStyle;
34
35 namespace FontWidth
36 {
37   /**
38    * @brief Enumeration type for the font's width
39    */
40   enum Type
41   {
42     NONE,            ///< Means not defined. Will use what is set as default, currently NORMAL.
43     ULTRA_CONDENSED,
44     EXTRA_CONDENSED,
45     CONDENSED,
46     SEMI_CONDENSED,
47     NORMAL,
48     SEMI_EXPANDED,
49     EXPANDED,
50     EXTRA_EXPANDED,
51     ULTRA_EXPANDED
52   };
53
54   const char* const Name[] =
55   {
56     "NONE",
57     "ULTRA_CONDENSED",
58     "EXTRA_CONDENSED",
59     "CONDENSED",
60     "SEMI_CONDENSED",
61     "NORMAL",
62     "SEMI_EXPANDED",
63     "EXPANDED",
64     "EXTRA_EXPANDED",
65     "ULTRA_EXPANDED"
66   };
67 } // namespace FontWidth
68
69 namespace FontWeight
70 {
71   /**
72    * @brief Enumeration type for the font's weight
73    */
74   enum Type
75   {
76     NONE,                      ///< Means not defined. Will use what is set as default, currently NORMAL.
77     THIN,
78     ULTRA_LIGHT,
79     EXTRA_LIGHT = ULTRA_LIGHT,
80     LIGHT,
81     DEMI_LIGHT,
82     SEMI_LIGHT = DEMI_LIGHT,
83     BOOK,
84     NORMAL,
85     REGULAR = NORMAL,
86     MEDIUM,
87     DEMI_BOLD,
88     SEMI_BOLD = DEMI_BOLD,
89     BOLD,
90     ULTRA_BOLD,
91     EXTRA_BOLD = ULTRA_BOLD,
92     BLACK,
93     HEAVY = BLACK,
94     EXTRA_BLACK = BLACK
95   };
96
97   const char* const Name[] =
98   {
99     "NONE",
100     "THIN",
101     "ULTRA_LIGHT",
102     "LIGHT",
103     "DEMI_LIGHT",
104     "BOOK",
105     "NORMAL",
106     "MEDIUM",
107     "DEMI_BOLD",
108     "BOLD",
109     "ULTRA_BOLD",
110     "BLACK"
111   };
112 }
113
114 namespace FontSlant
115 {
116   /**
117    * @brief Enumeration type for the font's slant
118    */
119   enum Type
120   {
121     NONE,           ///< Means not defined. Will use what is set as default, currently NORMAL.
122     NORMAL,
123     ROMAN = NORMAL,
124     ITALIC,
125     OBLIQUE
126   };
127
128   const char* const Name[] =
129   {
130     "NONE",
131     "NORMAL",
132     "ITALIC",
133     "OBLIQUE"
134   };
135 } // namespace FontSlant
136
137 struct FontDescription
138 {
139   FontDescription()
140   : path(),
141     family(),
142     width( FontWidth::NONE ),
143     weight( FontWeight::NONE ),
144     slant( FontSlant::NONE )
145   {}
146
147   ~FontDescription()
148   {}
149
150   FontPath         path;   ///< The font's file name path.
151   FontFamily       family; ///< The font's family name.
152   FontWidth::Type  width;  ///< The font's width.
153   FontWeight::Type weight; ///< The font's weight.
154   FontSlant::Type  slant;  ///< The font's slant.
155 };
156
157 typedef std::vector<FontDescription> FontList;
158
159 DALI_IMPORT_API std::ostream& operator<<( std::ostream& o, const FontList& fontList );
160
161 } // namespace TextAbstraction
162
163 } // namespace Dali
164
165 #endif // __DALI_TEXT_ABSTRACTION_FONT_LIST_H__