Merge branch 'devel/master' into sandbox/dkdk/tizen
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / glyph-info.h
1 #ifndef DALI_TEXT_ABSTRACTION_GLYPH_INFO_H
2 #define DALI_TEXT_ABSTRACTION_GLYPH_INFO_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
23 #include <dali/public-api/dali-adaptor-common.h>
24
25 namespace Dali
26 {
27 namespace TextAbstraction
28 {
29 /**
30  * The information describing a glyph (font ID, index, metrics)
31  * The metrics are in pixels.
32  */
33 struct DALI_ADAPTOR_API GlyphInfo
34 {
35   /**
36    * @brief Default constructor.
37    */
38   GlyphInfo();
39
40   /**
41    * @brief Creates the GlyphInfo without metrics.
42    */
43   GlyphInfo(FontId font, GlyphIndex i);
44
45   FontId     fontId;               ///< Identifies the font containing the glyph
46   GlyphIndex index;                ///< Uniquely identifies a glyph for a given FontId
47   float      width;                ///< The width of the glyph
48   float      height;               ///< The height of the glyph
49   float      xBearing;             ///< The distance from the cursor position to the leftmost border of the glyph
50   float      yBearing;             ///< The distance from the baseline to the topmost border of the glyph
51   float      advance;              ///< The distance to move the cursor for this glyph
52   float      scaleFactor;          ///< The scaling applied (fixed-size fonts only)
53   bool       isItalicRequired : 1; ///< Whether the italic style is required.
54   bool       isBoldRequired : 1;   ///< Whether the bold style is required.
55 };
56
57 } // namespace TextAbstraction
58
59 } // namespace Dali
60
61 #endif //DALI_TEXT_ABSTRACTION_GLYPH_INFO_H