font build process
This commit is contained in:
parent
7a15997349
commit
eae419d251
11
csrc/u8g2.h
11
csrc/u8g2.h
|
@ -329,10 +329,8 @@ extern const uint8_t u8g2_font_m2icon_7_tf[] U8G2_FONT_SECTION("u8g2_font_m2icon
|
|||
extern const uint8_t u8g2_font_m2icon_9_tf[] U8G2_FONT_SECTION("u8g2_font_m2icon_9_tf");
|
||||
extern const uint8_t u8g2_font_cursor_tf[] U8G2_FONT_SECTION("u8g2_font_cursor_tf");
|
||||
extern const uint8_t u8g2_font_cursor_tr[] U8G2_FONT_SECTION("u8g2_font_cursor_tr");
|
||||
extern const uint8_t u8g2_font_micro_tf[] U8G2_FONT_SECTION("u8g2_font_micro_tf");
|
||||
extern const uint8_t u8g2_font_micro_tr[] U8G2_FONT_SECTION("u8g2_font_micro_tr");
|
||||
extern const uint8_t u8g2_font_micro_tn[] U8G2_FONT_SECTION("u8g2_font_micro_tn");
|
||||
extern const uint8_t u8g2_font_micro_mf[] U8G2_FONT_SECTION("u8g2_font_micro_mf");
|
||||
extern const uint8_t u8g2_font_micro_mr[] U8G2_FONT_SECTION("u8g2_font_micro_mr");
|
||||
extern const uint8_t u8g2_font_micro_mn[] U8G2_FONT_SECTION("u8g2_font_micro_mn");
|
||||
extern const uint8_t u8g2_font_4x6_tf[] U8G2_FONT_SECTION("u8g2_font_4x6_tf");
|
||||
|
@ -365,6 +363,7 @@ extern const uint8_t u8g2_font_6x12_tn[] U8G2_FONT_SECTION("u8g2_font_6x12_tn");
|
|||
extern const uint8_t u8g2_font_6x12_mf[] U8G2_FONT_SECTION("u8g2_font_6x12_mf");
|
||||
extern const uint8_t u8g2_font_6x12_mr[] U8G2_FONT_SECTION("u8g2_font_6x12_mr");
|
||||
extern const uint8_t u8g2_font_6x12_mn[] U8G2_FONT_SECTION("u8g2_font_6x12_mn");
|
||||
extern const uint8_t u8g2_font_6x12_t_symbols[] U8G2_FONT_SECTION("u8g2_font_6x12_t_symbols");
|
||||
extern const uint8_t u8g2_font_6x13_tf[] U8G2_FONT_SECTION("u8g2_font_6x13_tf");
|
||||
extern const uint8_t u8g2_font_6x13_tr[] U8G2_FONT_SECTION("u8g2_font_6x13_tr");
|
||||
extern const uint8_t u8g2_font_6x13_tn[] U8G2_FONT_SECTION("u8g2_font_6x13_tn");
|
||||
|
@ -389,6 +388,7 @@ extern const uint8_t u8g2_font_7x13_tn[] U8G2_FONT_SECTION("u8g2_font_7x13_tn");
|
|||
extern const uint8_t u8g2_font_7x13_mf[] U8G2_FONT_SECTION("u8g2_font_7x13_mf");
|
||||
extern const uint8_t u8g2_font_7x13_mr[] U8G2_FONT_SECTION("u8g2_font_7x13_mr");
|
||||
extern const uint8_t u8g2_font_7x13_mn[] U8G2_FONT_SECTION("u8g2_font_7x13_mn");
|
||||
extern const uint8_t u8g2_font_7x13_t_symbols[] U8G2_FONT_SECTION("u8g2_font_7x13_t_symbols");
|
||||
extern const uint8_t u8g2_font_7x13B_tf[] U8G2_FONT_SECTION("u8g2_font_7x13B_tf");
|
||||
extern const uint8_t u8g2_font_7x13B_tr[] U8G2_FONT_SECTION("u8g2_font_7x13B_tr");
|
||||
extern const uint8_t u8g2_font_7x13B_tn[] U8G2_FONT_SECTION("u8g2_font_7x13B_tn");
|
||||
|
@ -419,6 +419,7 @@ extern const uint8_t u8g2_font_8x13_tn[] U8G2_FONT_SECTION("u8g2_font_8x13_tn");
|
|||
extern const uint8_t u8g2_font_8x13_mf[] U8G2_FONT_SECTION("u8g2_font_8x13_mf");
|
||||
extern const uint8_t u8g2_font_8x13_mr[] U8G2_FONT_SECTION("u8g2_font_8x13_mr");
|
||||
extern const uint8_t u8g2_font_8x13_mn[] U8G2_FONT_SECTION("u8g2_font_8x13_mn");
|
||||
extern const uint8_t u8g2_font_8x13_t_symbols[] U8G2_FONT_SECTION("u8g2_font_8x13_t_symbols");
|
||||
extern const uint8_t u8g2_font_8x13B_tf[] U8G2_FONT_SECTION("u8g2_font_8x13B_tf");
|
||||
extern const uint8_t u8g2_font_8x13B_tr[] U8G2_FONT_SECTION("u8g2_font_8x13B_tr");
|
||||
extern const uint8_t u8g2_font_8x13B_tn[] U8G2_FONT_SECTION("u8g2_font_8x13B_tn");
|
||||
|
@ -437,6 +438,7 @@ extern const uint8_t u8g2_font_9x15_tn[] U8G2_FONT_SECTION("u8g2_font_9x15_tn");
|
|||
extern const uint8_t u8g2_font_9x15_mf[] U8G2_FONT_SECTION("u8g2_font_9x15_mf");
|
||||
extern const uint8_t u8g2_font_9x15_mr[] U8G2_FONT_SECTION("u8g2_font_9x15_mr");
|
||||
extern const uint8_t u8g2_font_9x15_mn[] U8G2_FONT_SECTION("u8g2_font_9x15_mn");
|
||||
extern const uint8_t u8g2_font_9x15_t_symbols[] U8G2_FONT_SECTION("u8g2_font_9x15_t_symbols");
|
||||
extern const uint8_t u8g2_font_9x15B_tf[] U8G2_FONT_SECTION("u8g2_font_9x15B_tf");
|
||||
extern const uint8_t u8g2_font_9x15B_tr[] U8G2_FONT_SECTION("u8g2_font_9x15B_tr");
|
||||
extern const uint8_t u8g2_font_9x15B_tn[] U8G2_FONT_SECTION("u8g2_font_9x15B_tn");
|
||||
|
@ -494,6 +496,11 @@ extern const uint8_t u8g2_font_cu12_hn[] U8G2_FONT_SECTION("u8g2_font_cu12_hn");
|
|||
extern const uint8_t u8g2_font_cu12_mf[] U8G2_FONT_SECTION("u8g2_font_cu12_mf");
|
||||
extern const uint8_t u8g2_font_cu12_mr[] U8G2_FONT_SECTION("u8g2_font_cu12_mr");
|
||||
extern const uint8_t u8g2_font_cu12_mn[] U8G2_FONT_SECTION("u8g2_font_cu12_mn");
|
||||
extern const uint8_t u8g2_font_cu12_t_symbols[] U8G2_FONT_SECTION("u8g2_font_cu12_t_symbols");
|
||||
extern const uint8_t u8g2_font_unifont_t_latin[] U8G2_FONT_SECTION("u8g2_font_unifont_t_latin");
|
||||
extern const uint8_t u8g2_font_unifont_t_greek[] U8G2_FONT_SECTION("u8g2_font_unifont_t_greek");
|
||||
extern const uint8_t u8g2_font_unifont_t_cyrillic[] U8G2_FONT_SECTION("u8g2_font_unifont_t_cyrillic");
|
||||
extern const uint8_t u8g2_font_unifont_t_symbols[] U8G2_FONT_SECTION("u8g2_font_unifont_t_symbols");
|
||||
extern const uint8_t u8g2_font_courB08_tf[] U8G2_FONT_SECTION("u8g2_font_courB08_tf");
|
||||
extern const uint8_t u8g2_font_courB08_tr[] U8G2_FONT_SECTION("u8g2_font_courB08_tr");
|
||||
extern const uint8_t u8g2_font_courB08_tn[] U8G2_FONT_SECTION("u8g2_font_courB08_tn");
|
||||
|
|
3572
csrc/u8g2_fonts.c
3572
csrc/u8g2_fonts.c
File diff suppressed because it is too large
Load Diff
|
@ -651,7 +651,7 @@ int bf_WriteU8G2CByFilename(bf_t *bf, const char *filename, const char *fontname
|
|||
|
||||
|
||||
|
||||
bf_t *bf_OpenFromFile(const char *bdf_filename, int is_verbose, int bbx_mode, const char *map_str, int font_format)
|
||||
bf_t *bf_OpenFromFile(const char *bdf_filename, int is_verbose, int bbx_mode, const char *map_str, const char *map_file_name, int font_format)
|
||||
{
|
||||
bf_t *bf;
|
||||
|
||||
|
@ -661,7 +661,14 @@ bf_t *bf_OpenFromFile(const char *bdf_filename, int is_verbose, int bbx_mode, co
|
|||
|
||||
if ( bf_ParseFile(bf, bdf_filename) != 0 )
|
||||
{
|
||||
bf_Map(bf, map_str);
|
||||
if ( map_file_name[0] != '\0' )
|
||||
{
|
||||
bf_MapFile(bf, map_file_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
bf_Map(bf, map_str);
|
||||
}
|
||||
bf_CalculateSelectedNumberOfGlyphs(bf);
|
||||
|
||||
bf_ReduceAllGlyph(bf);
|
||||
|
|
|
@ -122,7 +122,7 @@ void bf_Generate8x8Font(bf_t *bf);
|
|||
int bf_WriteUCGCByFilename(bf_t *bf, const char *filename, const char *fontname, const char *indent);
|
||||
int bf_WriteU8G2CByFilename(bf_t *bf, const char *filename, const char *fontname, const char *indent);
|
||||
|
||||
bf_t *bf_OpenFromFile(const char *bdf_filename, int is_verbose, int bbx_mode, const char *map_str, int font_format);
|
||||
bf_t *bf_OpenFromFile(const char *bdf_filename, int is_verbose, int bbx_mode, const char *map_str, const char *map_file_name, int font_format);
|
||||
|
||||
|
||||
/* bdf_parser.c */
|
||||
|
@ -130,6 +130,7 @@ int bf_ParseFile(bf_t *bf, const char *name);
|
|||
|
||||
/* bdf_map.c */
|
||||
void bf_Map(bf_t *bf, const char *map_cmd_list);
|
||||
int bf_MapFile(bf_t *bf, const char *map_file_name);
|
||||
|
||||
/* bdf_tga.c */
|
||||
int tga_init(uint16_t w, uint16_t h);
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
*/
|
||||
|
||||
#include "bdf_font.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static long range_from;
|
||||
static long range_to;
|
||||
|
@ -183,7 +188,12 @@ void bf_map_cmd(bf_t *bf, const char **s)
|
|||
{
|
||||
int i;
|
||||
bg_t *bg;
|
||||
|
||||
if ( **s == ',' || **s == '\0' )
|
||||
return;
|
||||
|
||||
map_cmd(s);
|
||||
|
||||
|
||||
bf_Log(bf, "Map: exclude=%d from=%ld to=%ld map=%ld", is_exclude, range_from, range_to, map_to);
|
||||
|
||||
|
@ -233,7 +243,32 @@ void bf_Map(bf_t *bf, const char *map_cmd_list)
|
|||
{
|
||||
bf_Log(bf, "Map: map_cmd_list='%s'", map_cmd_list);
|
||||
bf_map_list(bf, &map_cmd_list);
|
||||
|
||||
|
||||
}
|
||||
|
||||
int bf_MapFile(bf_t *bf, const char *map_file_name)
|
||||
{
|
||||
struct stat buf;
|
||||
char *s;
|
||||
FILE *fp;
|
||||
if ( map_file_name == NULL )
|
||||
return 1;
|
||||
if ( map_file_name[0] == '\0' )
|
||||
return 1;
|
||||
|
||||
|
||||
if ( stat(map_file_name, &buf) != 0 )
|
||||
return 0;
|
||||
fp = fopen(map_file_name, "r");
|
||||
if ( fp == NULL )
|
||||
return 0;
|
||||
s = malloc(buf.st_size+1);
|
||||
if ( s == NULL )
|
||||
return 0;
|
||||
fread(s, buf.st_size, 1, fp);
|
||||
s[buf.st_size] = '\0';
|
||||
fclose(fp);
|
||||
bf_Map(bf, s);
|
||||
free(s);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ void help(void)
|
|||
printf("-b <n> Font build mode, 0: proportional, 1: common height, 2: monospace, 3: multiple of 8\n");
|
||||
printf("-f <n> Font format, 0: ucglib font, 1: u8g2 font, 2: u8g2 uncompressed 8x8 font (enforces -b 3)\n");
|
||||
printf("-m 'map' Unicode ASCII mapping\n");
|
||||
printf("-M 'mapfile' Read Unicode ASCII mapping from file 'mapname'\n");
|
||||
printf("-o <file> C output file\n");
|
||||
printf("-n <name> C indentifier (font name)\n");
|
||||
printf("-d <file> Overview picture: Enable generation of bdf.tga and assign BDF font <file> for description\n");
|
||||
|
@ -264,6 +265,7 @@ int main(int argc, char **argv)
|
|||
char *bdf_filename = NULL;
|
||||
int is_verbose = 0;
|
||||
char *map_str ="*";
|
||||
char *map_filename ="";
|
||||
char *desc_font_str = "";
|
||||
unsigned y;
|
||||
|
||||
|
@ -321,6 +323,9 @@ int main(int argc, char **argv)
|
|||
else if ( get_str_arg(&argv, 'm', &map_str) != 0 )
|
||||
{
|
||||
}
|
||||
else if ( get_str_arg(&argv, 'M', &map_filename) != 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
bdf_filename = *argv;
|
||||
|
@ -337,7 +342,7 @@ int main(int argc, char **argv)
|
|||
bf_desc_font = NULL;
|
||||
if ( desc_font_str[0] != '\0' )
|
||||
{
|
||||
bf_desc_font = bf_OpenFromFile(desc_font_str, 0, BDF_BBX_MODE_MINIMAL, "*", 0); /* assume format 0 for description */
|
||||
bf_desc_font = bf_OpenFromFile(desc_font_str, 0, BDF_BBX_MODE_MINIMAL, "*", "", 0); /* assume format 0 for description */
|
||||
if ( bf_desc_font == NULL )
|
||||
{
|
||||
exit(1);
|
||||
|
@ -351,7 +356,7 @@ int main(int argc, char **argv)
|
|||
/* bf_Log(bf, "Font mode 1: BBX mode set to 3"); */
|
||||
}
|
||||
|
||||
bf = bf_OpenFromFile(bdf_filename, is_verbose, build_bbx_mode, map_str, font_format);
|
||||
bf = bf_OpenFromFile(bdf_filename, is_verbose, build_bbx_mode, map_str, map_filename, font_format);
|
||||
|
||||
if ( bf == NULL )
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -128,6 +128,8 @@ int insert_into_file(const char *filename, const char *text, const char *start_l
|
|||
struct groupinfo
|
||||
{
|
||||
char *groupname;
|
||||
char *mdfile;
|
||||
char *mdprefixfile;
|
||||
};
|
||||
|
||||
struct fontinfo
|
||||
|
@ -149,12 +151,14 @@ typedef void (*cbfn_t)(int i, int fm, char *fms, int bm, char *bms, int mm, char
|
|||
|
||||
|
||||
struct groupinfo gi[] = {
|
||||
{ "U8glib" },
|
||||
{ "X11" },
|
||||
{ "fontstruct" },
|
||||
{ "cu12" },
|
||||
{ "profont" }, /* 4 */
|
||||
{ "adobe" },
|
||||
{ "U8glib", "", "" },
|
||||
{ "X11", "", "" },
|
||||
{ "fontstruct", "", "" },
|
||||
{ "cu12", "", "" },
|
||||
{ "profont", "", "" }, /* 4 */
|
||||
{ "adobe", "", "" },
|
||||
{ "unifont", "", "" }, /* 6 */
|
||||
{ "intlfont", "", "" }, /* 7 */
|
||||
};
|
||||
|
||||
#define BM_T 1 /* Transparent = build mode 0 proportional */
|
||||
|
@ -176,7 +180,7 @@ struct fontinfo fi[] = {
|
|||
{ 0, "m2icon_9.bdf", "m2icon_9", 0, 0, BM_T, FM_C, MM_F, "", ""},
|
||||
{ 0, "cursor.bdf", "cursor", 1, 0, BM_T, FM_C, MM_C, "0-223>32", "f" },
|
||||
{ 0, "cursor.bdf", "cursor", 1, 0, BM_T, FM_C, MM_C, "0-80>32", "r" },
|
||||
{ 0, "micro.bdf", "micro", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "micro.bdf", "micro", 1, 0, BM_T|BM_M, FM_C, MM_R|MM_N, "", "" }, /* micro does not have the full set */
|
||||
{ 0, "4x6.bdf", "4x6", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "5x7.bdf", "5x7", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "5x7.bdf", "5x7", 1, 0, BM_8, FM_8, MM_F|MM_R|MM_N, "", "" },
|
||||
|
@ -184,18 +188,22 @@ struct fontinfo fi[] = {
|
|||
{ 0, "5x8.bdf", "5x8", 1, 0, BM_8, FM_8, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "6x10.bdf", "6x10", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "6x12.bdf", "6x12", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "6x12.bdf", "6x12", 1, 0, BM_T, FM_C, MM_C, "32-255,$20a0-$20bf,$2103,$2109,$2126,$2190-$21bb,$21d0-$21d9,$21e6-$21e9,$23e9-$23fa,$2580-$261f,$2654-$2667,$2680-$2685,$2713-$2718,$274f-$2752", "_symbols" },
|
||||
{ 0, "6x13.bdf", "6x13", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "6x13B.bdf", "6x13B", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "6x13O.bdf", "6x13O", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "7x13.bdf", "7x13", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "7x13.bdf", "7x13", 1, 0, BM_T, FM_C, MM_C, "32-255,$20a0-$20bf,$2103,$2109,$2126,$2190-$21bb,$21d0-$21d9,$21e6-$21e9,$23e9-$23fa,$2580-$261f,$2654-$2667,$2680-$2685,$2713-$2718,$274f-$2752", "_symbols" },
|
||||
{ 0, "7x13B.bdf", "7x13B", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "7x13O.bdf", "7x13O", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "7x14.bdf", "7x14", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "7x14B.bdf", "7x14B", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "8x13.bdf", "8x13", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "8x13.bdf", "8x13", 1, 0, BM_T, FM_C, MM_C, "32-255,$20a0-$20bf,$2103,$2109,$2126,$2190-$21bb,$21d0-$21d9,$21e6-$21e9,$23e9-$23fa,$2580-$261f,$2654-$2667,$2680-$2685,$2713-$2718,$274f-$2752", "_symbols" },
|
||||
{ 0, "8x13B.bdf", "8x13B", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "8x13O.bdf", "8x13O", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "9x15.bdf", "9x15", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "9x15.bdf", "9x15", 1, 0, BM_T, FM_C, MM_C, "32-255,$20a0-$20bf,$2103,$2109,$2126,$2190-$21bb,$21d0-$21d9,$21e6-$21e9,$23e9-$23fa,$2580-$261f,$2654-$2667,$2680-$2685,$2713-$2718,$274f-$2752", "_symbols" },
|
||||
{ 0, "9x15B.bdf", "9x15B", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "9x18.bdf", "9x18", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "9x18B.bdf", "9x18B", 1, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
|
@ -209,7 +217,29 @@ struct fontinfo fi[] = {
|
|||
{ 0, "profont29.bdf", "profont29", 4, 0, BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "amstrad_cpc.bdf", "amstrad_cpc", 2, 0, BM_8, FM_C|FM_8, MM_F|MM_R|MM_N, "" , ""},
|
||||
{ 0, "cu12.bdf", "cu12", 3, 0, BM_T|BM_H|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
|
||||
{ 0, "cu12.bdf", "cu12", 3, 0, BM_T, FM_C, MM_C, "32-255,$20a0-$20bf,$2103,$2109,$2126,$2190-$21bb,$21d0-$21d9,$21e6-$21e9,$23e9-$23fa,$2580-$261f,$2654-$2667,$2680-$2685,$2713-$2718,$274f-$2752", "_symbols" },
|
||||
{ 0, "unifont.bdf", "unifont", 6, 0, BM_T, FM_C, MM_C, "32-255", "_latin" },
|
||||
{ 0, "unifont.bdf", "unifont", 6, 0, BM_T, FM_C, MM_C, "32-128,$370-$3ff", "_greek" },
|
||||
{ 0, "unifont.bdf", "unifont", 6, 0, BM_T, FM_C, MM_C, "32-128,$400-$52f", "_cyrillic" },
|
||||
/*
|
||||
$20a0-$20bf currency symbols
|
||||
$2103 Circle C
|
||||
$2109 Circle F
|
||||
$2126 Ohm
|
||||
$2190-$21bb single arrow
|
||||
$21d0-$21d9 double arrow
|
||||
$21e6-$21e9 double arrow
|
||||
$23e9-$23fa music player symbols
|
||||
$2580-$261f various symbols
|
||||
$2654-$2667 chess and cards
|
||||
$2680-$2685 dice
|
||||
$2713-$2718 yes/no
|
||||
$274f-$2752 3d box
|
||||
$1f600-$1f64f emoticons
|
||||
*/
|
||||
{ 0, "unifont.bdf", "unifont", 6, 0, BM_T, FM_C, MM_C, "32-255,$20a0-$20bf,$2103,$2109,$2126,$2190-$21bb,$21d0-$21d9,$21e6-$21e9,$23e9-$23fa,$2580-$261f,$2654-$2667,$2680-$2685,$2713-$2718,$274f-$2752", "_symbols" },
|
||||
//{ 0, "gb16fs.bdf", "gb16fs", 7, 0, BM_T, FM_C, MM_C, "32-$ffff", "" },
|
||||
//{ 0, "gb16st.bdf", "gb16st", 7, 0, BM_T, FM_C, MM_C, "32-$ffff", "" },
|
||||
{ 0, "courB08.bdf", "courB08", 5, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "courB10.bdf", "courB10", 5, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
{ 0, "courB12.bdf", "courB12", 5, 0, BM_T|BM_M, FM_C, MM_F|MM_R|MM_N, "", "" },
|
||||
|
@ -324,7 +354,7 @@ void overview_draw_table(int i, uint16_t x, uint16_t y)
|
|||
cw = u8g2_GetMaxCharWidth(&u8g2);
|
||||
if ( ch < h )
|
||||
ch = h;
|
||||
y = h*3+ch;
|
||||
y = h*3+ch+1;
|
||||
|
||||
line = 0;
|
||||
for(;;)
|
||||
|
@ -336,13 +366,26 @@ void overview_draw_table(int i, uint16_t x, uint16_t y)
|
|||
sprintf(s, "%5d/%04x ", encoding, encoding);
|
||||
|
||||
x = u8g2_DrawString(&u8g2, 0, y, s);
|
||||
overview_draw_line(i, encoding, x, y, cw);
|
||||
overview_draw_line(i, encoding, x, y, cw+1);
|
||||
y += ch;
|
||||
}
|
||||
line++;
|
||||
if ( line > 16 )
|
||||
if ( line > 0xfff )
|
||||
break;
|
||||
}
|
||||
if ( u8g2_IsGlyph(&u8g2, 'A') != 0 && u8g2_IsGlyph(&u8g2, 'z') != 0 )
|
||||
{
|
||||
y++;
|
||||
// y -= ch;
|
||||
u8g2_SetFont(&u8g2, u8g2_font_list[u8g2_fnt_cnt]);
|
||||
u8g2_SetFontDirection(&u8g2, 0);
|
||||
//y += u8g2_GetMaxCharHeight(&u8g2);
|
||||
u8g2_DrawString(&u8g2, 0, y, "The quick brown fox");
|
||||
y += u8g2_GetMaxCharHeight(&u8g2);
|
||||
u8g2_DrawString(&u8g2, 0, y, "jumps over the lazy dog.");
|
||||
}
|
||||
//u8g2_DrawString(&u8g2, 0, y, "Woven silk pyjamas exchanged for blue quartz");
|
||||
|
||||
}
|
||||
|
||||
void overviewpic(int i, int fm, char *fms, int bm, char *bms, int mm, char *mms)
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
//#define FACTOR 3
|
||||
//#define XOFFSET (FACTOR*32)
|
||||
//#define YOFFSET (FACTOR*32)
|
||||
#define DEFAULT_WIDTH (512U)
|
||||
#define DEFAULT_HEIGHT (1024U)
|
||||
#define DEFAULT_WIDTH (512+128)
|
||||
#define DEFAULT_HEIGHT (1024)
|
||||
|
||||
|
||||
uint16_t tga_max_x;
|
||||
uint16_t tga_max_y;
|
||||
size_t tga_max_offset = 0;
|
||||
|
||||
static uint16_t tga_width;
|
||||
static uint16_t tga_height;
|
||||
|
@ -31,14 +32,21 @@ int tga_init(uint16_t w, uint16_t h)
|
|||
tga_max_y = 0;
|
||||
tga_width = 0;
|
||||
tga_height = 0;
|
||||
tga_max_offset = 0;
|
||||
if ( tga_data != NULL )
|
||||
free(tga_data);
|
||||
tga_data = (uint8_t *)malloc(w*h*3);
|
||||
{
|
||||
tga_data = (uint8_t *)realloc(tga_data, w*h*3);
|
||||
//memset(tga_data, 255, (long)w*(long)h*3L);
|
||||
}
|
||||
else
|
||||
{
|
||||
tga_data = (uint8_t *)malloc(w*h*3);
|
||||
//memset(tga_data, 255, (long)w*(long)h*3L);
|
||||
}
|
||||
if ( tga_data == NULL )
|
||||
return 0;
|
||||
tga_width = w;
|
||||
tga_height = h;
|
||||
memset(tga_data, 255, tga_width*tga_height*3);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -46,6 +54,7 @@ void tga_set_pixel(uint16_t x, uint16_t y, uint16_t f)
|
|||
{
|
||||
uint8_t *p;
|
||||
uint16_t xx,yy;
|
||||
size_t offset;
|
||||
for( yy = y; yy < y+f; yy++ )
|
||||
{
|
||||
for( xx = x; xx < x+f; xx++ )
|
||||
|
@ -53,7 +62,10 @@ void tga_set_pixel(uint16_t x, uint16_t y, uint16_t f)
|
|||
if ( yy < tga_height && xx < tga_width )
|
||||
{
|
||||
//printf ("(%d %d) ", xx, yy);
|
||||
p = tga_data + (tga_height-yy-1)*tga_width*3 + xx*3;
|
||||
offset = (tga_height-yy-1)*tga_width*3 + xx*3;
|
||||
p = tga_data + offset;
|
||||
if ( tga_max_offset < offset )
|
||||
tga_max_offset = offset;
|
||||
*p++ = tga_b;
|
||||
*p++ = tga_g;
|
||||
*p++ = tga_r;
|
||||
|
@ -65,13 +77,14 @@ void tga_set_pixel(uint16_t x, uint16_t y, uint16_t f)
|
|||
void tga_clr_pixel(uint16_t x, uint16_t y, uint16_t f)
|
||||
{
|
||||
uint8_t *p;
|
||||
size_t offset;
|
||||
uint16_t xx,yy;
|
||||
for( yy = y; yy < y+f; yy++ )
|
||||
{
|
||||
for( xx = x; xx < x+f; xx++ )
|
||||
{
|
||||
|
||||
p = tga_data + (tga_height-yy-1)*tga_width*3 + xx*3;
|
||||
offset = (tga_height-yy-1)*tga_width*3 + xx*3;
|
||||
p = tga_data + offset;
|
||||
*p++ = 255;
|
||||
*p++ = 255;
|
||||
*p++ = 255;
|
||||
|
@ -251,9 +264,9 @@ void u8x8_Setup_TGA(u8x8_t *u8x8)
|
|||
|
||||
void u8g2_Setup_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||
{
|
||||
static uint8_t buf[(DEFAULT_WIDTH)*8];
|
||||
static uint8_t buf[(DEFAULT_WIDTH)*8*8];
|
||||
|
||||
u8x8_Setup_TGA(u8g2_GetU8x8(u8g2));
|
||||
u8g2_Setup(u8g2, buf, 1, u8g2_cb);
|
||||
u8g2_Setup(u8g2, buf, 8, u8g2_cb);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue