Skip to content

Commit

Permalink
Changes needed to support fake OCR on speculos for Stax
Browse files Browse the repository at this point in the history
  • Loading branch information
dmorais-ledger committed Jul 7, 2023
1 parent 6b2d5ec commit b1a23b2
Show file tree
Hide file tree
Showing 15 changed files with 7,678 additions and 609 deletions.
2 changes: 1 addition & 1 deletion lib_nbgl/fonts/nbgl_font_hmalpha_mono_medium_32.inc
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ __attribute__ ((section("._nbgl_fonts_"))) const unsigned char bitmapHMALPHAMONO
};

__attribute__ ((section("._nbgl_fonts_"))) const nbgl_font_character_t charactersHMALPHAMONO_MEDIUM_32PX[59] = {
{ 0, 0, 10,0, 0, 0, 0 }, //asciii 0x0020
{ 1, 0, 10,0, 0, 0, 0 }, //asciii 0x0020
{ 1, 0, 19,7, 0, 7, 6 }, //asciii 0x0021
{ 1, 31, 19,4, 0, 4, 2 }, //asciii 0x0022
{ 1, 54, 19,0, 0, 0, 6 }, //asciii 0x0023
Expand Down
666 changes: 666 additions & 0 deletions lib_nbgl/fonts/nbgl_font_hmalpha_mono_medium_32.json

Large diffs are not rendered by default.

208 changes: 105 additions & 103 deletions lib_nbgl/fonts/nbgl_font_inter_medium_32.inc
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ __attribute__ ((section("._nbgl_fonts_"))) const unsigned char bitmapINTER_MEDIU
0xC3, 0x0D, 0x60, 0x02, 0x0A, 0xC2, 0x85, 0x42,
0x40, 0x04, 0xC6, 0xBE, 0xB7, 0x45, 0xF0,
//ascii 0x002D
0xFE, 0x66, 0xBF, 0xFF, 0xFB, 0x00, 0x5F, 0xFF,
0xFB, 0x00, 0x5F, 0xFF, 0xFB, 0x00, 0x5F, 0xFF,
0xFB, 0x00, 0x5F, 0xFF, 0xFB, 0x00, 0x5F, 0xFF,
0xFB, 0x00, 0x5F, 0xFF, 0xFB, 0x00, 0x5F, 0xFF,
0xFB, 0x00, 0x5F, 0xFF, 0xFB, 0x00, 0x5F, 0xFF,
0xFD, 0x33, 0x8F, 0xFF,
0xC0, 0x0E, 0x16, 0x0B, 0xC3, 0x0B, 0x10, 0x05,
0xC3, 0x0B, 0x10, 0x05, 0xC3, 0x0B, 0x10, 0x05,
0xC3, 0x0B, 0x10, 0x05, 0xC3, 0x0B, 0x10, 0x05,
0xC3, 0x0B, 0x10, 0x05, 0xC3, 0x0B, 0x10, 0x05,
0xC3, 0x0B, 0x10, 0x05, 0xC3, 0x0B, 0x10, 0x05,
0xC3, 0x0D, 0x13, 0x08, 0xC2,
//ascii 0x002E
0xC0, 0x0C, 0x14, 0x0D, 0xC3, 0x20, 0x01, 0xC2,
0x0C, 0x30, 0x0D, 0xC2, 0x20, 0x01, 0xC3, 0x0D,
Expand Down Expand Up @@ -956,10 +956,12 @@ __attribute__ ((section("._nbgl_fonts_"))) const unsigned char bitmapINTER_MEDIU
0x06, 0xCA, 0x07, 0x30, 0x0C, 0xCB, 0x98, 0x10,
0xC0, 0xCD, 0x0A, 0x0D, 0xC2,
//ascii 0x005F
0xFF, 0xF5, 0xF0, 0x01, 0xF0, 0x01, 0xF0, 0x01,
0xF0, 0x01, 0xF0, 0x01, 0xF0, 0x01, 0xF0, 0x01,
0xF0, 0x01, 0xF0, 0x01, 0xF0, 0x01, 0xF0, 0x01,
0xF0, 0x01, 0xF0, 0x01, 0xF0, 0x01,
0xC2, 0x05, 0xC0, 0x10, 0x01, 0xC0, 0x10, 0x01,
0xC0, 0x10, 0x01, 0xC0, 0x10, 0x01, 0xC0, 0x10,
0x01, 0xC0, 0x10, 0x01, 0xC0, 0x10, 0x01, 0xC0,
0x10, 0x01, 0xC0, 0x10, 0x01, 0xC0, 0x10, 0x01,
0xC0, 0x10, 0x01, 0xC0, 0x10, 0x01, 0xC0, 0x10,
0x01, 0xC0, 0x10, 0x01,
//ascii 0x0060
0xC3, 0x8D, 0x4D, 0xC2, 0x0D, 0x04, 0x10, 0x0D,
0xC1, 0x04, 0x30, 0x0E, 0xC1, 0x20, 0x03, 0x0E,
Expand Down Expand Up @@ -1354,19 +1356,19 @@ __attribute__ ((section("._nbgl_fonts_"))) const unsigned char bitmapINTER_MEDIU
0x03, 0xC1, 0x0E, 0x10, 0x06, 0xD6, 0x81, 0x02,
0xC1,
//ascii 0x007E
0xF6, 0x58, 0xEF, 0xFF, 0xF2, 0x00, 0x0A, 0xFF,
0xF2, 0x00, 0x00, 0xDF, 0xFE, 0xB2, 0x00, 0x5F,
0xFF, 0xFD, 0x00, 0x2F, 0xFF, 0xFE, 0x00, 0x2F,
0xFF, 0xF6, 0x00, 0x6F, 0xFF, 0xB0, 0x00, 0xEF,
0xFD, 0x00, 0x0A, 0xFF, 0xF3, 0x00, 0x6F, 0xFF,
0xD0, 0x02, 0xFF, 0xFF, 0xA0, 0x06, 0xFF, 0xFF,
0xB0, 0x02, 0xFF, 0xFF, 0xF0, 0x00, 0x38, 0xEF,
0xF7, 0x00, 0x00, 0xCF, 0xFF, 0x80, 0x00, 0xCF,
0xFF, 0xFF, 0xCA, 0xEF,
0xAF, 0x65, 0x8E, 0xC3, 0x02, 0x20, 0x0A, 0xC2,
0x02, 0x30, 0x0D, 0xC1, 0x8E, 0xB2, 0x10, 0x05,
0xC3, 0x0D, 0x10, 0x02, 0xC3, 0x0E, 0x10, 0x02,
0xC3, 0x06, 0x10, 0x06, 0xC2, 0x0B, 0x20, 0x0E,
0xC1, 0x0D, 0x20, 0x0A, 0xC2, 0x03, 0x10, 0x06,
0xC2, 0x0D, 0x10, 0x02, 0xC3, 0x0A, 0x10, 0x06,
0xC3, 0x0B, 0x10, 0x02, 0xC4, 0x20, 0x83, 0x8E,
0xC1, 0x07, 0x30, 0x0C, 0xC2, 0x08, 0x20, 0x0C,
0xC4, 0x9C, 0xAE, 0xF0,
};

