~aleteoryx/muditaos

ref: 7eb1278f0b19713264cf4401475d215ad11a220f muditaos/module-gui/gui/core/FontInfo.hpp -rw-r--r-- 1.4 KiB
7eb1278f — Maciej Gibowicz [BH-1476] Add greetings in all languages 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <stdint.h>   // for uint16_t, uint32_t, uint8_t
#include <Common.hpp> // for Status
#include <string>     // for string

namespace gui
{
    class FontInfo
    {
      public:
        gui::Status load(uint8_t *data, uint32_t &offset);
        // name of the true type font. max 63 characters
        std::string face;
        // size of the true type font
        uint16_t size;
        // flag that informs if font is bold
        uint16_t bold;
        // flag that informs if font is italic
        uint16_t italic;
        // flag that informs if smoothing was turned on. 1 - smoothing was turned on.
        uint16_t smooth;
        // TODO additional space between characters????
        int16_t char_spacing;
        // TODO additional space between lines
        int16_t line_spacing;
        // distance in pixels between each line of text
        uint16_t line_height;
        // number of pixels from the absolute top of the line to the base of the characters
        uint16_t base;
        // width of the texture, normally used to scale the x pos of the character image
        uint16_t scale_w;
        // height of the texture, normally used to scale the y pos of the character image
        uint16_t scale_h;
    };
} // namespace gui