nodemcu-firmware/tools/u8g2_config_fonts.pl

32 lines
539 B
Perl
Raw Normal View History

2017-05-26 21:39:29 +02:00
#!/usr/bin/perl -w
my @font_selection;
# scan provided header file for CONFIG_U8G2_FONT_SELECTION entry
while (<STDIN>) {
if (/^\s*#\s*define\s+CONFIG_U8G2_FONT_SELECTION\s+"([^"]+)"/) {
@font_selection = split(/,/, $1);
last;
}
}
2017-06-13 19:03:25 +02:00
print << 'HEADER';
2017-05-26 21:39:29 +02:00
#ifndef _U8G2_FONTS_H
#define _U8G2_FONTS_H
#define U8G2_FONT_TABLE_ENTRY(font)
#define U8G2_FONT_TABLE \
HEADER
2017-06-13 19:03:25 +02:00
foreach my $font (@font_selection) {
print(" U8G2_FONT_TABLE_ENTRY($font) \\\n");
}
2017-05-26 21:39:29 +02:00
2017-06-13 19:03:25 +02:00
print << 'FOOTER';
2017-05-26 21:39:29 +02:00
#endif /* _U8G2_FONTS_H */
FOOTER