diff --git a/embed/bootloader/icon_cancel.h b/embed/bootloader/icon_cancel.h index b36207828f..d983ae3a69 100644 --- a/embed/bootloader/icon_cancel.h +++ b/embed/bootloader/icon_cancel.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_cancel[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_confirm.h b/embed/bootloader/icon_confirm.h index de4b9cf309..ded1cd2979 100644 --- a/embed/bootloader/icon_confirm.h +++ b/embed/bootloader/icon_confirm.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_confirm[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_done.h b/embed/bootloader/icon_done.h index 812349085e..a57196b4f6 100644 --- a/embed/bootloader/icon_done.h +++ b/embed/bootloader/icon_done.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_done[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_fail.h b/embed/bootloader/icon_fail.h index 3ce0aa1568..7d4f957374 100644 --- a/embed/bootloader/icon_fail.h +++ b/embed/bootloader/icon_fail.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_fail[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_info.h b/embed/bootloader/icon_info.h index 484d447e87..270a0710a3 100644 --- a/embed/bootloader/icon_info.h +++ b/embed/bootloader/icon_info.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_info[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_install.h b/embed/bootloader/icon_install.h index 9d97f99757..2ab3cada2b 100644 --- a/embed/bootloader/icon_install.h +++ b/embed/bootloader/icon_install.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_install[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_logo.h b/embed/bootloader/icon_logo.h index a12ffa2c17..92134acc17 100644 --- a/embed/bootloader/icon_logo.h +++ b/embed/bootloader/icon_logo.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_logo[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_safeplace.h b/embed/bootloader/icon_safeplace.h index f514239983..038007e52e 100644 --- a/embed/bootloader/icon_safeplace.h +++ b/embed/bootloader/icon_safeplace.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_safeplace[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_welcome.h b/embed/bootloader/icon_welcome.h index 0ec1a0d267..73d5483642 100644 --- a/embed/bootloader/icon_welcome.h +++ b/embed/bootloader/icon_welcome.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_welcome[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/bootloader/icon_wipe.h b/embed/bootloader/icon_wipe.h index 1e5d2a72e8..dcc93bea30 100644 --- a/embed/bootloader/icon_wipe.h +++ b/embed/bootloader/icon_wipe.h @@ -1,3 +1,4 @@ +// clang-format off static const uint8_t toi_icon_wipe[] = { // magic 'T', 'O', 'I', 'g', diff --git a/embed/extmod/modtrezorui/font_roboto_bold_20.c b/embed/extmod/modtrezorui/font_roboto_bold_20.c index 2fa07cd161..657468891d 100644 --- a/embed/extmod/modtrezorui/font_roboto_bold_20.c +++ b/embed/extmod/modtrezorui/font_roboto_bold_20.c @@ -1,9 +1,12 @@ #include "font_roboto_bold_20.h" // first two bytes are width and height of the glyph -// third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// third, fourth and fifth bytes are advance +// bearingX and bearingY of the horizontal metrics of the glyph // rest is packed 4-bit glyph data +// clang-format off + /* */ static const uint8_t Font_Roboto_Bold_20_glyph_32[] = { 0, 0, 5, 0, 0 }; /* ! */ static const uint8_t Font_Roboto_Bold_20_glyph_33[] = { 3, 15, 5, 1, 15, 255, 223, 253, 255, 223, 253, 255, 223, 253, 255, 223, 253, 255, 223, 253, 0, 0, 0, 159, 111, 252, 159, 96 }; /* " */ static const uint8_t Font_Roboto_Bold_20_glyph_34[] = { 5, 5, 7, 1, 15, 255, 15, 255, 240, 255, 253, 15, 223, 176, 252, 250, 15, 160 }; diff --git a/embed/extmod/modtrezorui/font_roboto_bold_20.h b/embed/extmod/modtrezorui/font_roboto_bold_20.h index 74055e69bb..6f48d259a7 100644 --- a/embed/extmod/modtrezorui/font_roboto_bold_20.h +++ b/embed/extmod/modtrezorui/font_roboto_bold_20.h @@ -1,3 +1,3 @@ #include -extern const uint8_t * const Font_Roboto_Bold_20[126 + 1 - 32]; +extern const uint8_t* const Font_Roboto_Bold_20[126 + 1 - 32]; diff --git a/embed/extmod/modtrezorui/font_roboto_regular_20.c b/embed/extmod/modtrezorui/font_roboto_regular_20.c index 9d8be02618..05d5a869d3 100644 --- a/embed/extmod/modtrezorui/font_roboto_regular_20.c +++ b/embed/extmod/modtrezorui/font_roboto_regular_20.c @@ -1,9 +1,12 @@ #include "font_roboto_regular_20.h" // first two bytes are width and height of the glyph -// third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// third, fourth and fifth bytes are advance +// bearingX and bearingY of the horizontal metrics of the glyph // rest is packed 4-bit glyph data +// clang-format off + /* */ static const uint8_t Font_Roboto_Regular_20_glyph_32[] = { 0, 0, 5, 0, 0 }; /* ! */ static const uint8_t Font_Roboto_Regular_20_glyph_33[] = { 2, 15, 5, 2, 15, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 0, 0, 0, 83, 201 }; /* " */ static const uint8_t Font_Roboto_Regular_20_glyph_34[] = { 4, 5, 6, 1, 15, 253, 223, 252, 223, 251, 222, 249, 220, 247, 218 }; diff --git a/embed/extmod/modtrezorui/font_roboto_regular_20.h b/embed/extmod/modtrezorui/font_roboto_regular_20.h index 2f202bdf3c..fdd40eec4e 100644 --- a/embed/extmod/modtrezorui/font_roboto_regular_20.h +++ b/embed/extmod/modtrezorui/font_roboto_regular_20.h @@ -1,3 +1,3 @@ #include -extern const uint8_t * const Font_Roboto_Regular_20[126 + 1 - 32]; +extern const uint8_t* const Font_Roboto_Regular_20[126 + 1 - 32]; diff --git a/embed/extmod/modtrezorui/font_robotomono_regular_20.c b/embed/extmod/modtrezorui/font_robotomono_regular_20.c index 331001b306..d9b4a349a2 100644 --- a/embed/extmod/modtrezorui/font_robotomono_regular_20.c +++ b/embed/extmod/modtrezorui/font_robotomono_regular_20.c @@ -1,9 +1,12 @@ #include "font_robotomono_regular_20.h" // first two bytes are width and height of the glyph -// third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// third, fourth and fifth bytes are advance +// bearingX and bearingY of the horizontal metrics of the glyph // rest is packed 4-bit glyph data +// clang-format off + /* */ static const uint8_t Font_RobotoMono_Regular_20_glyph_32[] = { 0, 0, 12, 0, 0 }; /* ! */ static const uint8_t Font_RobotoMono_Regular_20_glyph_33[] = { 3, 15, 12, 4, 15, 31, 177, 251, 31, 177, 251, 31, 177, 251, 31, 177, 251, 31, 177, 251, 0, 0, 0, 1, 2, 253, 30, 192 }; /* " */ static const uint8_t Font_RobotoMono_Regular_20_glyph_34[] = { 6, 5, 12, 3, 15, 143, 0, 246, 142, 0, 246, 141, 0, 245, 140, 0, 244, 140, 0, 243 }; diff --git a/embed/extmod/modtrezorui/font_robotomono_regular_20.h b/embed/extmod/modtrezorui/font_robotomono_regular_20.h index dc1fcbae48..bf86bf34b7 100644 --- a/embed/extmod/modtrezorui/font_robotomono_regular_20.h +++ b/embed/extmod/modtrezorui/font_robotomono_regular_20.h @@ -1,3 +1,3 @@ #include -extern const uint8_t * const Font_RobotoMono_Regular_20[126 + 1 - 32]; +extern const uint8_t* const Font_RobotoMono_Regular_20[126 + 1 - 32]; diff --git a/tools/codegen/gen_font.py b/tools/codegen/gen_font.py index 6eefe90bfd..e682131f95 100755 --- a/tools/codegen/gen_font.py +++ b/tools/codegen/gen_font.py @@ -20,12 +20,14 @@ def process_face(name, style, size): fontname = '%s_%s_%d' % (name.lower(), style.lower(), size) with open('font_%s.h' % fontname, 'wt') as f: f.write('#include \n\n') - f.write('extern const uint8_t * const Font_%s_%s_%d[%d + 1 - %d];\n' % (name, style, size, MAX_GLYPH, MIN_GLYPH)) + f.write('extern const uint8_t* const Font_%s_%s_%d[%d + 1 - %d];\n' % (name, style, size, MAX_GLYPH, MIN_GLYPH)) with open('font_%s.c' % fontname, 'wt') as f: f.write('#include "font_%s.h"\n\n' % fontname) f.write('// first two bytes are width and height of the glyph\n') - f.write('// third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph\n') + f.write('// third, fourth and fifth bytes are advance\n') + f.write('// bearingX and bearingY of the horizontal metrics of the glyph\n') f.write('// rest is packed 4-bit glyph data\n\n') + f.write('// clang-format off\n\n') for i in range(MIN_GLYPH, MAX_GLYPH + 1): c = chr(i) face.load_char(c, freetype.FT_LOAD_RENDER | freetype.FT_LOAD_TARGET_NORMAL) diff --git a/tools/png2toi b/tools/png2toi index 096b6cdc56..f80c339705 100755 --- a/tools/png2toi +++ b/tools/png2toi @@ -75,6 +75,7 @@ def process_image(ifn, savefiles=False): f.write(('%s = %s\n' % (bname, data)).encode()) print('Written %s ... %d bytes' % (ofn_py, len(data))) with open(ofn_h, 'wt') as f: + f.write('// clang-format off\n') f.write('static const uint8_t toi_%s[] = {\n' % bname) f.write(' // magic\n') if im.mode == 'RGB':