diff --git a/selfdrive/assets/fonts/NotoSansCJKtc-Bold.otf b/selfdrive/assets/fonts/NotoSansCJKtc-Bold.otf new file mode 100644 index 000000000..7553dc5e7 Binary files /dev/null and b/selfdrive/assets/fonts/NotoSansCJKtc-Bold.otf differ diff --git a/selfdrive/assets/fonts/NotoSansCJKtc-Regular.otf b/selfdrive/assets/fonts/NotoSansCJKtc-Regular.otf new file mode 100644 index 000000000..62ed47d67 Binary files /dev/null and b/selfdrive/assets/fonts/NotoSansCJKtc-Regular.otf differ diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index 56e870fc3..48c6cb6d2 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -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);