1 #ifndef __DALI_INTERNAL_GLYPH_METRIC_H__
2 #define __DALI_INTERNAL_GLYPH_METRIC_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.
23 #include <stdint.h> // for uint32_t
33 * Structure that contains the glyph metrics
34 * Font-Metrics class will create and and own this class.
35 * All data members are plain old data, so compiler generated copy constructor
36 * and assignment operator are used.
52 GlyphMetric( uint32_t characterCode,
60 * non-virtual destructor.
65 * Helper to return the character code of the glyph
66 * @return character code
68 uint32_t GetCharacterCode() const;
71 * @return width of character
73 float GetWidth() const;
76 * @return height of character
78 float GetHeight() const;
81 * @return top of character
86 * @return left position of character
88 float GetLeft() const;
91 * @return x advance of character
93 float GetXAdvance() const;
97 uint32_t mCode; ///< character code (UTF-32), max value of 0x10ffff (21 bits)
98 float mWidth; ///< glyph width in pixels
99 float mHeight; ///< glyph height in pixels
100 float mTop; ///< distance between glyph's tallest pixel and baseline
101 float mLeft; ///< where to place the glyph horizontally in relation to current 'pen' position
102 float mXAdvance; ///< distance in pixels to move the 'pen' after displaying the character
106 } // namespace Internal
110 #endif // __DALI_INTERNAL_FONT_METRICS_IMPL_H__