行車介面改用NotoSansCJK 字型

This commit is contained in:
dragonpilot
2019-08-15 17:15:51 +10:00
parent 73d345cd24
commit 4221d3b985
3 changed files with 5 additions and 5 deletions
Binary file not shown.
Binary file not shown.
+5 -5
View File
@@ -536,9 +536,9 @@ static void ui_init(UIState *s) {
assert(s->font_sans_semibold >= 0);
s->font_sans_bold = nvgCreateFont(s->vg, "sans-bold", "../assets/fonts/opensans_bold.ttf");
assert(s->font_sans_bold >= 0);
s->font_miui_regular = nvgCreateFont(s->vg, "miui-regular", "/system/fonts/Miui-Regular.ttf");
s->font_miui_regular = nvgCreateFont(s->vg, "miui-regular", "../assets/fonts/NotoSansCJKtc-Regular.otf");
assert(s->font_miui_regular >= 0);
s->font_miui_bold = nvgCreateFont(s->vg, "miui-bold", "/system/fonts/Miui-Bold.ttf");
s->font_miui_bold = nvgCreateFont(s->vg, "miui-bold", "../assets/fonts/NotoSansCJKtc-Bold.otf");
assert(s->font_miui_bold >= 0);
assert(s->img_wheel >= 0);
@@ -1542,12 +1542,12 @@ static int bb_ui_draw_measure(UIState *s, const char* bb_value, const char* bb_
dx = (int)(bb_uomFontSize*2.5/2);
}
//print value
nvgFontFace(s->vg, "sans-semibold");
nvgFontFace(s->vg, "miui-bold");
nvgFontSize(s->vg, bb_valueFontSize*2.5);
nvgFillColor(s->vg, bb_valueColor);
nvgText(s->vg, bb_x-dx/2, bb_y+ (int)(bb_valueFontSize*2.5)+5, bb_value, NULL);
//print label
nvgFontFace(s->vg, "sans-regular");
nvgFontFace(s->vg, "miui-regular");
nvgFontSize(s->vg, bb_labelFontSize*2.5);
nvgFillColor(s->vg, bb_labelColor);
nvgText(s->vg, bb_x, bb_y + (int)(bb_valueFontSize*2.5)+5 + (int)(bb_labelFontSize*2.5)+5, bb_label, NULL);
@@ -1558,7 +1558,7 @@ static int bb_ui_draw_measure(UIState *s, const char* bb_value, const char* bb_
int ry = bb_y + (int)(bb_valueFontSize*2.5/2)+25;
nvgTranslate(s->vg,rx,ry);
nvgRotate(s->vg, -1.5708); //-90deg in radians
nvgFontFace(s->vg, "sans-regular");
nvgFontFace(s->vg, "miui-regular");
nvgFontSize(s->vg, (int)(bb_uomFontSize*2.5));
nvgFillColor(s->vg, bb_uomColor);
nvgText(s->vg, 0, 0, bb_uom, NULL);