Fonts optimization

This commit is contained in:
Bertrand Songis
2019-12-05 18:58:02 +01:00
parent d5e2f1472e
commit 6228110a48
9 changed files with 81 additions and 57 deletions
-4
View File
@@ -1,17 +1,13 @@
set(FONT "Roboto/Roboto-Regular")
set(FONT_BOLD "Roboto/Roboto-Bold")
set(FONT_OFFSET 1)
set(CJK_FONT "Noto/NotoSansCJKsc-Regular")
set(CJK_FONT_BOLD "Noto/NotoSansCJKsc-Bold")
set(CJK_FONT_OFFSET -3)
#set(FONT "Kanit/Kanit-Regular")
#set(FONT_BOLD "Kanit/Kanit-Bold")
#set(FONT_OFFSET -2)
#set(FONT "Ubuntu/Ubuntu-Regular")
#set(FONT_BOLD "Ubuntu/Ubuntu-Bold")
#set(FONT_OFFSET 1)
if(TRANSLATIONS STREQUAL CN)
set(subset all)
@@ -115,9 +115,12 @@ void FullScreenDialog::checkEvents()
void FullScreenDialog::deleteLater()
{
#if !defined(HARDWARE_TOUCH)
if (previousFocus) {
previousFocus->setFocus();
}
#endif
if (running) {
running = false;
}
+2 -2
View File
@@ -113,10 +113,10 @@ int getTextWidth(const char * s, int len, LcdFlags flags)
if (c >= 0x101)
c -= 1;
c += CJK_FIRST_LETTER_INDEX;
result += getFontPatternWidth(specs, c);
result += getFontPatternWidth(specs, c) + 1;
}
else if (c >= 0x20) {
result += getCharWidth(c, specs);
result += getCharWidth(c, specs) + 1;
}
++s;
+1 -1
View File
@@ -55,7 +55,7 @@ constexpr uint32_t FH = PAGE_LINE_HEIGHT;
constexpr uint32_t NUM_BODY_LINES = MENU_BODY_HEIGHT / PAGE_LINE_HEIGHT;
constexpr uint32_t FIELD_PADDING_LEFT = 3;
constexpr uint32_t FIELD_PADDING_TOP = 0;
constexpr uint32_t FIELD_PADDING_TOP = 2;
constexpr uint32_t CURVE_SIDE_WIDTH = 100;
constexpr uint32_t CURVE_CENTER_X = LCD_W - CURVE_SIDE_WIDTH - 7;
+8 -9
View File
@@ -123,7 +123,7 @@ DRESULT __disk_write(BYTE drv, const BYTE * buff, DWORD sector, UINT count);
#define FLASH_PAGESIZE 256
void unlockFlash();
void lockFlash();
void flashWrite(uint32_t * address, uint32_t * buffer);
void flashWrite(uint32_t * address, const uint32_t * buffer);
uint32_t isFirmwareStart(const uint8_t * buffer);
uint32_t isBootloaderStart(const uint8_t * buffer);
@@ -252,21 +252,20 @@ extern uint32_t powerupReason;
#define DIRTY_SHUTDOWN 0xCAFEDEAD
#define NORMAL_POWER_OFF ~DIRTY_SHUTDOWN
#define wdt_disable()
void watchdogInit(unsigned int duration);
#if defined(SIMU)
#define WAS_RESET_BY_WATCHDOG() (false)
#define WAS_RESET_BY_SOFTWARE() (false)
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (false)
#define wdt_enable(x)
#define wdt_reset()
#define WDG_ENABLE(x)
#define WDG_RESET()
#else
#if defined(WATCHDOG_DISABLED)
#define wdt_enable(x)
#define wdt_reset()
#if defined(WATCHDOG)
#define WDG_ENABLE(x) watchdogInit(x)
#define WDG_RESET() IWDG->KR = 0xAAAA
#else
#define wdt_enable(x) watchdogInit(x)
#define wdt_reset() IWDG->KR = 0xAAAA
#define WDG_ENABLE(x)
#define WDG_RESET()
#endif
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
+1 -1
View File
@@ -55,7 +55,7 @@ constexpr uint32_t FH = PAGE_LINE_HEIGHT;
constexpr uint32_t NUM_BODY_LINES = MENU_BODY_HEIGHT / PAGE_LINE_HEIGHT;
constexpr uint32_t FIELD_PADDING_LEFT = 3;
constexpr uint32_t FIELD_PADDING_TOP = 2;
constexpr uint32_t FIELD_PADDING_TOP = 3;
constexpr uint32_t CURVE_SIDE_WIDTH = 100;
constexpr uint32_t CURVE_CENTER_X = LCD_W - CURVE_SIDE_WIDTH - 7;