From 36e85fbd78105993dc43a8067599c1301f7ce5fe Mon Sep 17 00:00:00 2001 From: nickshl Date: Mon, 13 May 2019 17:25:26 -0500 Subject: Fonts redesign --- STM32F415APP/.cproject | 2 ++ STM32F415APP/Application/Application.cpp | 10 +++++----- STM32F415APP/Application/GraphDemo.cpp | 10 +++++----- STM32F415APP/Application/InputTest.cpp | 8 ++++---- STM32F415APP/Application/Pong.cpp | 4 ++-- STM32F415APP/Application/Tetris.cpp | 4 ++-- STM32F415APP/DevCore | 2 +- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/STM32F415APP/.cproject b/STM32F415APP/.cproject index ace207c..2a40fcc 100644 --- a/STM32F415APP/.cproject +++ b/STM32F415APP/.cproject @@ -51,6 +51,7 @@ + @@ -89,6 +90,7 @@ + diff --git a/STM32F415APP/Application/Application.cpp b/STM32F415APP/Application/Application.cpp index 420e0a4..a88d80f 100644 --- a/STM32F415APP/Application/Application.cpp +++ b/STM32F415APP/Application/Application.cpp @@ -241,11 +241,11 @@ Result Application::IicPing(IIic& iic) static char str_buf[8+2][64] = {0}; // Header - str_arr[8].SetParams(" | x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF", 0U, 0, COLOR_WHITE, String::FONT_6x8); - str_arr[9].SetParams("---------------------------------------------------", 0U, 8, COLOR_WHITE, String::FONT_6x8); + str_arr[8].SetParams(" | x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF", 0U, 0, COLOR_WHITE, Font_6x8::GetInstance()); + str_arr[9].SetParams("---------------------------------------------------", 0U, 8, COLOR_WHITE, Font_6x8::GetInstance()); // Sensor data - str_arr[10U].SetParams(str_buf[8U], 0U, 8 * (2+10), COLOR_WHITE, String::FONT_8x12); - str_arr[11U].SetParams(str_buf[9U], 0U, 8 * (2+10) + 12, COLOR_WHITE, String::FONT_8x12); + str_arr[10U].SetParams(str_buf[8U], 0U, 8 * (2+10), COLOR_WHITE, Font_8x12::GetInstance()); + str_arr[11U].SetParams(str_buf[9U], 0U, 8 * (2+10) + 12, COLOR_WHITE, Font_8x12::GetInstance()); // Show strings for(uint32_t i = 0U; i < NumberOf(str_arr); i++) { @@ -253,7 +253,7 @@ Result Application::IicPing(IIic& iic) if(i < 8U) { // Set result string - str_arr[i].SetParams(str_buf[i], 0U, 8 * (2+i), COLOR_WHITE, String::FONT_6x8); + str_arr[i].SetParams(str_buf[i], 0U, 8 * (2+i), COLOR_WHITE, Font_6x8::GetInstance()); } str_arr[i].Show(10000); } diff --git a/STM32F415APP/Application/GraphDemo.cpp b/STM32F415APP/Application/GraphDemo.cpp index fe332a3..7bcbadd 100644 --- a/STM32F415APP/Application/GraphDemo.cpp +++ b/STM32F415APP/Application/GraphDemo.cpp @@ -50,15 +50,15 @@ Result GraphDemo::Loop() Line line2(46, 34, 310, 126, COLOR_CYAN); line2.Show(30); - String str1("Hello World!", 0, 10, COLOR_MAGENTA, String::FONT_4x6); + String str1("Hello World!", 0, 10, COLOR_MAGENTA, Font_4x6::GetInstance()); str1.Show(70); - String str2("Hello World!", 0, 20, COLOR_CYAN, String::FONT_6x8); + String str2("Hello World!", 0, 20, COLOR_CYAN, Font_6x8::GetInstance()); str2.Show(80); - String str3("Hello World!", 0, 30, COLOR_YELLOW, String::FONT_8x8); + String str3("Hello World!", 0, 30, COLOR_YELLOW, Font_8x8::GetInstance()); str3.Show(90); - String str4("Hello World!", 0, 50, COLOR_GREEN,COLOR_MAGENTA, String::FONT_8x12); + String str4("Hello World!", 0, 50, COLOR_GREEN,COLOR_MAGENTA, Font_6x8::GetInstance()); str4.Show(100); - String str5("Hello World!", 0, 70, COLOR_RED, String::FONT_12x16); + String str5("Hello World!", 0, 70, COLOR_RED, Font_10x18::GetInstance()); str5.Show(110); Box box1(0, 0, 100, 10, COLOR_RED, true); diff --git a/STM32F415APP/Application/InputTest.cpp b/STM32F415APP/Application/InputTest.cpp index 0f91fbb..6308e72 100644 --- a/STM32F415APP/Application/InputTest.cpp +++ b/STM32F415APP/Application/InputTest.cpp @@ -45,19 +45,19 @@ char* InputTest::GetMenuStr(void* ptr, char * buf, uint32_t n, uint32_t add_para Result InputTest::Loop() { char str_left[32] = {"\0"}; - String left_str(str_left, 30-2, 20 - 14, COLOR_MAGENTA, String::FONT_8x12); + String left_str(str_left, 30-2, 20 - 14, COLOR_MAGENTA, Font_8x12::GetInstance()); char str_right[32] = {"\0"}; - String right_str(str_right, 190-2, 20 - 14, COLOR_MAGENTA, String::FONT_8x12); + String right_str(str_right, 190-2, 20 - 14, COLOR_MAGENTA, Font_8x12::GetInstance()); Box box_left(30-2, 20, 100+4, 100+4, COLOR_YELLOW); Circle circle_left(30-1, 20-1, 3, COLOR_RED, true); char str_left_data[128] = {"\0"}; - String left_str_data(str_left_data, 0, 200, COLOR_MAGENTA, String::FONT_6x8); + String left_str_data(str_left_data, 0, 200, COLOR_MAGENTA, Font_6x8::GetInstance()); Box box_right(190-2, 20, 100+4, 100+4, COLOR_YELLOW); Circle circle_right(190-1, 20-1, 3, COLOR_RED, true); char str_right_data[128] = {"\0"}; - String right_str_data(str_right_data, 0, 212, COLOR_MAGENTA, String::FONT_6x8); + String right_str_data(str_right_data, 0, 212, COLOR_MAGENTA, Font_6x8::GetInstance()); if(input_drv.GetDeviceType(InputDrv::EXT_LEFT) == InputDrv::EXT_DEV_JOY) { diff --git a/STM32F415APP/Application/Pong.cpp b/STM32F415APP/Application/Pong.cpp index 3b99d34..3805ec4 100644 --- a/STM32F415APP/Application/Pong.cpp +++ b/STM32F415APP/Application/Pong.cpp @@ -63,8 +63,8 @@ Result Pong::Loop() srand(RtosTick::GetTickCount()); char scr_str[32] = {" 0 : 0 "}; - String score_str(scr_str, (display_drv.GetScreenW() - strlen(scr_str)*String::GetFontW(String::FONT_12x16))/2, - 16, COLOR_WHITE, String::FONT_12x16); + String score_str(scr_str, (display_drv.GetScreenW() - strlen(scr_str) * Font_12x16::GetInstance().GetCharW())/2, + 16, COLOR_WHITE, Font_12x16::GetInstance()); score_str.Show(32768); // Init ticks variable diff --git a/STM32F415APP/Application/Tetris.cpp b/STM32F415APP/Application/Tetris.cpp index 96df046..1bf4a56 100644 --- a/STM32F415APP/Application/Tetris.cpp +++ b/STM32F415APP/Application/Tetris.cpp @@ -126,7 +126,7 @@ Result Tetris::Loop() shape.Show(2); next_shape.Show(3); char scr_str[32] = {" "}; - String score_str(scr_str,display_drv.GetScreenW()/2, 16, COLOR_WHITE, String::FONT_8x12); + String score_str(scr_str,display_drv.GetScreenW()/2, 16, COLOR_WHITE, Font_8x12::GetInstance()); score_str.Show(3); // Init ticks variable @@ -157,7 +157,7 @@ Result Tetris::Loop() if (bucket.CheckShapeCollisionIntoBucket(shape)) { char str[16] = {"GAME OVER"}; - String touch_str(str,(display_drv.GetScreenW() - strlen(str)*12)/2,(display_drv.GetScreenH() - 16) / 2, COLOR_WHITE, String::FONT_12x16); + String touch_str(str,(display_drv.GetScreenW() - strlen(str)*12)/2,(display_drv.GetScreenH() - 16) / 2, COLOR_WHITE, Font_12x16::GetInstance()); touch_str.Show(10); // Update Display display_drv.UpdateDisplay(); diff --git a/STM32F415APP/DevCore b/STM32F415APP/DevCore index f560c68..8cc9cfe 160000 --- a/STM32F415APP/DevCore +++ b/STM32F415APP/DevCore @@ -1 +1 @@ -Subproject commit f560c684baebe9d7d5bdc4ee01149e8c29cf060f +Subproject commit 8cc9cfe0c7e29a78def4be21f5c265e3bf1d347f -- cgit v1.2.3