1 #ifndef __DALI_FONT_PARAMETERS_H__
2 #define __DALI_FONT_PARAMETERS_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 * @addtogroup CAPI_DALI_FRAMEWORK
26 #include <dali/public-api/object/base-handle.h>
27 #include <dali/public-api/text/text.h>
29 namespace Dali DALI_IMPORT_API
33 * Font size in points.
34 * This reduces ambiguity when using methods which accept size in pixels or points.
39 * Create size in points.
40 * @param[in] value The value in points.
42 explicit PointSize(float value);
44 operator float() const;
48 * @param pointSize The point size to be compared.
49 * @return \e true if \e pointSize is equal to the point size stored in this object.
51 bool operator==( PointSize pointSize );
54 * Inequality operator.
55 * @param pointSize The point size to be compared.
56 * @return \e true if \e pointSize is not equal to the point size stored in this object.
58 bool operator!=( PointSize pointSize );
60 float value; ///< The value in points
64 * Font size in pixels.
65 * This reduces ambiguity when using methods which accept size in pixels or points.
70 * Create size in pixels.
71 * @param[in] value The value in pixels.
73 explicit PixelSize(unsigned int value);
75 operator unsigned int() const;
77 unsigned int value; ///< The value in pixels
82 explicit CapsHeight( unsigned int value);
84 operator unsigned int() const;
90 * Encapsulates all font parameters.
95 * Default constructor. Default system font family name, default system font style and default system size
96 * will be used to build the font.
101 * Contructor. Creates font parameters with the given family's name, style and size in points from the font requested.
102 * @param[in] familyName The family's name of the font requested.
103 * @param[in] style The style of the font requested.
104 * @param[in] size The size of the font requested in points.
106 FontParameters( const std::string& familyName, const std::string& style, PointSize size );
109 * Contructor. Creates font parameters with the given family's name, style and size in pixels from the font requested.
110 * @param[in] familyName The family's name of the font requested.
111 * @param[in] style The style of the font requested.
112 * @param[in] size The size of the font requested in pixels.
114 FontParameters( const std::string& familyName, const std::string& style, PixelSize size );
117 * Contructor. Creates font parameters with the given family's name, style and the caps-height size in pixels from the font requested.
118 * @param[in] familyName The family's name of the font requested.
119 * @param[in] style The style of the font requested.
120 * @param[in] size The caps-height of the font requested in pixels.
122 FontParameters( const std::string& familyName, const std::string& style, CapsHeight size );
126 * Destroys the internal implementation.
132 * Reset the internal implementation with new given values.
133 * @param[in] parameters The new font parameters.
135 FontParameters( const FontParameters& parameters );
138 * Assignment operator.
139 * @param[in] parameters The new font parameters.
141 FontParameters& operator=( const FontParameters& parameters );
144 * Retrieves the name of the font's family.
145 * @return The name of the font's family.
147 const std::string& GetFamilyName() const;
150 * Retrieves the style of the font.
151 * @return The style of the font.
153 const std::string& GetStyle() const;
156 * Retrieves the size of the font.
157 * @return The size of the font in Points.
159 PointSize GetSize() const;
163 Impl* mImpl; ///< Internal implementation. Not intended for application developers.
167 extern FontParameters DEFAULT_FONT_PARAMETERS;
174 #endif // __DALI_FONT_PARAMETERS_H__