1 #ifndef __DALI_INTERNAL_TEXT_FORMAT_H__
2 #define __DALI_INTERNAL_TEXT_FORMAT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/public-api/math/radian.h>
31 * Text formatting controls how the vertex data
32 * for a string of text is created.
33 * E.g. if italics is turned on, the vertices are modified
34 * to created slanted characters.
35 * If underline is true, a thin line is added to underline the
48 * @param[in] underline whether to underline the text
49 * @param[in] leftToRight whether text is rendered left to right
50 * @param[in] italics whether italics is enabled
51 * @param[in] italicsAngle italics angle
52 * @param[in] pointSize the point size
54 TextFormat( bool underline,
57 Dali::Radian italicsAngle,
59 float underlineThickness,
60 float underlinePosition );
64 * @param[in] rhs object to copy
66 TextFormat( const TextFormat& rhs);
70 * @param[in] rhs object to assign from
73 TextFormat& operator=( const TextFormat& rhs );
82 * Whether underline is enabled
83 * @return true if underline is enabled
85 bool IsUnderLined() const;
88 * Whether left to right character layout is enabled
89 * @return true if left to right is true
91 bool IsLeftToRight() const;
94 * whether italics are enabled
95 * @return true if italics enabled
97 bool IsItalic() const;
100 * Get the italics angle
101 * @return italics angle
103 Dali::Radian GetItalicsAngle() const;
107 * @return font point size
109 float GetPointSize() const;
112 * Get the character used for underlining.
113 * @return under line character
115 unsigned int GetUnderLineCharacter() const;
118 * @return The underline's thickness.
120 float GetUnderlineThickness() const;
123 * @return The underline's position.
125 float GetUnderlinePosition() const;
129 bool mUnderline:1; ///< whether to underline the text
130 bool mLeftToRight:1; ///< Whether text is displayed left to right
131 bool mItalics:1; ///< whether to apply italics
132 Dali::Radian mItalicsAngle; ///< italics angle if applied
133 float mPointSize; ///< Point size. Used to scale the vertices by this amount.
134 float mUnderlineThickness; ///< The underline's thickness.
135 float mUnderlinePosition; ///< The underline's position.
139 } // namespace Internal
143 #endif // __DALI_INTERNAL_TEXT_FORMAT_H__