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 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/public-api/math/radian.h>
32 * Text formatting controls how the vertex data
33 * for a string of text is created.
34 * E.g. if italics is turned on, the vertices are modified
35 * to created slanted characters.
36 * If underline is true, a thin line is added to underline the
49 * @param[in] underline whether to underline the text
50 * @param[in] leftToRight whether text is rendered left to right
51 * @param[in] italics whether italics is enabled
52 * @param[in] italicsAngle italics angle
53 * @param[in] pointSize the point size
55 TextFormat( bool underline,
58 Dali::Radian italicsAngle,
60 float underlineThickness,
61 float underlinePosition );
65 * @param[in] rhs object to copy
67 TextFormat( const TextFormat& rhs);
71 * @param[in] rhs object to assign from
74 TextFormat& operator=( const TextFormat& rhs );
83 * Whether underline is enabled
84 * @return true if underline is enabled
86 bool IsUnderLined() const;
89 * Whether left to right character layout is enabled
90 * @return true if left to right is true
92 bool IsLeftToRight() const;
95 * whether italics are enabled
96 * @return true if italics enabled
98 bool IsItalic() const;
101 * Get the italics angle
102 * @return italics angle
104 Dali::Radian GetItalicsAngle() const;
108 * @return font point size
110 float GetPointSize() const;
113 * Get the character used for underlining.
114 * @return under line character
116 unsigned int GetUnderLineCharacter() const;
119 * @return The underline's thickness.
121 float GetUnderlineThickness() const;
124 * @return The underline's position.
126 float GetUnderlinePosition() const;
130 bool mUnderline:1; ///< whether to underline the text
131 bool mLeftToRight:1; ///< Whether text is displayed left to right
132 bool mItalics:1; ///< whether to apply italics
133 Dali::Radian mItalicsAngle; ///< italics angle if applied
134 float mPointSize; ///< Point size. Used to scale the vertices by this amount.
135 float mUnderlineThickness; ///< The underline's thickness.
136 float mUnderlinePosition; ///< The underline's position.
140 } // namespace Internal
144 #endif // __DALI_INTERNAL_TEXT_FORMAT_H__