[dali_1.0.31] Merge branch 'tizen'
[platform/core/uifw/dali-core.git] / dali / internal / event / text / glyph-metric.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/event/text/glyph-metric.h>
20
21 namespace Dali
22 {
23
24 namespace Internal
25 {
26
27 GlyphMetric::GlyphMetric()
28 : mCode(0),
29   mWidth(0.0f),
30   mHeight(0.0f),
31   mTop(0.0f),
32   mLeft(0.0f),
33   mXAdvance(0.0f)
34 {
35 }
36
37 GlyphMetric::~GlyphMetric()
38 {
39 }
40
41 GlyphMetric::GlyphMetric( uint32_t characterCode,
42                           float    width,
43                           float    height,
44                           float    top,
45                           float    left,
46                           float    xAdvance)
47 : mCode( characterCode ),
48   mWidth( width ),
49   mHeight( height ),
50   mTop( top ),
51   mLeft( left ),
52   mXAdvance( xAdvance )
53 {
54 }
55
56 uint32_t GlyphMetric::GetCharacterCode() const
57 {
58   return mCode;
59 }
60
61 float GlyphMetric::GetWidth() const
62 {
63   return mWidth;
64 }
65
66 float GlyphMetric::GetHeight() const
67 {
68   return mHeight;
69 }
70
71 float GlyphMetric::GetTop() const
72 {
73   return mTop;
74 }
75
76 float GlyphMetric::GetLeft() const
77 {
78   return mLeft;
79 }
80
81 float GlyphMetric::GetXAdvance() const
82 {
83   return mXAdvance;
84 }
85
86 } // namespace Internal
87
88 } // namespace Dali