[Horus] Font again. How is it now?
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
@@ -28,7 +28,7 @@
|
||||
#define MENU_TITLE_TOP 48
|
||||
#define MENU_TITLE_HEIGHT 21
|
||||
#define MENU_BODY_TOP (MENU_TITLE_TOP+MENU_TITLE_HEIGHT)
|
||||
#define MENU_CONTENT_TOP (MENU_BODY_TOP+3)
|
||||
#define MENU_CONTENT_TOP (MENU_BODY_TOP+1)
|
||||
#define MENU_FOOTER_HEIGHT 21
|
||||
#define MENU_FOOTER_TOP (LCD_H-MENU_FOOTER_HEIGHT)
|
||||
#define MENU_BODY_HEIGHT (MENU_FOOTER_TOP-MENU_BODY_TOP)
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#define INVERT_HORZ_MARGIN 3
|
||||
#define INVERT_VERT_MARGIN 1
|
||||
#define INVERT_LINE_HEIGHT 18
|
||||
#define INVERT_LINE_HEIGHT 20
|
||||
|
||||
#define CURVE_SIDE_WIDTH 100
|
||||
#define CURVE_CENTER_X (LCD_W-CURVE_SIDE_WIDTH-7)
|
||||
|
||||
@@ -132,7 +132,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint
|
||||
lcdDrawSizedText(x, y, name, size, flags);
|
||||
coord_t left = (editNameCursorPos == 0 ? 0 : getTextWidth(name, editNameCursorPos, flags));
|
||||
char s[] = { (flags & ZCHAR) ? idx2char(name[editNameCursorPos]) : name[editNameCursorPos], '\0' };
|
||||
lcdDrawSolidFilledRect(x+left-1, y-INVERT_VERT_MARGIN, getTextWidth(s, 1)+1, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawSolidFilledRect(x+left-1, y, getTextWidth(s, 1)+1, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawText(x+left, y, s, TEXT_INVERTED_COLOR);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -157,10 +157,10 @@ const char * displayPopupMenu(evt_t event)
|
||||
for (uint8_t i=0; i<display_count; i++) {
|
||||
if (i == s_menu_item) {
|
||||
lcdDrawSolidFilledRect(MENU_X+1, i*(FH+1) + y + 1, MENU_W-2, FH+1, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 4, popupMenuItems[i+(popupMenuOffsetType == MENU_OFFSET_INTERNAL ? popupMenuOffset : 0)], TEXT_INVERTED_COLOR);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 2, popupMenuItems[i+(popupMenuOffsetType == MENU_OFFSET_INTERNAL ? popupMenuOffset : 0)], TEXT_INVERTED_COLOR);
|
||||
}
|
||||
else {
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 4, popupMenuItems[i+(popupMenuOffsetType == MENU_OFFSET_INTERNAL ? popupMenuOffset : 0)], 0);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 2, popupMenuItems[i+(popupMenuOffsetType == MENU_OFFSET_INTERNAL ? popupMenuOffset : 0)], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
|
||||
|
||||
width = getFontWidth()
|
||||
top, bottom = getFontTopBottom()
|
||||
image = QtGui.QImage(width, fontsize + 2, QtGui.QImage.Format_RGB32)
|
||||
image = QtGui.QImage(width, fontsize + 4, QtGui.QImage.Format_RGB32)
|
||||
image.fill(background)
|
||||
painter = QtGui.QPainter()
|
||||
painter.begin(image)
|
||||
@@ -90,7 +90,7 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
|
||||
if fontsize >= 24:
|
||||
painter.drawText(width - rect.left() + 1, fontsize - 2, c) # fontsize-bottom+1 -17 / 7
|
||||
else:
|
||||
painter.drawText(width + 1, fontsize - 1, c) # fontsize-bottom+1 -17 / 7
|
||||
painter.drawText(width + 1, fontsize, c) # fontsize-bottom+1 -17 / 7
|
||||
width += getCharWidth(c)
|
||||
|
||||
coords.append(width)
|
||||
|
||||