parent
638806ea5e
commit
9c026eb4ce
|
@ -139,6 +139,18 @@ void ep_cmd_text(u8g2_t *u8g2, const char **s)
|
|||
u8g2_DrawStr(u8g2, x, y, text);
|
||||
}
|
||||
|
||||
void ep_cmd_char(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
u8g2_uint_t x;
|
||||
u8g2_uint_t y;
|
||||
uint16_t g;
|
||||
|
||||
x = ep_get_integer(s);
|
||||
y = ep_get_integer(s);
|
||||
g = ep_get_integer(s);
|
||||
u8g2_DrawGlyph(u8g2, x, y, g);
|
||||
}
|
||||
|
||||
void ep_cmd_font(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
const char *font = ep_get_identifier(s);
|
||||
|
@ -168,6 +180,14 @@ void ep_cmd_font(u8g2_t *u8g2, const char **s)
|
|||
u8g2_SetFont(u8g2, u8g2_font_helvB24_tf);
|
||||
else if ( strcmp(font, "helvR24") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_helvR24_tf);
|
||||
else if ( strcmp(font, "4x6") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_4x6_tf);
|
||||
else if ( strcmp(font, "5x7") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_5x7_tf);
|
||||
else if ( strcmp(font, "5x8") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_5x8_tf);
|
||||
else if ( strcmp(font, "6x10") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_6x10_tf);
|
||||
else if ( strcmp(font, "6x13") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_6x13_tf);
|
||||
else if ( strcmp(font, "6x13B") == 0 )
|
||||
|
@ -184,18 +204,98 @@ void ep_cmd_font(u8g2_t *u8g2, const char **s)
|
|||
u8g2_SetFont(u8g2, u8g2_font_7x13_tf);
|
||||
else if ( strcmp(font, "8x13B") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_8x13B_tf);
|
||||
else if ( strcmp(font, "4x6") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_4x6_tf);
|
||||
else if ( strcmp(font, "5x7") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_5x7_tf);
|
||||
else if ( strcmp(font, "5x8") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_5x8_tf);
|
||||
else if ( strcmp(font, "6x10") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_6x10_tf);
|
||||
|
||||
else if ( strcmp(font, "open_inconic_1x") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_open_iconic_all_1x_t);
|
||||
else if ( strcmp(font, "open_inconic_2x") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_open_iconic_all_2x_t);
|
||||
else if ( strcmp(font, "open_inconic_4x") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_open_iconic_all_4x_t);
|
||||
else if ( strcmp(font, "open_inconic_6x") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_open_iconic_all_6x_t);
|
||||
else if ( strcmp(font, "open_inconic_8x") == 0 )
|
||||
u8g2_SetFont(u8g2, u8g2_font_open_iconic_all_8x_t);
|
||||
|
||||
else
|
||||
u8g2_SetFont(u8g2, u8g2_font_6x10_tf);
|
||||
}
|
||||
|
||||
void ep_cmd_color(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
uint8_t c = ep_get_integer(s);
|
||||
u8g2_SetDrawColor(u8g2, c);
|
||||
}
|
||||
|
||||
void ep_cmd_transparent(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
uint8_t v = ep_get_integer(s);
|
||||
u8g2_SetFontMode(u8g2, v);
|
||||
}
|
||||
|
||||
|
||||
void ep_cmd_box(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
u8g2_uint_t x;
|
||||
u8g2_uint_t y;
|
||||
u8g2_uint_t w;
|
||||
u8g2_uint_t h;
|
||||
x = ep_get_integer(s);
|
||||
y = ep_get_integer(s);
|
||||
w = ep_get_integer(s);
|
||||
h = ep_get_integer(s);
|
||||
u8g2_DrawBox(u8g2, x, y, w, h);
|
||||
}
|
||||
|
||||
void ep_cmd_rbox(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
u8g2_uint_t x;
|
||||
u8g2_uint_t y;
|
||||
u8g2_uint_t w;
|
||||
u8g2_uint_t h;
|
||||
u8g2_uint_t r;
|
||||
x = ep_get_integer(s);
|
||||
y = ep_get_integer(s);
|
||||
w = ep_get_integer(s);
|
||||
h = ep_get_integer(s);
|
||||
r = ep_get_integer(s);
|
||||
u8g2_DrawRBox(u8g2, x, y, w, h, r);
|
||||
}
|
||||
|
||||
void ep_cmd_frame(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
u8g2_uint_t x;
|
||||
u8g2_uint_t y;
|
||||
u8g2_uint_t w;
|
||||
u8g2_uint_t h;
|
||||
x = ep_get_integer(s);
|
||||
y = ep_get_integer(s);
|
||||
w = ep_get_integer(s);
|
||||
h = ep_get_integer(s);
|
||||
u8g2_DrawFrame(u8g2, x, y, w, h);
|
||||
}
|
||||
|
||||
void ep_cmd_rframe(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
u8g2_uint_t x;
|
||||
u8g2_uint_t y;
|
||||
u8g2_uint_t w;
|
||||
u8g2_uint_t h;
|
||||
u8g2_uint_t r;
|
||||
x = ep_get_integer(s);
|
||||
y = ep_get_integer(s);
|
||||
w = ep_get_integer(s);
|
||||
h = ep_get_integer(s);
|
||||
r = ep_get_integer(s);
|
||||
u8g2_DrawRFrame(u8g2, x, y, w, h, r);
|
||||
}
|
||||
|
||||
void ep_cmd_clear(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
u8g2_ClearBuffer(u8g2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ep_cmd(u8g2_t *u8g2, const char **s)
|
||||
{
|
||||
const char *cmd;
|
||||
|
@ -208,8 +308,24 @@ void ep_cmd(u8g2_t *u8g2, const char **s)
|
|||
//printf("cmd: %s %s\n", cmd, *s);
|
||||
if ( strcmp(cmd, "text") == 0 )
|
||||
ep_cmd_text(u8g2, s);
|
||||
else if ( strcmp(cmd, "char") == 0 )
|
||||
ep_cmd_char(u8g2, s);
|
||||
else if ( strcmp(cmd, "font") == 0 )
|
||||
ep_cmd_font(u8g2, s);
|
||||
else if ( strcmp(cmd, "color") == 0 )
|
||||
ep_cmd_color(u8g2, s);
|
||||
else if ( strcmp(cmd, "transparent") == 0 )
|
||||
ep_cmd_transparent(u8g2, s);
|
||||
else if ( strcmp(cmd, "box") == 0 )
|
||||
ep_cmd_box(u8g2, s);
|
||||
else if ( strcmp(cmd, "rbox") == 0 )
|
||||
ep_cmd_rbox(u8g2, s);
|
||||
else if ( strcmp(cmd, "frame") == 0 )
|
||||
ep_cmd_frame(u8g2, s);
|
||||
else if ( strcmp(cmd, "rframe") == 0 )
|
||||
ep_cmd_rframe(u8g2, s);
|
||||
else if ( strcmp(cmd, "clear") == 0 )
|
||||
ep_cmd_clear(u8g2, s);
|
||||
ep_skip_new_line(s);
|
||||
}
|
||||
}
|
||||
|
@ -246,11 +362,18 @@ int main(void)
|
|||
i = 0;
|
||||
do
|
||||
{
|
||||
char *s1 =
|
||||
const char *s1 =
|
||||
"transparent 1\n"
|
||||
"font 4x5\n"
|
||||
"text 0 14 Hello\n"
|
||||
"font helvB12\n"
|
||||
"text 10 28 World\n"
|
||||
"box 0 0 10 2\n"
|
||||
"rbox 40 0 10 6 2\n"
|
||||
"frame 20 0 10 4\n"
|
||||
"rframe 60 0 10 8 3\n"
|
||||
"font open_inconic_8x\n"
|
||||
"char 64 64 282\n"
|
||||
;
|
||||
ep_cmd(&u8g2, &s1);
|
||||
|
||||
|
|
|
@ -1284,6 +1284,17 @@ FILE *current_md_file;
|
|||
int current_capital_A_size;
|
||||
const char *fntlistallpath = "../../../../u8g2.wiki/fntlistall.md";
|
||||
FILE *fntlistall;
|
||||
|
||||
const char *fntlist8path = "../../../../u8g2.wiki/fntlist8.md";
|
||||
FILE *fntlist8;
|
||||
const char *fntlist12path = "../../../../u8g2.wiki/fntlist12.md";
|
||||
FILE *fntlist12;
|
||||
const char *fntlist16path = "../../../../u8g2.wiki/fntlist16.md";
|
||||
FILE *fntlist16;
|
||||
const char *fntlist99path = "../../../../u8g2.wiki/fntlist99.md";
|
||||
FILE *fntlist99;
|
||||
|
||||
|
||||
const char *fntlistmonopath = "../../../../u8g2.wiki/fntlistmono.md";
|
||||
FILE *fntlistmono;
|
||||
const char *fntlist8x8path = "../../../../u8g2.wiki/fntlist8x8.md";
|
||||
|
@ -2229,12 +2240,57 @@ void generate_font_list(int i, int fm, char *fms, int bm, char *bms, int mm, cha
|
|||
if ( font_found_for_this_size == 0 )
|
||||
{
|
||||
fprintf(fntlistall, "\n## %d Pixel Height\n\n", current_capital_A_size);
|
||||
|
||||
if ( current_capital_A_size <= 8 )
|
||||
{
|
||||
fprintf(fntlist8, "\n## %d Pixel Height\n\n", current_capital_A_size);
|
||||
}
|
||||
else if ( current_capital_A_size <= 12 )
|
||||
{
|
||||
fprintf(fntlist12, "\n## %d Pixel Height\n\n", current_capital_A_size);
|
||||
}
|
||||
else if ( current_capital_A_size <= 16 )
|
||||
{
|
||||
fprintf(fntlist16, "\n## %d Pixel Height\n\n", current_capital_A_size);
|
||||
}
|
||||
else if ( current_capital_A_size <= 99 )
|
||||
{
|
||||
fprintf(fntlist99, "\n## %d Pixel Height\n\n", current_capital_A_size);
|
||||
}
|
||||
|
||||
printf("listall: == %d ==\n", current_capital_A_size);
|
||||
}
|
||||
font_found_for_this_size = 1;
|
||||
fprintf(fntlistall, "![fntpic/%s_short.png](fntpic/%s_short.png) ", target_font_identifier, target_font_identifier);
|
||||
fprintf(fntlistall, "%s ", target_font_identifier);
|
||||
fprintf(fntlistall, " [%s](%s)\n\n", gi[fi[i].group].groupname, gi[fi[i].group].reference);
|
||||
|
||||
if ( current_capital_A_size <= 8 )
|
||||
{
|
||||
fprintf(fntlist8, "![fntpic/%s_short.png](fntpic/%s_short.png) ", target_font_identifier, target_font_identifier);
|
||||
fprintf(fntlist8, "%s ", target_font_identifier);
|
||||
fprintf(fntlist8, " [%s](%s)\n\n", gi[fi[i].group].groupname, gi[fi[i].group].reference);
|
||||
}
|
||||
else if ( current_capital_A_size <= 12 )
|
||||
{
|
||||
fprintf(fntlist12, "![fntpic/%s_short.png](fntpic/%s_short.png) ", target_font_identifier, target_font_identifier);
|
||||
fprintf(fntlist12, "%s ", target_font_identifier);
|
||||
fprintf(fntlist12, " [%s](%s)\n\n", gi[fi[i].group].groupname, gi[fi[i].group].reference);
|
||||
}
|
||||
else if ( current_capital_A_size <= 16 )
|
||||
{
|
||||
fprintf(fntlist16, "![fntpic/%s_short.png](fntpic/%s_short.png) ", target_font_identifier, target_font_identifier);
|
||||
fprintf(fntlist16, "%s ", target_font_identifier);
|
||||
fprintf(fntlist16, " [%s](%s)\n\n", gi[fi[i].group].groupname, gi[fi[i].group].reference);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(fntlist99, "![fntpic/%s_short.png](fntpic/%s_short.png) ", target_font_identifier, target_font_identifier);
|
||||
fprintf(fntlist99, "%s ", target_font_identifier);
|
||||
fprintf(fntlist99, " [%s](%s)\n\n", gi[fi[i].group].groupname, gi[fi[i].group].reference);
|
||||
}
|
||||
|
||||
|
||||
//printf("%d: %s %s\n", current_capital_A_size, target_font_identifier, gi[fi[i].group].groupname);
|
||||
}
|
||||
|
||||
|
@ -2265,6 +2321,23 @@ void do_font_list(cbfn_t cb)
|
|||
file_copy("fntlistall.pre", fntlistallpath);
|
||||
fntlistall = fopen(fntlistallpath, "r+");
|
||||
fseek(fntlistall, 0L, SEEK_END);
|
||||
|
||||
file_copy("fntlist8.pre", fntlist8path);
|
||||
fntlist8 = fopen(fntlist8path, "r+");
|
||||
fseek(fntlist8, 0L, SEEK_END);
|
||||
|
||||
file_copy("fntlist12.pre", fntlist12path);
|
||||
fntlist12 = fopen(fntlist12path, "r+");
|
||||
fseek(fntlist12, 0L, SEEK_END);
|
||||
|
||||
file_copy("fntlist16.pre", fntlist16path);
|
||||
fntlist16 = fopen(fntlist16path, "r+");
|
||||
fseek(fntlist16, 0L, SEEK_END);
|
||||
|
||||
file_copy("fntlist99.pre", fntlist99path);
|
||||
fntlist99 = fopen(fntlist99path, "r+");
|
||||
fseek(fntlist99, 0L, SEEK_END);
|
||||
|
||||
fntlistmono = fopen(fntlistmonopath, "w");
|
||||
fntlist8x8 = fopen(fntlist8x8path, "w");
|
||||
fprintf(fntlistall, "# All U8g2 Fonts, Capital A Height\n\n");
|
||||
|
@ -2278,6 +2351,12 @@ void do_font_list(cbfn_t cb)
|
|||
u8g2_fnt_cnt = 0;
|
||||
do_font_loop(cb);
|
||||
}
|
||||
|
||||
fclose(fntlist99);
|
||||
fclose(fntlist16);
|
||||
fclose(fntlist12);
|
||||
fclose(fntlist8);
|
||||
|
||||
fclose(fntlistall);
|
||||
fclose(fntlistmono);
|
||||
fclose(fntlist8x8);
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
# Reference
|
||||
|
||||
This page contains fonts from http://www.pentacom.jp/pentacom/bitfontmaker2/gallery
|
||||
|
||||
All fonts on this page are created by "Pentacom".
|
||||
|
||||
Fonts will be available with U8g2 v2.26.
|
||||
|
||||
# Copyright
|
||||
|
||||
|
||||
HelvetiPixel by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=381
|
||||
license : (Public Domain)
|
||||
|
||||
TimesNewPixel by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=57
|
||||
license : (Public Domain)
|
||||
|
||||
BitTypeWriter by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=1455
|
||||
license : (Public Domain)
|
||||
|
||||
Georgia7px by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=1451
|
||||
license : (Public Domain)
|
||||
|
||||
Wizzard by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=902
|
||||
license : (Public Domain)
|
||||
|
||||
HelvetiPixel (Outline) by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=182
|
||||
license : (Public Domain)
|
||||
|
||||
Untitled16PixelSansSerifBitmap by Pentacom
|
||||
http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=3046
|
||||
license : (Public Domain)
|
||||
|
||||
# Font Pictures
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
# U8g2 Font List
|
||||
|
||||
* [Font List 3-8 Pixel Height](fntlist8)
|
||||
* [Font List 9-12 Pixel Height](fntlist12)
|
||||
* [Font List 13-16 Pixel Height](fntlist16)
|
||||
* [Font List 17-99 Pixel Height](fntlist99)
|
||||
|
||||
# U8g2 Font Names
|
||||
|
||||
```
|
||||
<prefix> '_' <name> '_' <purpose> <char set>
|
||||
```
|
||||
|
||||
| `<purpose>` | Description |
|
||||
|---------------------|---------------------|
|
||||
| `t` | Transparent font, Do not use a background color. |
|
||||
| `h` | All glyphs have common height. |
|
||||
| `m` | All glyphs have common height and width (monospace). |
|
||||
| `8` | All glyphs fit into a 8x8 pixel box. |
|
||||
|
||||
| `<char set>` | Description |
|
||||
|---------------------|-----------------|
|
||||
| `f` | The font includes up to 256 glyphs. |
|
||||
| `r` | Only glyphs on the range of the ASCII codes 32 to 127 are included in the font. |
|
||||
| `u` | Only glyphs on the range of the ASCII codes 32 to 95 (uppercase chars) are included in the font. |
|
||||
| `n` | Only numbers and extra glyphs for writing date and time strings are included in the font. |
|
||||
| ... | Other custom character list.
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
# U8g2 Font List
|
||||
|
||||
* [Font List 3-8 Pixel Height](fntlist8)
|
||||
* [Font List 9-12 Pixel Height](fntlist12)
|
||||
* [Font List 13-16 Pixel Height](fntlist16)
|
||||
* [Font List 17-99 Pixel Height](fntlist99)
|
||||
|
||||
# U8g2 Font Names
|
||||
|
||||
```
|
||||
<prefix> '_' <name> '_' <purpose> <char set>
|
||||
```
|
||||
|
||||
| `<purpose>` | Description |
|
||||
|---------------------|---------------------|
|
||||
| `t` | Transparent font, Do not use a background color. |
|
||||
| `h` | All glyphs have common height. |
|
||||
| `m` | All glyphs have common height and width (monospace). |
|
||||
| `8` | All glyphs fit into a 8x8 pixel box. |
|
||||
|
||||
| `<char set>` | Description |
|
||||
|---------------------|-----------------|
|
||||
| `f` | The font includes up to 256 glyphs. |
|
||||
| `r` | Only glyphs on the range of the ASCII codes 32 to 127 are included in the font. |
|
||||
| `u` | Only glyphs on the range of the ASCII codes 32 to 95 (uppercase chars) are included in the font. |
|
||||
| `n` | Only numbers and extra glyphs for writing date and time strings are included in the font. |
|
||||
| ... | Other custom character list.
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
# U8g2 Font List
|
||||
|
||||
* [Font List 3-8 Pixel Height](fntlist8)
|
||||
* [Font List 9-12 Pixel Height](fntlist12)
|
||||
* [Font List 13-16 Pixel Height](fntlist16)
|
||||
* [Font List 17-99 Pixel Height](fntlist99)
|
||||
|
||||
# U8g2 Font Names
|
||||
|
||||
```
|
||||
<prefix> '_' <name> '_' <purpose> <char set>
|
||||
```
|
||||
|
||||
| `<purpose>` | Description |
|
||||
|---------------------|---------------------|
|
||||
| `t` | Transparent font, Do not use a background color. |
|
||||
| `h` | All glyphs have common height. |
|
||||
| `m` | All glyphs have common height and width (monospace). |
|
||||
| `8` | All glyphs fit into a 8x8 pixel box. |
|
||||
|
||||
| `<char set>` | Description |
|
||||
|---------------------|-----------------|
|
||||
| `f` | The font includes up to 256 glyphs. |
|
||||
| `r` | Only glyphs on the range of the ASCII codes 32 to 127 are included in the font. |
|
||||
| `u` | Only glyphs on the range of the ASCII codes 32 to 95 (uppercase chars) are included in the font. |
|
||||
| `n` | Only numbers and extra glyphs for writing date and time strings are included in the font. |
|
||||
| ... | Other custom character list.
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
# U8g2 Font List
|
||||
|
||||
* [Font List 3-8 Pixel Height](fntlist8)
|
||||
* [Font List 9-12 Pixel Height](fntlist12)
|
||||
* [Font List 13-16 Pixel Height](fntlist16)
|
||||
* [Font List 17-99 Pixel Height](fntlist99)
|
||||
|
||||
# U8g2 Font Names
|
||||
|
||||
```
|
||||
<prefix> '_' <name> '_' <purpose> <char set>
|
||||
```
|
||||
|
||||
| `<purpose>` | Description |
|
||||
|---------------------|---------------------|
|
||||
| `t` | Transparent font, Do not use a background color. |
|
||||
| `h` | All glyphs have common height. |
|
||||
| `m` | All glyphs have common height and width (monospace). |
|
||||
| `8` | All glyphs fit into a 8x8 pixel box. |
|
||||
|
||||
| `<char set>` | Description |
|
||||
|---------------------|-----------------|
|
||||
| `f` | The font includes up to 256 glyphs. |
|
||||
| `r` | Only glyphs on the range of the ASCII codes 32 to 127 are included in the font. |
|
||||
| `u` | Only glyphs on the range of the ASCII codes 32 to 95 (uppercase chars) are included in the font. |
|
||||
| `n` | Only numbers and extra glyphs for writing date and time strings are included in the font. |
|
||||
| ... | Other custom character list.
|
||||
|
Loading…
Reference in New Issue