This commit is contained in:
kraus 2018-05-07 20:58:23 +02:00
parent ef106170cb
commit 385f388a52
3 changed files with 70 additions and 1 deletions

View File

@ -195,7 +195,7 @@ struct groupinfo gi[] = {
#define MM_N 8 /* numbers */
#define MM_C 16 /* custom */
#define MM_M 32 /* map file */
#define MM_E 64 /* extended 32-701 */
#define MM_E 64 /* extended 32-701,7838 */
/*

View File

@ -0,0 +1,22 @@
# works within ubuntu and min-gw (win7) environment
CFLAGS = -g -DU8G2_USE_LARGE_FONTS -DU8G2_16BIT -Wall -I../../../csrc/
#CFLAGS = -O4 -Wall
SRC2 = codesearch.c ../build/u8g2_font_list.c $(shell ls ../../../csrc/*.c)
OBJ2 = $(SRC2:.c=.o)
ASM2 = $(SRC2:.c=.s)
.c.s:
$(CC) $(CFLAGS) -S -o $@ $<
codesearch: $(OBJ2)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ2) -o codesearch
clean:
-rm $(OBJ2) $(ASM2) codesearch

View File

@ -0,0 +1,47 @@
#include <stdio.h>
#include <stdlib.h>
#include "u8g2.h"
/* both arrays are NULL terminated */
extern const uint8_t *u8g2_font_list[];
extern char *u8g2_font_names[];
u8g2_t u8g2;
int main(int argc, char **argv)
{
int i, is_found;
uint16_t encoding;
if ( argc <= 1 )
{
printf("codesearch encoding\n");
}
else
{
encoding = atoi(argv[1]);
u8g2_Setup_null(&u8g2, U8G2_R0, u8x8_byte_empty, u8x8_dummy_cb);
i = 0;
is_found = 0;
while( u8g2_font_list[i] != NULL )
{
u8g2_SetFont(&u8g2, u8g2_font_list[i]);
if ( u8g2_IsGlyph(&u8g2, encoding) )
{
if ( is_found == 0 )
{
printf("encoding '%d' available in the following fonts:\n", encoding);
is_found = 1;
}
printf("%s\n", u8g2_font_names[i]);
}
i++;
}
if ( is_found == 0 )
{
printf("encoding '%d' is not available in any font.\n", encoding);
}
}
return 0;
}