diff --git a/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c b/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c index 02abc63a3..9d8c8aec0 100644 --- a/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c +++ b/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c @@ -1,12 +1,11 @@ #include -// 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 -// rest is packed 4-bit glyph data - // clang-format off +// - the first two bytes are width and height of the glyph +// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// - the rest is packed 1-bit glyph data + /* */ static const uint8_t Font_PixelOperator_Bold_8_glyph_32[] = { 0, 0, 4, 0, 0 }; /* ! */ static const uint8_t Font_PixelOperator_Bold_8_glyph_33[] = { 2, 7, 6, 2, 7, 255, 204 }; /* " */ static const uint8_t Font_PixelOperator_Bold_8_glyph_34[] = { 5, 3, 7, 1, 7, 222, 246 }; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c b/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c index 791e7ddee..ca16a7c77 100644 --- a/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c +++ b/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c @@ -1,12 +1,11 @@ #include -// 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 -// rest is packed 4-bit glyph data - // clang-format off +// - the first two bytes are width and height of the glyph +// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// - the rest is packed 1-bit glyph data + /* */ static const uint8_t Font_PixelOperator_Regular_8_glyph_32[] = { 0, 0, 4, 0, 0 }; /* ! */ static const uint8_t Font_PixelOperator_Regular_8_glyph_33[] = { 1, 7, 5, 2, 7, 250 }; /* " */ static const uint8_t Font_PixelOperator_Regular_8_glyph_34[] = { 3, 3, 7, 2, 7, 182, 128 }; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c b/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c index f89846ee6..3c2987dc4 100644 --- a/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c +++ b/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c @@ -1,12 +1,11 @@ #include -// 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 -// rest is packed 4-bit glyph data - // clang-format off +// - the first two bytes are width and height of the glyph +// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// - the rest is packed 1-bit glyph data + /* */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_32[] = { 0, 0, 8, 0, 0 }; /* ! */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_33[] = { 1, 7, 8, 3, 7, 250 }; /* " */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_34[] = { 3, 3, 8, 2, 7, 182, 128 }; diff --git a/core/embed/extmod/modtrezorui/font_roboto_bold_20.c b/core/embed/extmod/modtrezorui/font_roboto_bold_20.c index 4b08ac8bd..54640a0cb 100644 --- a/core/embed/extmod/modtrezorui/font_roboto_bold_20.c +++ b/core/embed/extmod/modtrezorui/font_roboto_bold_20.c @@ -1,12 +1,11 @@ #include -// 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 -// rest is packed 4-bit glyph data - // clang-format off +// - the first two bytes are width and height of the glyph +// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// - the rest is packed 4-bit glyph data + /* */ 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/core/embed/extmod/modtrezorui/font_roboto_regular_20.c b/core/embed/extmod/modtrezorui/font_roboto_regular_20.c index ea28fa5c8..8e157aee0 100644 --- a/core/embed/extmod/modtrezorui/font_roboto_regular_20.c +++ b/core/embed/extmod/modtrezorui/font_roboto_regular_20.c @@ -1,12 +1,11 @@ #include -// 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 -// rest is packed 4-bit glyph data - // clang-format off +// - the first two bytes are width and height of the glyph +// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// - the rest is packed 4-bit glyph data + /* */ 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/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c b/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c index 15aa9f890..0360c0495 100644 --- a/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c +++ b/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c @@ -1,12 +1,11 @@ #include -// 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 -// rest is packed 4-bit glyph data - // clang-format off +// - the first two bytes are width and height of the glyph +// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph +// - the rest is packed 4-bit glyph data + /* */ 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/core/tools/codegen/gen_font.py b/core/tools/codegen/gen_font.py index 2a57176eb..5d6412657 100755 --- a/core/tools/codegen/gen_font.py +++ b/core/tools/codegen/gen_font.py @@ -72,11 +72,10 @@ def process_face(name, style, size, bpp=4): ) with open("font_%s.c" % fontname, "wt") as f: f.write("#include \n\n") - f.write("// first two bytes are width and height 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") + f.write("// - the first two bytes are width and height of the glyph\n") + f.write("// - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph\n") + f.write("// - the rest is packed %d-bit glyph data\n\n" % bpp) 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)