diff --git a/fonts/Makefile b/fonts/Makefile index 901cf11..667c9c9 100644 --- a/fonts/Makefile +++ b/fonts/Makefile @@ -1,8 +1,9 @@ CC = gcc -CFLAGS = -O2 -Wall -W -g +#CFLAGS = -O2 -Wall -W -g +CFLAGS = -O0 -Wall -W -g FONTDEFS = $(wildcard *.txt) -FONTS = $(FONTDEFS:.txt=.h) +FONTS = $(FONTDEFS:.txt=.h) $(FONTDEFS:.txt=_r.h) all: fontgen $(FONTS) @@ -11,6 +12,10 @@ all: fontgen $(FONTS) %.h: %.txt fontgen ./fontgen $(@:.h=) < $^ > $@ +%_r.h: %.txt fontgen + ./fontgen $(@:.h=) --rotate < $^ > $@ + + fontgen: fontgen.c $(CC) $(CFLAGS) $< -o $@ diff --git a/fonts/font3x5_1.h b/fonts/font3x5_1.h index f2bc59a..428ddf7 100644 --- a/fonts/font3x5_1.h +++ b/fonts/font3x5_1.h @@ -1,6 +1,6 @@ /** @file font3x5_1.h @author fontgen - @date 28 Sep 2010 + @date 24 Sep 2011 @defgroup font3x5_1 This is a tiny 3x5 font with uppercase, digits, and symbols only. M.P. Hayes 2 Sep 2010 diff --git a/fonts/font3x5_1_r.h b/fonts/font3x5_1_r.h new file mode 100644 index 0000000..a934634 --- /dev/null +++ b/fonts/font3x5_1_r.h @@ -0,0 +1,162 @@ +/** @file font3x5_1_r.h + @author fontgen + @date 24 Sep 2011 + + @defgroup font3x5_1_r This is a tiny 3x5 font with uppercase, digits, and symbols only. + M.P. Hayes 2 Sep 2010 + +*/ + +#ifndef FONT3X5_1_R_H_ +#define FONT3X5_1_R_H_ + +#define FONT3X5_1_R_WIDTH 5 +#define FONT3X5_1_R_HEIGHT 3 +#define FONT3X5_1_R_OFFSET 32 +#define FONT3X5_1_R_SIZE 59 + +#ifndef FONT_WIDTH +#define FONT_WIDTH 5 +#endif +#ifndef FONT_HEIGHT +#define FONT_HEIGHT 3 +#endif +#ifndef FONT_OFFSET +#define FONT_OFFSET 32 +#endif +#ifndef FONT_SIZE_MAX +#define FONT_SIZE_MAX 59 +#endif +#include "font.h" + +static font_t font3x5_1_r = +{ + .flags = 1, /* (packed) */ + .width = 5, + .height = 3, + .offset = 32, + .size = 59, + .bytes = 2, + .data = + { + /* */ + 0x00, 0x00, + /* ! */ + 0xe0, 0x02, + /* " */ + 0xbf, 0x5a, + /* # */ + 0x5f, 0x7d, + /* $ */ + 0xf6, 0x37, + /* % */ + 0x99, 0x4c, + /* & */ + 0xbe, 0x6a, + /* ' */ + 0x40, 0x04, + /* ( */ + 0x2e, 0x02, + /* ) */ + 0x20, 0x3a, + /* * */ + 0xea, 0x2b, + /* + */ + 0xc4, 0x11, + /* , */ + 0x10, 0x01, + /* - */ + 0x84, 0x10, + /* . */ + 0x00, 0x02, + /* / */ + 0x98, 0x0c, + /* 0 */ + 0x2e, 0x3a, + /* 1 */ + 0xf2, 0x43, + /* 2 */ + 0xb9, 0x4a, + /* 3 */ + 0xb1, 0x2a, + /* 4 */ + 0x87, 0x7c, + /* 5 */ + 0xb3, 0x26, + /* 6 */ + 0xae, 0x26, + /* 7 */ + 0xb9, 0x0c, + /* 8 */ + 0xaa, 0x2a, + /* 9 */ + 0xa2, 0x7c, + /* : */ + 0x40, 0x01, + /* ; */ + 0x00, 0x00, + /* < */ + 0x00, 0x00, + /* = */ + 0x00, 0x00, + /* > */ + 0x00, 0x00, + /* ? */ + 0x00, 0x00, + /* @ */ + 0x00, 0x00, + /* A */ + 0x00, 0x00, + /* B */ + 0x00, 0x00, + /* C */ + 0x00, 0x00, + /* D */ + 0x00, 0x00, + /* E */ + 0x00, 0x00, + /* F */ + 0x00, 0x00, + /* G */ + 0x00, 0x00, + /* H */ + 0x00, 0x00, + /* I */ + 0x00, 0x00, + /* J */ + 0x00, 0x00, + /* K */ + 0x00, 0x00, + /* L */ + 0x00, 0x00, + /* M */ + 0x00, 0x00, + /* N */ + 0x00, 0x00, + /* O */ + 0x00, 0x00, + /* P */ + 0x00, 0x00, + /* Q */ + 0x00, 0x00, + /* R */ + 0x00, 0x00, + /* S */ + 0x00, 0x00, + /* T */ + 0x00, 0x00, + /* U */ + 0x00, 0x00, + /* V */ + 0x00, 0x00, + /* W */ + 0x00, 0x00, + /* X */ + 0x00, 0x00, + /* Y */ + 0x00, 0x00, + /* Z */ + 0x00, 0x00, + } +}; +#endif /* FONT3X5_1_R_H_ */ diff --git a/fonts/font5x7_1.h b/fonts/font5x7_1.h index 5c5ef55..023f152 100644 --- a/fonts/font5x7_1.h +++ b/fonts/font5x7_1.h @@ -1,6 +1,6 @@ /** @file font5x7_1.h @author fontgen - @date 28 Sep 2010 + @date 24 Sep 2011 @defgroup font5x7_1 This is a 5x7 font with uppercase, lowercase, digits, and symbols. M.P. Hayes 2 Sep 2010 @@ -29,7 +29,7 @@ #endif #include "font.h" -static const font_t font5x7_1 = +static font_t font5x7_1 = { .flags = 1, /* (packed) */ .width = 5, diff --git a/fonts/font5x7_1_r.h b/fonts/font5x7_1_r.h new file mode 100644 index 0000000..a1570b9 --- /dev/null +++ b/fonts/font5x7_1_r.h @@ -0,0 +1,234 @@ +/** @file font5x7_1_r.h + @author fontgen + @date 24 Sep 2011 + + @defgroup font5x7_1_r This is a 5x7 font with uppercase, lowercase, digits, and symbols. + M.P. Hayes 2 Sep 2010 + +*/ + +#ifndef FONT5X7_1_R_H_ +#define FONT5X7_1_R_H_ + +#define FONT5X7_1_R_WIDTH 7 +#define FONT5X7_1_R_HEIGHT 5 +#define FONT5X7_1_R_OFFSET 32 +#define FONT5X7_1_R_SIZE 95 + +#ifndef FONT_WIDTH +#define FONT_WIDTH 7 +#endif +#ifndef FONT_HEIGHT +#define FONT_HEIGHT 5 +#endif +#ifndef FONT_OFFSET +#define FONT_OFFSET 32 +#endif +#ifndef FONT_SIZE_MAX +#define FONT_SIZE_MAX 95 +#endif +#include "font.h" + +static font_t font5x7_1_r = +{ + .flags = 1, /* (packed) */ + .width = 7, + .height = 5, + .offset = 32, + .size = 95, + .bytes = 5, + .data = + { + /* */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ! */ + 0x80, 0xef, 0x17, 0x00, 0x00, + /* " */ + 0x80, 0x03, 0xe0, 0x00, 0x00, + /* # */ + 0x94, 0x3f, 0xe5, 0x4f, 0x01, + /* $ */ + 0x24, 0xd5, 0x5f, 0x25, 0x01, + /* % */ + 0xa3, 0x09, 0x82, 0x2c, 0x06, + /* & */ + 0xb6, 0x64, 0x55, 0x04, 0x05, + /* ' */ + 0x80, 0xc2, 0x00, 0x00, 0x00, + /* ( */ + 0x00, 0x8e, 0x28, 0x08, 0x00, + /* ) */ + 0x80, 0xa0, 0x88, 0x03, 0x00, + /* * */ + 0x14, 0x84, 0x0f, 0x41, 0x01, + /* + */ + 0x08, 0x84, 0x0f, 0x81, 0x00, + /* , */ + 0x00, 0x28, 0x0c, 0x00, 0x00, + /* - */ + 0x08, 0x04, 0x02, 0x81, 0x00, + /* . */ + 0x00, 0x30, 0x18, 0x00, 0x00, + /* / */ + 0x20, 0x08, 0x82, 0x20, 0x00, + /* 0 */ + 0xbe, 0x68, 0xb2, 0xe8, 0x03, + /* 1 */ + 0x00, 0xe1, 0x1f, 0x08, 0x00, + /* 2 */ + 0xc2, 0x70, 0x34, 0x69, 0x04, + /* 3 */ + 0xa2, 0x64, 0x32, 0x69, 0x03, + /* 4 */ + 0x18, 0x8a, 0xe4, 0x0f, 0x01, + /* 5 */ + 0xaf, 0x64, 0x32, 0x19, 0x03, + /* 6 */ + 0xbe, 0x64, 0x32, 0x29, 0x03, + /* 7 */ + 0x83, 0x40, 0x3c, 0x71, 0x00, + /* 8 */ + 0xb6, 0x64, 0x32, 0x69, 0x03, + /* 9 */ + 0xa6, 0x64, 0x32, 0xe9, 0x03, + /* : */ + 0x00, 0x9b, 0x0d, 0x00, 0x00, + /* ; */ + 0x00, 0xab, 0x0d, 0x00, 0x00, + /* < */ + 0x08, 0x8a, 0x28, 0x08, 0x00, + /* = */ + 0x14, 0x0a, 0x85, 0x42, 0x01, + /* > */ + 0x80, 0xa0, 0x88, 0x82, 0x00, + /* ? */ + 0x82, 0x40, 0x34, 0x61, 0x00, + /* @ */ + 0xb2, 0x64, 0x3e, 0xe8, 0x03, + /* A */ + 0x7c, 0x45, 0x42, 0xc1, 0x07, + /* B */ + 0xff, 0x64, 0x32, 0x69, 0x03, + /* C */ + 0xbe, 0x60, 0x30, 0x28, 0x02, + /* D */ + 0xff, 0x60, 0x30, 0xe8, 0x03, + /* E */ + 0xff, 0x64, 0x32, 0x19, 0x04, + /* F */ + 0xff, 0x44, 0x22, 0x11, 0x00, + /* G */ + 0xbe, 0x60, 0x32, 0xa9, 0x07, + /* H */ + 0x7f, 0x04, 0x02, 0xf1, 0x07, + /* I */ + 0x80, 0xe0, 0x3f, 0x08, 0x00, + /* J */ + 0x30, 0x20, 0x10, 0xf8, 0x03, + /* K */ + 0x7f, 0x04, 0x45, 0x14, 0x04, + /* L */ + 0x7f, 0x20, 0x10, 0x08, 0x04, + /* M */ + 0x7f, 0x01, 0x43, 0xf0, 0x07, + /* N */ + 0x7f, 0x01, 0x01, 0xf1, 0x07, + /* O */ + 0xbe, 0x60, 0x30, 0xe8, 0x03, + /* P */ + 0xff, 0x44, 0x22, 0x61, 0x00, + /* Q */ + 0xbe, 0x60, 0x34, 0xe4, 0x05, + /* R */ + 0xff, 0x44, 0x22, 0x61, 0x07, + /* S */ + 0xa6, 0x64, 0x32, 0x29, 0x03, + /* T */ + 0x81, 0xc0, 0x3f, 0x10, 0x00, + /* U */ + 0x3f, 0x20, 0x10, 0xf8, 0x03, + /* V */ + 0x1f, 0x10, 0x10, 0xf4, 0x01, + /* W */ + 0x3f, 0x20, 0x0e, 0xf8, 0x03, + /* X */ + 0x63, 0x0a, 0x82, 0x32, 0x06, + /* Y */ + 0x03, 0x02, 0x9e, 0x30, 0x00, + /* Z */ + 0xe1, 0x68, 0xb2, 0x38, 0x04, + /* [ */ + 0xff, 0x60, 0x10, 0x00, 0x00, + /* \ */ + 0x02, 0x02, 0x02, 0x02, 0x02, + /* ] */ + 0x80, 0x60, 0xf0, 0x0f, 0x00, + /* ^ */ + 0x04, 0x41, 0x40, 0x40, 0x00, + /* _ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ` */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* a */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* b */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* c */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* d */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* e */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* f */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* g */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* h */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* i */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* j */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* k */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* l */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* m */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* n */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* o */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* p */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* q */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* r */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* s */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* t */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* u */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* v */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* w */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* x */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* y */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* z */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* { */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* | */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* } */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ~ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; +#endif /* FONT5X7_1_R_H_ */ diff --git a/fonts/font5x7_2.h b/fonts/font5x7_2.h index 7af0cdc..2cb901b 100644 --- a/fonts/font5x7_2.h +++ b/fonts/font5x7_2.h @@ -1,6 +1,6 @@ /** @file font5x7_2.h @author fontgen - @date 28 Sep 2010 + @date 24 Sep 2011 @defgroup font5x7_2 This is a 5x7 font with uppercase, digits, and some symbols. M.P. Hayes 2 Sep 2010 diff --git a/fonts/font5x7_2_r.h b/fonts/font5x7_2_r.h new file mode 100644 index 0000000..6e213d5 --- /dev/null +++ b/fonts/font5x7_2_r.h @@ -0,0 +1,186 @@ +/** @file font5x7_2_r.h + @author fontgen + @date 24 Sep 2011 + + @defgroup font5x7_2_r This is a 5x7 font with uppercase, digits, and some symbols. + M.P. Hayes 2 Sep 2010 + +*/ + +#ifndef FONT5X7_2_R_H_ +#define FONT5X7_2_R_H_ + +#define FONT5X7_2_R_WIDTH 7 +#define FONT5X7_2_R_HEIGHT 5 +#define FONT5X7_2_R_OFFSET 32 +#define FONT5X7_2_R_SIZE 71 + +#ifndef FONT_WIDTH +#define FONT_WIDTH 7 +#endif +#ifndef FONT_HEIGHT +#define FONT_HEIGHT 5 +#endif +#ifndef FONT_OFFSET +#define FONT_OFFSET 32 +#endif +#ifndef FONT_SIZE_MAX +#define FONT_SIZE_MAX 71 +#endif +#include "font.h" + +static font_t font5x7_2_r = +{ + .flags = 1, /* (packed) */ + .width = 7, + .height = 5, + .offset = 32, + .size = 71, + .bytes = 5, + .data = + { + /* */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ! */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* " */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* # */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* $ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* % */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* & */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ' */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ( */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ) */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* * */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* + */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* , */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* - */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* . */ + 0x00, 0x00, 0x02, 0x00, 0x00, + /* / */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0 */ + 0xbe, 0x68, 0xb2, 0xe8, 0x03, + /* 1 */ + 0x00, 0xe1, 0x1f, 0x08, 0x00, + /* 2 */ + 0xc2, 0x70, 0x34, 0x69, 0x04, + /* 3 */ + 0xa1, 0x60, 0x71, 0x19, 0x03, + /* 4 */ + 0x18, 0x8a, 0xe4, 0x0f, 0x01, + /* 5 */ + 0xa7, 0x62, 0xb1, 0x98, 0x03, + /* 6 */ + 0x3c, 0x65, 0x32, 0x09, 0x03, + /* 7 */ + 0x81, 0x40, 0xbe, 0x30, 0x00, + /* 8 */ + 0xb7, 0x64, 0x32, 0x69, 0x03, + /* 9 */ + 0x86, 0x64, 0x32, 0xe5, 0x01, + /* : */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ; */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* < */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* = */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* > */ + 0x41, 0x11, 0x05, 0x01, 0x00, + /* ? */ + 0x82, 0x40, 0x34, 0x61, 0x00, + /* @ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* A */ + 0xfe, 0x48, 0x24, 0xe2, 0x07, + /* B */ + 0xc1, 0x7f, 0x32, 0x69, 0x03, + /* C */ + 0xbe, 0x60, 0x30, 0x28, 0x02, + /* D */ + 0xc1, 0x7f, 0x30, 0xe8, 0x03, + /* E */ + 0xff, 0x64, 0x32, 0x99, 0x04, + /* F */ + 0xff, 0x44, 0x22, 0x11, 0x00, + /* G */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* H */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* I */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* J */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* K */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* L */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* M */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* N */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* O */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* P */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* Q */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* R */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* S */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* T */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* U */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* V */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* W */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* X */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* Y */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* Z */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* [ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* \ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ] */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ^ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* _ */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* ` */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* a */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* b */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* c */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* d */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* e */ + 0x00, 0x00, 0x00, 0x00, 0x00, + /* f */ + 0x00, 0x00, 0x00, 0x00, 0x00, + } +}; +#endif /* FONT5X7_2_R_H_ */ diff --git a/fonts/fontgen.c b/fonts/fontgen.c index a604c5d..83db866 100644 --- a/fonts/fontgen.c +++ b/fonts/fontgen.c @@ -11,7 +11,7 @@ #include #include -/* FIXME. This is not robust. */ +/* FIXME. This is not robust. It's an ugly hack. Rewrite in python! */ typedef struct @@ -127,6 +127,7 @@ int font_scan (font_t *font) unsigned int i; font->comment = 0; + font->interlaced = 0; /* FIXME, use more robust key-value pair parsing. */ while (1) @@ -138,7 +139,8 @@ int font_scan (font_t *font) return 0; ungetc (c, stdin); - + + /* Ignore lines starting with #, w, h, i. */ if (!strchr ("#whi", c)) break; @@ -308,6 +310,39 @@ static void font_print_1 (font_t *font, uint8_t symbol) } +static void font_rotate (font_t *font, font_t *rotate_font) +{ + int i; + int x; + int y; + + *rotate_font = *font; + rotate_font->width = font->height; + rotate_font->height = font->width; + rotate_font->data = calloc (FONT_SIZE_MAX, font->bytes); + + for (i = 0; i < font->size; i++) + { + for (y = 0; y < font->height; y++) + { + for (x = 0; x < font->width; x++) + { + int bit; + int newbit; + + bit = y * font->width + x; + newbit = x * font->height + y; + + if (font->data[i * font->bytes + bit / CHAR_BIT] + & (1 << (bit % CHAR_BIT))) + rotate_font->data[i * font->bytes + newbit / CHAR_BIT] + |= (1 << (newbit % CHAR_BIT)); + } + } + } +} + + static void font_print (font_t *font) { int i; @@ -316,7 +351,7 @@ static void font_print (font_t *font) char name_upper[128]; char timestr[32]; - bytes_per_char = (font->width * font->height + 8 - 1) >> 3; + bytes_per_char = (font->width * font->height + CHAR_BIT - 1) / CHAR_BIT; for (i= 0; font->name[i]; i++) name_upper[i] = toupper (font->name[i]); @@ -441,7 +476,7 @@ int main (int argc, char **argv) argc--; argv++; - if (argc > 2 && !strcmp (argv[1], "-zoom")) + if (argc > 2 && !strcmp (argv[1], "--zoom")) { int zoom; font_t zoom_font; @@ -454,7 +489,18 @@ int main (int argc, char **argv) font = zoom_font; } - if (argc > 1 && !strcmp (argv[1], "-ascii")) + if (argc > 1 && !strcmp (argv[1], "--rotate")) + { + font_t rotate_font; + + argc -= 1; + argv += 1; + + font_rotate (&font, &rotate_font); + font = rotate_font; + } + + if (argc > 1 && !strcmp (argv[1], "--ascii")) font_draw (&font); else font_print (&font);