1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H__
2 #define __DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H__
5 * Copyright (c) 2015 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/devel-api/scripting/scripting.h>
25 #include <dali-toolkit/internal/text/text-controller.h>
26 #include <dali-toolkit/internal/text/text-definitions.h>
37 const Scripting::StringEnum FONT_WIDTH_STRING_TABLE[] =
39 { "ultra-condensed", TextAbstraction::FontWidth::ULTRA_CONDENSED },
40 { "extra-condensed", TextAbstraction::FontWidth::EXTRA_CONDENSED },
41 { "condensed", TextAbstraction::FontWidth::CONDENSED },
42 { "semi-condensed", TextAbstraction::FontWidth::SEMI_CONDENSED },
43 { "normal", TextAbstraction::FontWidth::NORMAL },
44 { "semi-expanded", TextAbstraction::FontWidth::SEMI_EXPANDED },
45 { "expanded", TextAbstraction::FontWidth::EXPANDED },
46 { "extra-expanded", TextAbstraction::FontWidth::EXTRA_EXPANDED },
47 { "ultra-expanded", TextAbstraction::FontWidth::ULTRA_EXPANDED },
49 const unsigned int FONT_WIDTH_STRING_TABLE_COUNT = sizeof( FONT_WIDTH_STRING_TABLE ) / sizeof( FONT_WIDTH_STRING_TABLE[0] );
51 const Scripting::StringEnum FONT_WEIGHT_STRING_TABLE[] =
53 { "thin", TextAbstraction::FontWeight::THIN },
54 { "ultra-light", TextAbstraction::FontWeight::ULTRA_LIGHT },
55 { "extra-light", TextAbstraction::FontWeight::EXTRA_LIGHT },
56 { "light", TextAbstraction::FontWeight::LIGHT },
57 { "demi-light", TextAbstraction::FontWeight::DEMI_LIGHT },
58 { "semi-light", TextAbstraction::FontWeight::SEMI_LIGHT },
59 { "book", TextAbstraction::FontWeight::BOOK },
60 { "normal", TextAbstraction::FontWeight::NORMAL },
61 { "regular", TextAbstraction::FontWeight::REGULAR },
62 { "medium", TextAbstraction::FontWeight::MEDIUM },
63 { "demi-bold", TextAbstraction::FontWeight::DEMI_BOLD },
64 { "semi-bold", TextAbstraction::FontWeight::SEMI_BOLD },
65 { "bold", TextAbstraction::FontWeight::BOLD },
66 { "ultra-bold", TextAbstraction::FontWeight::ULTRA_BOLD },
67 { "extra-bold", TextAbstraction::FontWeight::EXTRA_BOLD },
68 { "black", TextAbstraction::FontWeight::BLACK },
69 { "heavy", TextAbstraction::FontWeight::HEAVY },
70 { "extra-black", TextAbstraction::FontWeight::EXTRA_BLACK }
72 const unsigned int FONT_WEIGHT_STRING_TABLE_COUNT = sizeof( FONT_WEIGHT_STRING_TABLE ) / sizeof( FONT_WEIGHT_STRING_TABLE[0] );
74 const Scripting::StringEnum FONT_SLANT_STRING_TABLE[] =
76 { "normal", TextAbstraction::FontSlant::NORMAL },
77 { "roman", TextAbstraction::FontSlant::ROMAN },
78 { "italic", TextAbstraction::FontSlant::ITALIC },
79 { "oblique", TextAbstraction::FontSlant::OBLIQUE }
81 const unsigned int FONT_SLANT_STRING_TABLE_COUNT = sizeof( FONT_SLANT_STRING_TABLE ) / sizeof( FONT_SLANT_STRING_TABLE[0] );
84 * @brief Sets the font's style property.
86 * @param[in] controller The text's controller.
87 * @param[in] value The value of the font's style.
90 void SetFontStyleProperty( ControllerPtr controller, const Property::Value& value );
93 * @brief Retrieves the font's style property.
95 * @param[in] controller The text's controller.
96 * @param[out] value The value of the font's style.
98 void GetFontStyleProperty( ControllerPtr controller, Property::Value& value );
102 } // namespace Toolkit
106 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H__