~aleteoryx/muditaos

ref: 6059ac716e0db2e30e5d04c7009c406ac7720a7d muditaos/module-gui/gui/core/FontInfo.hpp -rw-r--r-- 1.4 KiB
6059ac71 — Lefucjusz [BH-2034] Various cleanups and refactors across the OS 1 year, 5 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-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <cstdint>
#include <Common.hpp>
#include <string>

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