__attribute__ ((section("._nbgl_fonts_"))) const nbgl_font_character_t charactersINTER_MEDIUM_32PX[95] = {
{ 0, 0, 8,0, 0, 0, 0 }, //asciii 0x0020
{ 1, 0, 8,0, 0, 0, 0 }, //asciii 0x0020
{ 1, 0, 9,2, 0, 2, 6 }, //asciii 0x0021
{ 1, 42, 13,2, 0, 2, 2 }, //asciii 0x0022
{ 1, 61, 20,0, 0, 0, 6 }, //asciii 0x0023
Expand All @@ -1379,92 +1381,92 @@ __attribute__ ((section("._nbgl_fonts_"))) const unsigned char bitmapINTER_MEDIU
{ 1, 924, 17,2, 0, 2, 3 }, //asciii 0x002A
{ 1, 1007, 21,3, 2, 2, 3 }, //asciii 0x002B
{ 1, 1077, 9,2, 5, 2, 2 }, //asciii 0x002C
{ 0, 1100, 15,2, 3, 2, 1 }, //asciii 0x002D
{ 1, 1144, 9,2, 5, 2, 1 }, //asciii 0x002E
{ 1, 1163, 12,0, 0, 1, 7 }, //asciii 0x002F
{ 1, 1219, 21,1, 0, 2, 6 }, //asciii 0x0030
{ 1, 1356, 15,1, 0, 3, 6 }, //asciii 0x0031
{ 1, 1401, 20,2, 0, 2, 6 }, //asciii 0x0032
{ 1, 1537, 21,2, 0, 2, 6 }, //asciii 0x0033
{ 1, 1694, 21,1, 0, 1, 6 }, //asciii 0x0034
{ 1, 1814, 20,2, 0, 2, 6 }, //asciii 0x0035
{ 1, 1980, 20,1, 0, 1, 6 }, //asciii 0x0036
{ 1, 2150, 19,1, 0, 2, 6 }, //asciii 0x0037
{ 1, 2269, 20,1, 0, 1, 6 }, //asciii 0x0038
{ 1, 2448, 20,1, 0, 1, 6 }, //asciii 0x0039
{ 1, 2618, 9,2, 2, 2, 4 }, //asciii 0x003A
{ 1, 2654, 9,2, 2, 1, 5 }, //asciii 0x003B
{ 1, 2697, 21,3, 1, 2, 5 }, //asciii 0x003C
{ 1, 2799, 21,3, 2, 3, 3 }, //asciii 0x003D
{ 1, 2918, 21,3, 1, 2, 5 }, //asciii 0x003E
{ 1, 3020, 17,1, 0, 1, 6 }, //asciii 0x003F
{ 1, 3123, 31,1, 0, 1, 7 }, //asciii 0x0040
{ 1, 3443, 22,1, 0, 0, 6 }, //asciii 0x0041
{ 1, 3569, 21,2, 0, 1, 6 }, //asciii 0x0042
{ 1, 3725, 24,1, 0, 2, 6 }, //asciii 0x0043
{ 1, 3886, 23,2, 0, 1, 6 }, //asciii 0x0044
{ 1, 4017, 19,2, 0, 1, 6 }, //asciii 0x0045
{ 1, 4150, 19,2, 0, 2, 6 }, //asciii 0x0046
{ 1, 4254, 24,1, 0, 1, 6 }, //asciii 0x0047
{ 1, 4428, 24,2, 0, 2, 6 }, //asciii 0x0048
{ 1, 4519, 15,1, 0, 1, 6 }, //asciii 0x0049
{ 1, 4595, 18,1, 0, 2, 6 }, //asciii 0x004A
{ 1, 4663, 21,2, 0, 0, 6 }, //asciii 0x004B
{ 1, 4782, 18,2, 0, 1, 6 }, //asciii 0x004C
{ 1, 4824, 29,2, 0, 2, 6 }, //asciii 0x004D
{ 1, 4960, 24,2, 0, 2, 6 }, //asciii 0x004E
{ 1, 5059, 25,1, 0, 2, 6 }, //asciii 0x004F
{ 1, 5225, 20,2, 0, 1, 6 }, //asciii 0x0050
{ 1, 5338, 25,1, 0, 2, 6 }, //asciii 0x0051
{ 1, 5524, 21,2, 0, 1, 6 }, //asciii 0x0052
{ 1, 5656, 21,1, 0, 2, 6 }, //asciii 0x0053
{ 1, 5839, 21,1, 0, 1, 6 }, //asciii 0x0054
{ 1, 5924, 24,2, 0, 3, 6 }, //asciii 0x0055
{ 1, 6020, 22,1, 0, 0, 6 }, //asciii 0x0056
{ 1, 6128, 31,0, 0, 0, 6 }, //asciii 0x0057
{ 1, 6295, 21,1, 0, 0, 6 }, //asciii 0x0058
{ 1, 6441, 22,1, 0, 1, 6 }, //asciii 0x0059
{ 1, 6539, 20,1, 0, 1, 6 }, //asciii 0x005A
{ 1, 6685, 12,3, 0, 0, 7 }, //asciii 0x005B
{ 1, 6742, 12,0, 0, 1, 7 }, //asciii 0x005C
{ 1, 6798, 12,1, 0, 3, 7 }, //asciii 0x005D
{ 1, 6856, 15,1, 0, 1, 3 }, //asciii 0x005E
{ 0, 6917, 15,0, 6, 0, 0 }, //asciii 0x005F
{ 1, 6947, 16,5, 0, 5, 1 }, //asciii 0x0060
{ 1, 6970, 18,1, 1, 2, 5 }, //asciii 0x0061
{ 1, 7100, 20,2, 0, 1, 6 }, //asciii 0x0062
{ 1, 7215, 18,1, 1, 1, 5 }, //asciii 0x0063
{ 1, 7333, 20,1, 0, 2, 6 }, //asciii 0x0064
{ 1, 7451, 19,1, 1, 1, 5 }, //asciii 0x0065
{ 1, 7606, 12,0, 0, 0, 6 }, //asciii 0x0066
{ 1, 7677, 20,1, 1, 2, 6 }, //asciii 0x0067
{ 1, 7846, 19,2, 0, 2, 6 }, //asciii 0x0068
{ 1, 7917, 8,1, 0, 1, 6 }, //asciii 0x0069
{ 1, 7954, 8,0, 0, 0, 7 }, //asciii 0x006A
{ 1, 8010, 18,2, 0, 0, 6 }, //asciii 0x006B
{ 1, 8105, 9,2, 0, 0, 6 }, //asciii 0x006C
{ 1, 8142, 28,2, 1, 2, 5 }, //asciii 0x006D
{ 1, 8252, 19,2, 1, 2, 5 }, //asciii 0x006E
{ 1, 8323, 19,1, 1, 1, 5 }, //asciii 0x006F
{ 1, 8444, 20,2, 1, 1, 6 }, //asciii 0x0070
{ 1, 8567, 20,1, 1, 2, 6 }, //asciii 0x0071
{ 1, 8688, 12,2, 1, 0, 5 }, //asciii 0x0072
{ 1, 8735, 17,1, 1, 1, 5 }, //asciii 0x0073
{ 1, 8874, 12,0, 0, 1, 6 }, //asciii 0x0074
{ 1, 8946, 19,2, 1, 2, 5 }, //asciii 0x0075
{ 1, 9021, 18,1, 1, 1, 5 }, //asciii 0x0076
{ 1, 9102, 26,1, 1, 0, 5 }, //asciii 0x0077
{ 1, 9231, 18,1, 1, 1, 5 }, //asciii 0x0078
{ 1, 9343, 18,1, 1, 1, 6 }, //asciii 0x0079
{ 1, 9451, 18,1, 1, 2, 5 }, //asciii 0x007A
{ 1, 9565, 12,1, 0, 0, 7 }, //asciii 0x007B
{ 1, 9646, 11,4, 0, 4, 7 }, //asciii 0x007C
{ 1, 9661, 12,1, 0, 1, 7 }, //asciii 0x007D
{ 0, 9742, 21,2, 3, 2, 1 }, //asciii 0x007E
{ 1, 1100, 15,2, 3, 2, 1 }, //asciii 0x002D
{ 1, 1145, 9,2, 5, 2, 1 }, //asciii 0x002E
{ 1, 1164, 12,0, 0, 1, 7 }, //asciii 0x002F
{ 1, 1220, 21,1, 0, 2, 6 }, //asciii 0x0030
{ 1, 1357, 15,1, 0, 3, 6 }, //asciii 0x0031
{ 1, 1402, 20,2, 0, 2, 6 }, //asciii 0x0032
{ 1, 1538, 21,2, 0, 2, 6 }, //asciii 0x0033
{ 1, 1695, 21,1, 0, 1, 6 }, //asciii 0x0034
{ 1, 1815, 20,2, 0, 2, 6 }, //asciii 0x0035
{ 1, 1981, 20,1, 0, 1, 6 }, //asciii 0x0036
{ 1, 2151, 19,1, 0, 2, 6 }, //asciii 0x0037
{ 1, 2270, 20,1, 0, 1, 6 }, //asciii 0x0038
{ 1, 2449, 20,1, 0, 1, 6 }, //asciii 0x0039
{ 1, 2619, 9,2, 2, 2, 4 }, //asciii 0x003A
{ 1, 2655, 9,2, 2, 1, 5 }, //asciii 0x003B
{ 1, 2698, 21,3, 1, 2, 5 }, //asciii 0x003C
{ 1, 2800, 21,3, 2, 3, 3 }, //asciii 0x003D
{ 1, 2919, 21,3, 1, 2, 5 }, //asciii 0x003E
{ 1, 3021, 17,1, 0, 1, 6 }, //asciii 0x003F
{ 1, 3124, 31,1, 0, 1, 7 }, //asciii 0x0040
{ 1, 3444, 22,1, 0, 0, 6 }, //asciii 0x0041
{ 1, 3570, 21,2, 0, 1, 6 }, //asciii 0x0042
{ 1, 3726, 24,1, 0, 2, 6 }, //asciii 0x0043
{ 1, 3887, 23,2, 0, 1, 6 }, //asciii 0x0044
{ 1, 4018, 19,2, 0, 1, 6 }, //asciii 0x0045
{ 1, 4151, 19,2, 0, 2, 6 }, //asciii 0x0046
{ 1, 4255, 24,1, 0, 1, 6 }, //asciii 0x0047
{ 1, 4429, 24,2, 0, 2, 6 }, //asciii 0x0048
{ 1, 4520, 15,1, 0, 1, 6 }, //asciii 0x0049
{ 1, 4596, 18,1, 0, 2, 6 }, //asciii 0x004A
{ 1, 4664, 21,2, 0, 0, 6 }, //asciii 0x004B
{ 1, 4783, 18,2, 0, 1, 6 }, //asciii 0x004C
{ 1, 4825, 29,2, 0, 2, 6 }, //asciii 0x004D
{ 1, 4961, 24,2, 0, 2, 6 }, //asciii 0x004E
{ 1, 5060, 25,1, 0, 2, 6 }, //asciii 0x004F
{ 1, 5226, 20,2, 0, 1, 6 }, //asciii 0x0050
{ 1, 5339, 25,1, 0, 2, 6 }, //asciii 0x0051
{ 1, 5525, 21,2, 0, 1, 6 }, //asciii 0x0052
{ 1, 5657, 21,1, 0, 2, 6 }, //asciii 0x0053
{ 1, 5840, 21,1, 0, 1, 6 }, //asciii 0x0054
{ 1, 5925, 24,2, 0, 3, 6 }, //asciii 0x0055
{ 1, 6021, 22,1, 0, 0, 6 }, //asciii 0x0056
{ 1, 6129, 31,0, 0, 0, 6 }, //asciii 0x0057
{ 1, 6296, 21,1, 0, 0, 6 }, //asciii 0x0058
{ 1, 6442, 22,1, 0, 1, 6 }, //asciii 0x0059
{ 1, 6540, 20,1, 0, 1, 6 }, //asciii 0x005A
{ 1, 6686, 12,3, 0, 0, 7 }, //asciii 0x005B
{ 1, 6743, 12,0, 0, 1, 7 }, //asciii 0x005C
{ 1, 6799, 12,1, 0, 3, 7 }, //asciii 0x005D
{ 1, 6857, 15,1, 0, 1, 3 }, //asciii 0x005E
{ 1, 6918, 15,0, 6, 0, 0 }, //asciii 0x005F
{ 1, 6962, 16,5, 0, 5, 1 }, //asciii 0x0060
{ 1, 6985, 18,1, 1, 2, 5 }, //asciii 0x0061
{ 1, 7115, 20,2, 0, 1, 6 }, //asciii 0x0062
{ 1, 7230, 18,1, 1, 1, 5 }, //asciii 0x0063
{ 1, 7348, 20,1, 0, 2, 6 }, //asciii 0x0064
{ 1, 7466, 19,1, 1, 1, 5 }, //asciii 0x0065
{ 1, 7621, 12,0, 0, 0, 6 }, //asciii 0x0066
{ 1, 7692, 20,1, 1, 2, 6 }, //asciii 0x0067
{ 1, 7861, 19,2, 0, 2, 6 }, //asciii 0x0068
{ 1, 7932, 8,1, 0, 1, 6 }, //asciii 0x0069
{ 1, 7969, 8,0, 0, 0, 7 }, //asciii 0x006A
{ 1, 8025, 18,2, 0, 0, 6 }, //asciii 0x006B
{ 1, 8120, 9,2, 0, 0, 6 }, //asciii 0x006C
{ 1, 8157, 28,2, 1, 2, 5 }, //asciii 0x006D
{ 1, 8267, 19,2, 1, 2, 5 }, //asciii 0x006E
{ 1, 8338, 19,1, 1, 1, 5 }, //asciii 0x006F
{ 1, 8459, 20,2, 1, 1, 6 }, //asciii 0x0070
{ 1, 8582, 20,1, 1, 2, 6 }, //asciii 0x0071
{ 1, 8703, 12,2, 1, 0, 5 }, //asciii 0x0072
{ 1, 8750, 17,1, 1, 1, 5 }, //asciii 0x0073
{ 1, 8889, 12,0, 0, 1, 6 }, //asciii 0x0074
{ 1, 8961, 19,2, 1, 2, 5 }, //asciii 0x0075
{ 1, 9036, 18,1, 1, 1, 5 }, //asciii 0x0076
{ 1, 9117, 26,1, 1, 0, 5 }, //asciii 0x0077
{ 1, 9246, 18,1, 1, 1, 5 }, //asciii 0x0078
{ 1, 9358, 18,1, 1, 1, 6 }, //asciii 0x0079
{ 1, 9466, 18,1, 1, 2, 5 }, //asciii 0x007A
{ 1, 9580, 12,1, 0, 0, 7 }, //asciii 0x007B
{ 1, 9661, 11,4, 0, 4, 7 }, //asciii 0x007C
{ 1, 9676, 12,1, 0, 1, 7 }, //asciii 0x007D
{ 1, 9757, 21,2, 3, 2, 1 }, //asciii 0x007E
};

__attribute__ ((section("._nbgl_fonts_"))) const nbgl_font_t fontINTER_MEDIUM_32PX = {
9810, // bitmap len
9825, // bitmap len
BAGL_FONT_INTER_MEDIUM_32px, // font id
(uint8_t) NBGL_BPP_4, // bpp
32, // font height in pixels
Expand Down
Loading

0 comments on commit b1a23b2

Please sign in to comment.