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] italics whether italics is enabled
51 * @param[in] italicsAngle italics angle
52 * @param[in] pointSize the point size
54 TextFormat( bool underline,
56 Dali::Radian italicsAngle,
58 float underlineThickness,
59 float underlinePosition );
63 * @param[in] rhs object to copy
65 TextFormat( const TextFormat& rhs);
69 * @param[in] rhs object to assign from
72 TextFormat& operator=( const TextFormat& rhs );
81 * Whether underline is enabled
82 * @return true if underline is enabled
84 bool IsUnderLined() const;
87 * whether italics are enabled
88 * @return true if italics enabled
90 bool IsItalic() const;
93 * Get the italics angle
94 * @return italics angle
96 Dali::Radian GetItalicsAngle() const;
100 * @return font point size
102 float GetPointSize() const;
105 * Get the character used for underlining.
106 * @return under line character
108 unsigned int GetUnderLineCharacter() const;
111 * @return The underline's thickness.
113 float GetUnderlineThickness() const;
116 * @return The underline's position.
118 float GetUnderlinePosition() const;
122 bool mUnderline:1; ///< whether to underline the text
123 bool mItalics:1; ///< whether to apply italics
124 Dali::Radian mItalicsAngle; ///< italics angle if applied
125 float mPointSize; ///< Point size. Used to scale the vertices by this amount.
126 float mUnderlineThickness; ///< The underline's thickness.
127 float mUnderlinePosition; ///< The underline's position.
131 } // namespace Internal
135 #endif // __DALI_INTERNAL_TEXT_FORMAT_H__