2 #include "oswald_strings.h"
3 #include "oswald_fonts.h"
5 #include "oswald_graphics.h"
8 void oswald_draw_Line(u8t xstart, u8t ystart, u8t xend, u8t yend)
10 int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
15 incx = (dx >= 0) ? 1 : -1;
16 incy = (dy >= 0) ? 1 : -1;
36 lcd_set_pixel(x, y, TRUE);
38 for (t = 0; t < el; ++t) {
48 lcd_set_pixel(x, y, TRUE);
53 void oswald_draw_line_ww(u8t xstart, u8t ystart, u8t xend, u8t yend, u8t thickness)
55 int i, x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
60 incx = (dx >= 0) ? 1 : -1;
61 incy = (dy >= 0) ? 1 : -1;
81 lcd_set_pixel(x, y, TRUE);
82 for (i=1; i<thickness; i++) {
83 lcd_set_pixel(x-i, y, TRUE);
84 lcd_set_pixel(x+i, y, TRUE);
85 lcd_set_pixel(x, y-i, TRUE);
86 lcd_set_pixel(x, y+i, TRUE);
89 for (t = 0; t < el; ++t) {
99 lcd_set_pixel(x, y, TRUE);
100 for (i=1; i<thickness; i++) {
101 lcd_set_pixel(x-i, y, TRUE);
102 lcd_set_pixel(x+i, y, TRUE);
103 lcd_set_pixel(x, y-i, TRUE);
104 lcd_set_pixel(x, y+i, TRUE);
107 lcd_update_display();
110 u8t oswald_write_character(u8t x, u8t y, oswald_font_face face, u8t Character)
113 u8t CharacterHeight = GetCharacterHeight();
114 u8t CharacterWidth = GetCharacterWidth(Character);
115 u16t bitmap[MAX_FONT_ROWS];
118 GetCharacterBitmap(Character, bitmap);
120 // printf("cw=%d ch=%d\n", CharacterWidth, CharacterHeight);
121 for (ly=0; ly<CharacterHeight; ly++) {
122 for (lx=0; lx<CharacterWidth; lx++) {
123 if (bitmap[ly] & (1<<lx)) {
124 lcd_set_pixel(lx+x, ly+y, TRUE);
127 lcd_set_pixel(lx+x, ly+y, FALSE);
134 return CharacterWidth + GetFontSpacing();
136 char *cdata = oswald_fonts[face].data[Character];
138 dbg_out("%c", cdata[1]);
142 void oswald_write_string(u8t x, u8t y, oswald_font_face face, u8t *str)
144 register lx, i, strl;
146 strl = oswald_strlen(str);
151 for (i=0; i<strl; i++) {
152 lx += WriteLcdCharacter(lx, y, str[i]);
157 void oswald_Write_number(u8t x, u8t y, oswald_font_face face, s16t number)
159 register lx, i, strl;
162 itoa(number, str, 10);
163 strl = oswald_strlen(str);
168 for (i=0; i<strl; i++) {
169 lx += WriteLcdCharacter(lx, y, str[i]);