1 #ifndef __DALI_GLYPH_IMAGE_H__
2 #define __DALI_GLYPH_IMAGE_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/images/image.h>
23 #include <dali/public-api/text/font.h>
25 namespace Dali DALI_IMPORT_API
32 * @brief A GlyphImage object is an image resource which represents a character.
34 class GlyphImage : public Image
38 * @brief Constructor which creates an uninitialized GlyphImage object.
40 * Use GlyphImage::New(...) to create an initialised object.
45 * @brief Create a new GlyphImage representing the given character.
47 * It uses a default TextStyle to create the glyph image.
48 * @see GlyphImage::New( const Character& character, const TextStyle& style )
50 * @param[in] character The character to get the glyph image.
52 * @return A handle to a new instance of a GlyphImage.
54 static GlyphImage New( const Character& character );
57 * @brief Create a new GlyphImage representing the given character.
59 * If the given character is a color glyph, no style is used to create the image.
61 * If it's not, it uses the font family name, font style and font size defined in the text-style
62 * to create a font. The text color is also retrieved from the text style to create the glyph image.
64 * @note current implementation ignores any other text style parameter.
66 * @param[in] character The character to get the glyph image.
67 * @param[in] style TextStyle to be used to create the glyph image.
69 * @return A handle to a new instance of a GlyphImage.
71 static GlyphImage New( const Character& character, const TextStyle& style );
74 * @brief Downcast an Object handle to GlyphImage handle.
76 * If handle points to a GlyphImage object the
77 * downcast produces valid handle. If not the returned handle is left uninitialized.
78 * @param[in] handle to An object
79 * @return handle to a GlyphImage object or an uninitialized handle
81 static GlyphImage DownCast( BaseHandle handle );
84 * @brief Whether the given characters is a color glyph.
86 * @param[in] character The given character.
88 * @return \e true if \e character is a color glyph.
90 static bool IsColorGlyph( const Character& character );
95 virtual ~GlyphImage();
98 * @copydoc Dali::BaseHandle::operator=
100 using BaseHandle::operator=;
102 public: // Not intended for application developers
104 explicit DALI_INTERNAL GlyphImage( Internal::Image* );
105 }; //class GlyphImage
109 #endif // __DALI_GLYPH_IMAGE_H__