1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 00:08:10 +00:00

core/fonts: update headers

This commit is contained in:
Pavol Rusnak 2020-07-28 10:55:27 +02:00
parent 3021233eaf
commit a6451dad46
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
7 changed files with 27 additions and 34 deletions

View File

@ -1,12 +1,11 @@
#include <stdint.h> #include <stdint.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
// rest is packed 4-bit glyph data
// clang-format off // 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_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_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 }; /* " */ static const uint8_t Font_PixelOperator_Bold_8_glyph_34[] = { 5, 3, 7, 1, 7, 222, 246 };

View File

@ -1,12 +1,11 @@
#include <stdint.h> #include <stdint.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
// rest is packed 4-bit glyph data
// clang-format off // 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_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_33[] = { 1, 7, 5, 2, 7, 250 };
/* " */ static const uint8_t Font_PixelOperator_Regular_8_glyph_34[] = { 3, 3, 7, 2, 7, 182, 128 }; /* " */ static const uint8_t Font_PixelOperator_Regular_8_glyph_34[] = { 3, 3, 7, 2, 7, 182, 128 };

View File

@ -1,12 +1,11 @@
#include <stdint.h> #include <stdint.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
// rest is packed 4-bit glyph data
// clang-format off // 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_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_33[] = { 1, 7, 8, 3, 7, 250 };
/* " */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_34[] = { 3, 3, 8, 2, 7, 182, 128 }; /* " */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_34[] = { 3, 3, 8, 2, 7, 182, 128 };

View File

@ -1,12 +1,11 @@
#include <stdint.h> #include <stdint.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
// rest is packed 4-bit glyph data
// clang-format off // 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_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_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 }; /* " */ 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 };

View File

@ -1,12 +1,11 @@
#include <stdint.h> #include <stdint.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
// rest is packed 4-bit glyph data
// clang-format off // 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_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_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 }; /* " */ 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 };

View File

@ -1,12 +1,11 @@
#include <stdint.h> #include <stdint.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
// rest is packed 4-bit glyph data
// clang-format off // 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_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_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 }; /* " */ 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 };

View File

@ -72,11 +72,10 @@ def process_face(name, style, size, bpp=4):
) )
with open("font_%s.c" % fontname, "wt") as f: with open("font_%s.c" % fontname, "wt") as f:
f.write("#include <stdint.h>\n\n") f.write("#include <stdint.h>\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("// 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): for i in range(MIN_GLYPH, MAX_GLYPH + 1):
c = chr(i) c = chr(i)
face.load_char(c, freetype.FT_LOAD_RENDER | freetype.FT_LOAD_TARGET_NORMAL) face.load_char(c, freetype.FT_LOAD_RENDER | freetype.FT_LOAD_TARGET_NORMAL)