Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
lib_ux_nbgl
ux_loc_nbgl.h
Go to the documentation of this file.
1
2
/*******************************************************************************
3
* Ledger Nano S - Secure firmware
4
* (c) 2022 Ledger
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
********************************************************************************/
18
19
#pragma once
20
21
#include "
nbgl_types.h
"
22
23
#if defined(HAVE_LANGUAGE_PACK)
24
// Structure used for language packs:
25
typedef
struct
language_pack {
26
uint32_t target_id;
// 0x33000004:NanoX, 0x31100004:NanoS 1.5.x etc
27
uint16_t
language;
// Language contained in this pack (<NB_LANG)
28
uint16_t
nb_strings;
// MUST be the same than NB_BOLOS_UX_LOC_STRINGS
29
uint16_t
nb_fonts;
// Number of fonts
30
uint16_t
nb_characters;
// Number of unicode characters in each font
31
uint16_t
characters_offset;
// Offset to the characters x nb_fonts
32
uint16_t
fonts_offset;
// Offset to the nbgl_font_unicode_t structures
33
uint16_t
bitmaps_offset;
// Offset to the bitmaps x nb_fonts
34
uint16_t
bolos_version_offset;
// Offset to the Bolos version number string
35
uint16_t
pack_version_offset;
// Offset to the Language Pack version number string
36
uint16_t
unused;
// for alignment
37
uint32_t offsets[];
// Offsets from the BEGINNING of the language pack
38
}
LANGUAGE_PACK
;
39
40
// A language pack is a binary file containing:
41
/*
42
- the language pack header, including infos about used fonts & glyphs
43
- offsets for each string (2 x nb_strings), from the beginning of the pack!
44
- 2 bytes padding if nb_strings is odd
45
- nbgl_font_unicode_character_t x nb_characters x 4 fonts
46
- nbgl_font_unicode_t x 4 fonts
47
- bitmap data for font 1
48
- bitmap data for font 2
49
- bitmap data for font 3
50
- bitmap data for font 4
51
- a NULL terminated string containing Bolos version number
52
- a NULL terminated string containing Language Pack version number
53
- all strings, concatenated.
54
55
NB:
56
- there are 197 countries in the world, so 1 byte might be enough to store language information,
57
unless we plan to integrate dialects (>7000) => use a u_int16_t;
58
- we may store some CRC, to check language pack's integrity.
59
*/
60
61
typedef
unsigned
short
UX_LOC_STRINGS_INDEX
;
62
63
#endif
// defined(HAVE_LANGUAGE_PACK)
LANGUAGE_PACK
#define LANGUAGE_PACK
Definition
nbgl_fonts.h:29
nbgl_types.h
common types for Graphical Library
uint16_t
unsigned short uint16_t
Definition
usbd_conf.h:54
UX_LOC_STRINGS_INDEX
BOLOS_UX_LOC_STRINGS UX_LOC_STRINGS_INDEX
Definition
ux_loc_layouts.h:25
Generated by
1.9.8