aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-07-28 17:08:45 +1000
committerinmarket <andrewh@inmarket.com.au>2013-07-28 17:08:45 +1000
commit3977ee687ffff23e49dcac0ea9a7c3e8652248f0 (patch)
treec5be0359998987d29b6be213413c896fe4d6b07f /demos
parentf84bc2a3f6b82b0f05319fd7c609f8b30929d788 (diff)
downloaduGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.tar.gz
uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.tar.bz2
uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.zip
First cut - beautiful new font handling by PetteriAimonen
Diffstat (limited to 'demos')
-rw-r--r--demos/applications/notepad/gfxconf.h7
-rw-r--r--demos/applications/notepad/main.c16
2 files changed, 10 insertions, 13 deletions
diff --git a/demos/applications/notepad/gfxconf.h b/demos/applications/notepad/gfxconf.h
index 6755d30d..f3f50009 100644
--- a/demos/applications/notepad/gfxconf.h
+++ b/demos/applications/notepad/gfxconf.h
@@ -57,11 +57,8 @@
#define GDISP_NEED_MSGAPI FALSE
/* Builtin Fonts */
-#define GDISP_INCLUDE_FONT_SMALL FALSE
-#define GDISP_INCLUDE_FONT_LARGER FALSE
-#define GDISP_INCLUDE_FONT_UI1 FALSE
-#define GDISP_INCLUDE_FONT_UI2 TRUE
-#define GDISP_INCLUDE_FONT_LARGENUMBERS TRUE
+#define GDISP_INCLUDE_FONT_DEJAVUSANS12 TRUE
+#define GDISP_INCLUDE_FONT_DEJAVUSANS24 TRUE
/* Features for the GINPUT sub-system. */
#define GINPUT_NEED_MOUSE TRUE
diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c
index 261b09d4..020a2b60 100644
--- a/demos/applications/notepad/main.c
+++ b/demos/applications/notepad/main.c
@@ -46,8 +46,8 @@ void drawScreen(void) {
char *msg = "ChibiOS/GFX";
font_t font1, font2;
- font1 = gdispOpenFont("UI2 Double");
- font2 = gdispOpenFont("LargeNumbers");
+ font1 = gdispOpenFont("DejaVuSans24");
+ font2 = gdispOpenFont("DejaVuSans12");
gdispClear(White);
gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, Black);
@@ -61,12 +61,12 @@ void drawScreen(void) {
gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* White */
/* pens */
- gdispDrawString(OFFSET * 2, DRAW_PEN(1), "1", font2, Black);
- gdispDrawString(OFFSET * 2, DRAW_PEN(2), "2", font2, Black);
- gdispDrawString(OFFSET * 2, DRAW_PEN(3), "3", font2, Black);
- gdispDrawString(OFFSET * 2, DRAW_PEN(4), "4", font2, Black);
- gdispDrawString(OFFSET * 2, DRAW_PEN(5), "5", font2, Black);
-
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, White, Black, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, White, Black, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, White, Black, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, White, Black, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, White, Black, justifyCenter);
+
gdispCloseFont(font1);
gdispCloseFont(font2);
}