This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 8d2ecb32294836112e300b456b2d620f1b033b31 (commit) via 68bf70ebf964f8c18fd9c6236bed90635bba33aa (commit) via 7bf591aaf8c469582e3f0ad66a09f4de9d9141c7 (commit) via 3d75c6b108284ae15bd94f5741023d92b87225b9 (commit) from 2af0fde79674ad30155948d78316c5dfa3df83c4 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/8d2ecb32294836112e300b456b2d620f1b033...
commit 8d2ecb32294836112e300b456b2d620f1b033b31 Author: Cyril Hrubis metan@ucw.cz Date: Wed Sep 18 00:14:24 2013 +0200
text: fonts: Add C64 like monospace font.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/fileview.c b/demos/c_simple/fileview.c index 5091ffa..f0608c7 100644 --- a/demos/c_simple/fileview.c +++ b/demos/c_simple/fileview.c @@ -72,6 +72,9 @@ void redraw_screen(void) style.font = GP_FontTiny; break; case 4: + style.font = GP_FontC64; + break; + case 5: style.font = font; break; } @@ -133,9 +136,9 @@ void event_loop(void) switch (ev.val.key.key) { case GP_KEY_SPACE: if (font) - font_flag = (font_flag + 1) % 5; + font_flag = (font_flag + 1) % 6; else - font_flag = (font_flag + 1) % 4; + font_flag = (font_flag + 1) % 5;
redraw_screen(); GP_BackendFlip(backend); diff --git a/demos/c_simple/fonttest.c b/demos/c_simple/fonttest.c index 4c35110..2ecfa05 100644 --- a/demos/c_simple/fonttest.c +++ b/demos/c_simple/fonttest.c @@ -119,6 +119,9 @@ void redraw_screen(void) style.font = GP_FontTinyMono; break; case 4: + style.font = GP_FontC64; + break; + case 5: style.font = font; break; } @@ -201,9 +204,9 @@ void event_loop(void) switch (ev.val.key.key) { case GP_KEY_SPACE: if (font) - font_flag = (font_flag + 1) % 5; + font_flag = (font_flag + 1) % 6; else - font_flag = (font_flag + 1) % 4; + font_flag = (font_flag + 1) % 5;
redraw_screen(); GP_BackendFlip(win); diff --git a/include/text/GP_Fonts.h b/include/text/GP_Fonts.h index d05dfc3..3a54da3 100644 --- a/include/text/GP_Fonts.h +++ b/include/text/GP_Fonts.h @@ -39,4 +39,9 @@ extern const GP_FontFace *GP_FontTinyMono; */ extern const GP_FontFace *GP_FontTiny;
+/* + * Monospace 8x8 Commodore 64 like font. + */ +extern const GP_FontFace *GP_FontC64; + #endif /* TEXT_GP_FONTS_H */ diff --git a/libs/text/GP_FontC64.c b/libs/text/GP_FontC64.c new file mode 100644 index 0000000..4d476de --- /dev/null +++ b/libs/text/GP_FontC64.c @@ -0,0 +1,231 @@ +/***************************************************************************** + * This file is part of gfxprim library. * + * * + * Gfxprim is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * Gfxprim is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with gfxprim; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * + * * + *****************************************************************************/ + +#include "GP_Font.h" + +static int8_t c64_glyphs[] = { + /* ' ' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* '!' */ 8, 7, 0, 7, 8, + 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x30, + /* '"' */ 8, 7, 0, 7, 8, + 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, + /* '#' */ 8, 7, -1, 7, 8, + 0x66, 0x66, 0xff, 0x66, 0xff, 0x66, 0x66, + /* '$' */ 8, 7, 0, 7, 8, + 0x30, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x30, + /* '%' */ 8, 7, 0, 7, 8, + 0xc4, 0xcc, 0x18, 0x30, 0x60, 0xcc, 0x8c, + /* '&' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0x78, 0x70, 0xce, 0xcc, 0x7e, + /* ''' */ 8, 7, 0, 7, 8, + 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, + /* '(' */ 8, 7, 0, 7, 8, + 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, + /* ')' */ 8, 7, 0, 7, 8, + 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, + /* '*' */ 8, 7, -1, 7, 8, + 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, + /* '+' */ 8, 7, 0, 7, 8, + 0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, + /* ',' */ 8, 7, 0, 6, 8, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, + /* '-' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + /* '.' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, + /* '/' */ 8, 7, 0, 7, 8, + 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, + /* '0' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xdc, 0xec, 0xcc, 0xcc, 0x78, + /* '1' */ 8, 7, 0, 7, 8, + 0x30, 0x30, 0x70, 0x30, 0x30, 0x30, 0xfc, + /* '2' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0x0c, 0x18, 0x60, 0xc0, 0xfc, + /* '3' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0x0c, 0x38, 0x0c, 0xcc, 0x78, + /* '4' */ 8, 7, 0, 7, 8, + 0x0c, 0x1c, 0x3c, 0xcc, 0xfe, 0x0c, 0x0c, + /* '5' */ 8, 7, 0, 7, 8, + 0xfc, 0xc0, 0xf8, 0x0c, 0x0c, 0xcc, 0x78, + /* '6' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xc0, 0xf8, 0xcc, 0xcc, 0x78, + /* '7' */ 8, 7, 0, 7, 8, + 0xfc, 0xcc, 0x18, 0x30, 0x30, 0x30, 0x30, + /* '8' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xcc, 0x78, 0xcc, 0xcc, 0x78, + /* '9' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, + /* ':' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, + /* ';' */ 8, 7, 0, 6, 8, + 0x00, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60, + /* '<' */ 8, 7, 0, 7, 8, + 0x1c, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x1c, + /* '=' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x00, + /* '>' */ 8, 7, 0, 7, 8, + 0xe0, 0x30, 0x18, 0x0c, 0x18, 0x30, 0xe0, + /* '?' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0x0c, 0x18, 0x30, 0x00, 0x30, + /* '@' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xdc, 0xdc, 0xc0, 0xc4, 0x78, + /* 'A' */ 8, 7, 0, 7, 8, + 0x30, 0x78, 0xcc, 0xfc, 0xcc, 0xcc, 0xcc, + /* 'B' */ 8, 7, 0, 7, 8, + 0xf8, 0xcc, 0xcc, 0xf8, 0xcc, 0xcc, 0xf8, + /* 'C' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xc0, 0xc0, 0xc0, 0xcc, 0x78, + /* 'D' */ 8, 7, 0, 7, 8, + 0xf0, 0xd8, 0xcc, 0xcc, 0xcc, 0xd8, 0xf0, + /* 'E' */ 8, 7, 0, 7, 8, + 0xfc, 0xc0, 0xc0, 0xf8, 0xc0, 0xc0, 0xfc, + /* 'F' */ 8, 7, 0, 7, 8, + 0xfc, 0xc0, 0xc0, 0xf8, 0xc0, 0xc0, 0xc0, + /* 'G' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xc0, 0xdc, 0xcc, 0xcc, 0x78, + /* 'H' */ 8, 7, 0, 7, 8, + 0xcc, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0xcc, + /* 'I' */ 8, 7, 0, 7, 8, + 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, + /* 'J' */ 8, 7, 0, 7, 8, + 0x3c, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, + /* 'K' */ 8, 7, 0, 7, 8, + 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, + /* 'L' */ 8, 7, 0, 7, 8, + 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, + /* 'M' */ 8, 7, 0, 7, 8, + 0xc6, 0xee, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, + /* 'N' */ 8, 7, 0, 7, 8, + 0xcc, 0xec, 0xfc, 0xfc, 0xdc, 0xcc, 0xcc, + /* 'O' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, + /* 'P' */ 8, 7, 0, 7, 8, + 0xf8, 0xcc, 0xcc, 0xf8, 0xc0, 0xc0, 0xc0, + /* 'Q' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x1c, + /* 'R' */ 8, 7, 0, 7, 8, + 0xf8, 0xcc, 0xcc, 0xf8, 0xf0, 0xd8, 0xcc, + /* 'S' */ 8, 7, 0, 7, 8, + 0x78, 0xcc, 0xc0, 0x78, 0x0c, 0xcc, 0x78, + /* 'T' */ 8, 7, 0, 7, 8, + 0xfc, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + /* 'U' */ 8, 7, 0, 7, 8, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, + /* 'V' */ 8, 7, 0, 7, 8, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x30, + /* 'W' */ 8, 7, 0, 7, 8, + 0xc6, 0xc6, 0xc6, 0xd6, 0xfe, 0xee, 0xc6, + /* 'X' */ 8, 7, 0, 7, 8, + 0xcc, 0xcc, 0x78, 0x30, 0x78, 0xcc, 0xcc, + /* 'Y' */ 8, 7, 0, 7, 8, + 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x30, 0x30, + /* 'Z' */ 8, 7, 0, 7, 8, + 0xfc, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xfc, + /* '[' */ 8, 7, 0, 7, 8, + 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, + /* '' */ 8, 7, 0, 7, 8, + 0x00, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, + /* ']' */ 8, 7, 0, 7, 8, + 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, + /* '^' */ 8, 7, 0, 7, 8, + 0x30, 0x78, 0xcc, 0x00, 0x00, 0x00, 0x00, + /* '_' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + /* '`' */ 8, 7, 0, 7, 8, + 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, + /* 'a' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x7c, + /* 'b' */ 8, 7, 0, 7, 8, + 0x00, 0xc0, 0xc0, 0xf8, 0xcc, 0xcc, 0xf8, + /* 'c' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x78, 0xc0, 0xc0, 0xc0, 0x78, + /* 'd' */ 8, 7, 0, 7, 8, + 0x00, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc, 0x7c, + /* 'e' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, + /* 'f' */ 8, 7, 0, 7, 8, + 0x00, 0x38, 0x60, 0xf8, 0x60, 0x60, 0x60, + /* 'g' */ 8, 7, 0, 6, 8, + 0x00, 0x7c, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8, + /* 'h' */ 8, 7, 0, 7, 8, + 0x00, 0xc0, 0xc0, 0xf8, 0xcc, 0xcc, 0xcc, + /* 'i' */ 8, 7, 0, 7, 8, + 0x00, 0x30, 0x00, 0x70, 0x30, 0x30, 0x78, + /* 'j' */ 8, 7, 0, 6, 8, + 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0xf0, + /* 'k' */ 8, 7, 0, 7, 8, + 0x00, 0xc0, 0xc0, 0xd8, 0xf0, 0xd8, 0xcc, + /* 'l' */ 8, 7, 0, 7, 8, + 0x00, 0x70, 0x30, 0x30, 0x30, 0x30, 0x78, + /* 'm' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xcc, 0xfe, 0xfe, 0xd6, 0xc6, + /* 'n' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, + /* 'o' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0x78, + /* 'p' */ 8, 7, 0, 6, 8, + 0x00, 0xf8, 0xcc, 0xcc, 0xf8, 0xc0, 0xc0, + /* 'q' */ 8, 7, 0, 6, 8, + 0x00, 0x7c, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, + /* 'r' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xf8, 0xcc, 0xc0, 0xc0, 0xc0, + /* 's' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, + /* 't' */ 8, 7, 0, 7, 8, + 0x00, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x1c, + /* 'u' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, + /* 'v' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x78, 0x30, + /* 'w' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xc6, 0xd6, 0xfe, 0x7c, 0x6c, + /* 'x' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xcc, 0x78, 0x30, 0x78, 0xcc, + /* 'y' */ 8, 7, 0, 6, 8, + 0x00, 0xcc, 0xcc, 0xcc, 0x7c, 0x18, 0xf0, + /* 'z' */ 8, 7, 0, 7, 8, + 0x00, 0x00, 0xfc, 0x18, 0x30, 0x60, 0xfc, + /* '{' */ 8, 7, 0, 7, 8, + 0x30, 0x60, 0x60, 0xc0, 0x60, 0x60, 0x30, + /* '|' */ 8, 7, 0, 7, 8, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + /* '}' */ 8, 7, 0, 7, 8, + 0x30, 0x18, 0x18, 0x0c, 0x18, 0x18, 0x30, + /* '~' */ 8, 7, 0, 7, 8, + 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static struct GP_FontFace c64 = { + .family_name = "C64", + .style_name = "Mono", + .charset = GP_CHARSET_7BIT, + .ascend = 7, + .descend = 2, + .max_glyph_width = 8, + .max_glyph_advance = 9, + .glyph_bitmap_format = GP_FONT_BITMAP_1BPP, + .glyphs = c64_glyphs, + .glyph_offsets = {12}, +}; + +const struct GP_FontFace *GP_FontC64 = &c64;
http://repo.or.cz/w/gfxprim.git/commit/68bf70ebf964f8c18fd9c6236bed90635bba3...
commit 68bf70ebf964f8c18fd9c6236bed90635bba33aa Author: Cyril Hrubis metan@ucw.cz Date: Wed Sep 18 00:11:24 2013 +0200
libs: text: Small enhancements for default monospace font.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/text/GP_DefaultFont.c b/libs/text/GP_DefaultFont.c index 52b6608..d67fa99 100644 --- a/libs/text/GP_DefaultFont.c +++ b/libs/text/GP_DefaultFont.c @@ -19,7 +19,7 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
@@ -58,25 +58,25 @@ static int8_t default_console_glyphs[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, /* '/' */ 7, 11, 0, 9, 8, 0x00, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x00, 0x00, - /* '0' */ 7, 11, 0, 9, 8, + /* '0' */ 7, 11, 1, 9, 8, 0x78, 0x84, 0x8c, 0x94, 0xb4, 0xa4, 0xc4, 0x84, 0x78, 0x00, 0x00, - /* '1' */ 7, 11, 0, 9, 8, + /* '1' */ 7, 11, 1, 9, 8, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x00, 0x00, - /* '2' */ 7, 11, 0, 9, 8, + /* '2' */ 7, 11, 1, 9, 8, 0x78, 0x84, 0x84, 0x04, 0x18, 0x60, 0x80, 0x80, 0xfc, 0x00, 0x00, - /* '3' */ 7, 11, 0, 9, 8, + /* '3' */ 7, 11, 1, 9, 8, 0x78, 0x84, 0x84, 0x04, 0x18, 0x04, 0x84, 0x84, 0x78, 0x00, 0x00, - /* '4' */ 7, 11, 0, 9, 8, + /* '4' */ 7, 11, 1, 9, 8, 0x18, 0x28, 0x48, 0x48, 0x88, 0xfc, 0x08, 0x08, 0x08, 0x00, 0x00, - /* '5' */ 7, 11, 0, 9, 8, + /* '5' */ 7, 11, 1, 9, 8, 0xfc, 0x80, 0x80, 0xf8, 0x04, 0x04, 0x84, 0x84, 0x78, 0x00, 0x00, - /* '6' */ 7, 11, 0, 9, 8, + /* '6' */ 7, 11, 1, 9, 8, 0x78, 0x80, 0x80, 0xf8, 0x84, 0x84, 0x84, 0x84, 0x78, 0x00, 0x00, - /* '7' */ 7, 11, 0, 9, 8, + /* '7' */ 7, 11, 1, 9, 8, 0xfc, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, - /* '8' */ 7, 11, 0, 9, 8, + /* '8' */ 7, 11, 1, 9, 8, 0x78, 0x84, 0x84, 0x84, 0x78, 0x84, 0x84, 0x84, 0x78, 0x00, 0x00, - /* '9' */ 7, 11, 0, 9, 8, + /* '9' */ 7, 11, 1, 9, 8, 0x78, 0x84, 0x84, 0x84, 0x84, 0x7c, 0x04, 0x04, 0x78, 0x00, 0x00, /* ':' */ 7, 11, 0, 9, 8, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, @@ -100,7 +100,7 @@ static int8_t default_console_glyphs[] = { 0x7c, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x82, 0x7c, 0x00, 0x00, /* 'D' */ 7, 11, 0, 9, 8, 0xf8, 0x84, 0x82, 0x82, 0x82, 0x82, 0x82, 0x84, 0xf8, 0x00, 0x00, - /* 'E' */ 7, 11, 0, 9, 8, + /* 'E' */ 7, 11, 0, 9, 8, 0xfe, 0x80, 0x80, 0x80, 0xfc, 0x80, 0x80, 0x80, 0xfe, 0x00, 0x00, /* 'F' */ 7, 11, 0, 9, 8, 0xfe, 0x80, 0x80, 0x80, 0xf8, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, @@ -149,7 +149,7 @@ static int8_t default_console_glyphs[] = { /* '' */ 7, 11, 0, 9, 8, 0x00, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x00, 0x00, /* ']' */ 7, 11, 0, 9, 8, - 0x1e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x1e, 0x00, 0x00, + 0x3c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x3c, 0x00, 0x00, /* '^' */ 7, 11, 0, 9, 8, 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* '_' */ 7, 11, 0, 9, 8,
http://repo.or.cz/w/gfxprim.git/commit/7bf591aaf8c469582e3f0ad66a09f4de9d914...
commit 7bf591aaf8c469582e3f0ad66a09f4de9d9141c7 Author: Cyril Hrubis metan@ucw.cz Date: Wed Sep 18 00:02:59 2013 +0200
loaders: ZIP: Load PNG images from stored records
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/loaders/GP_ZIP.c b/libs/loaders/GP_ZIP.c index 83fe617..794d794 100644 --- a/libs/loaders/GP_ZIP.c +++ b/libs/loaders/GP_ZIP.c @@ -343,8 +343,15 @@ static GP_Context *zip_next_file(FILE *f, GP_ProgressCallback *callback) if (header.uncomp_size == 0) goto out;
+ off_t cur_off = ftell(f); + ret = GP_ReadJPG(f, callback);
+ if (!ret) { + fseek(f, cur_off, SEEK_SET); + ret = GP_ReadPNG(f, callback); + } + goto out; break; case COMPRESS_DEFLATE:
http://repo.or.cz/w/gfxprim.git/commit/3d75c6b108284ae15bd94f5741023d92b8722...
commit 3d75c6b108284ae15bd94f5741023d92b87225b9 Author: Cyril Hrubis metan@ucw.cz Date: Sun Sep 15 20:58:10 2013 +0200
core: GP_Pixel: Fix segfault.
This fixes segfault in GP_PixelRGBMatch() and GP_PixelRGBLookup() when currently matched pixel in table is not RGB (by skipping all pixels that aren't).
NOTE: This was found on paletted framebuffer where (for obvious reasons) correct pixel wasn't found and the framebuffer backend initialization segfaulted while trying to match pixel type (on GP_PIXEL_G8 on NULL dereference).
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/core/GP_Pixel.c b/libs/core/GP_Pixel.c index 4fb13fb..6bb59ea 100644 --- a/libs/core/GP_Pixel.c +++ b/libs/core/GP_Pixel.c @@ -19,14 +19,14 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
#include <string.h>
#include "GP_Debug.h" -#include "GP_Pixel.h" +#include "GP_Pixel.h"
static const GP_PixelTypeChannel * get_channel(const GP_PixelTypeDescription *desc, const char *name) @@ -78,9 +78,11 @@ GP_PixelType GP_PixelRGBMatch(GP_Pixel rmask, GP_Pixel gmask,
for (i = 0; i < GP_PIXEL_MAX; i++) { int res; - const GP_PixelTypeChannel *r, *g, *b, *a;
+ if (!GP_PixelHasFlags(i, GP_PIXEL_IS_RGB)) + continue; + if (GP_PixelTypes[i].size != bits_per_pixel) continue;
@@ -133,6 +135,9 @@ GP_PixelType GP_PixelRGBLookup(uint32_t rsize, uint32_t roff, for (i = 0; i < GP_PIXEL_MAX; i++) { const GP_PixelTypeChannel *r, *g, *b, *a;
+ if (!GP_PixelHasFlags(i, GP_PIXEL_IS_RGB)) + continue; + if (GP_PixelTypes[i].size != bits_per_pixel) continue;
-----------------------------------------------------------------------
Summary of changes: demos/c_simple/fileview.c | 7 +- demos/c_simple/fonttest.c | 7 +- include/text/GP_Fonts.h | 5 + libs/core/GP_Pixel.c | 11 ++- libs/loaders/GP_ZIP.c | 7 ++ libs/text/GP_DefaultFont.c | 26 +++--- libs/text/GP_FontC64.c | 231 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 274 insertions(+), 20 deletions(-) create mode 100644 libs/text/GP_FontC64.c
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.