diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-28 17:08:45 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-28 17:08:45 +1000 |
commit | 3977ee687ffff23e49dcac0ea9a7c3e8652248f0 (patch) | |
tree | c5be0359998987d29b6be213413c896fe4d6b07f /demos/applications/notepad/main.c | |
parent | f84bc2a3f6b82b0f05319fd7c609f8b30929d788 (diff) | |
download | uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.tar.gz uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.tar.bz2 uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.zip |
First cut - beautiful new font handling by PetteriAimonen
Diffstat (limited to 'demos/applications/notepad/main.c')
-rw-r--r-- | demos/applications/notepad/main.c | 16 |
1 files changed, 8 insertions, 8 deletions
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);
}
|