blob: cf847cce3dd356248c0bebd9059296abcddd00a1 (
plain) (
blame)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
// Copyright 2016 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include "common/swap.h"
#include "core/hle/kernel/shared_memory.h"
#include "core/hle/service/service.h"
namespace Service::APT::BCFNT { ///< BCFNT Shared Font file structures
struct CFNT {
u8 magic[4];
u16_le endianness;
u16_le header_size;
u32_le version;
u32_le file_size;
u32_le num_blocks;
};
struct SectionHeader {
u8 magic[4];
u32_le section_size;
};
struct FINF {
u8 magic[4];
u32_le section_size;
u8 font_type;
u8 line_feed;
u16_le alter_char_index;
u8 default_width[3];
u8 encoding;
u32_le tglp_offset;
u32_le cwdh_offset;
u32_le cmap_offset;
u8 height;
u8 width;
u8 ascent;
u8 reserved;
};
struct TGLP {
u8 magic[4];
u32_le section_size;
u8 cell_width;
u8 cell_height;
u8 baseline_position;
u8 max_character_width;
u32_le sheet_size;
u16_le num_sheets;
u16_le sheet_image_format;
u16_le num_columns;
u16_le num_rows;
u16_le sheet_width;
u16_le sheet_height;
u32_le sheet_data_offset;
};
struct CMAP {
u8 magic[4];
u32_le section_size;
u16_le code_begin;
u16_le code_end;
u16_le mapping_method;
u16_le reserved;
u32_le next_cmap_offset;
};
struct CWDH {
u8 magic[4];
u32_le section_size;
u16_le start_index;
u16_le end_index;
u32_le next_cwdh_offset;
};
/**
* Relocates the internal addresses of the BCFNT Shared Font to the new base. The current base will
* be auto-detected based on the file headers.
*
* @param shared_font SharedMemory object that contains the Shared Font
* @param new_address New base for the offsets in the structure.
*/
void RelocateSharedFont(std::shared_ptr<Kernel::SharedMemory> shared_font, VAddr new_address);
} // namespace Service::APT::BCFNT
|