From a30e501031ba944c698e3d5e114e89bdbe0342a2 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Thu, 6 Feb 2025 13:16:35 +0200 Subject: [PATCH] Set charts font to Roboto (#24097) --- src/components/chart/ha-chart-base.ts | 1 + src/util/text.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 4988ff75c8..81029851a0 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -328,6 +328,7 @@ export class HaChartBase extends LitElement { backgroundColor: "transparent", textStyle: { color: style.getPropertyValue("--primary-text-color"), + fontFamily: "Roboto, Noto, sans-serif", }, title: { textStyle: { diff --git a/src/util/text.ts b/src/util/text.ts index edd6afdd08..433f7b5fee 100644 --- a/src/util/text.ts +++ b/src/util/text.ts @@ -10,7 +10,7 @@ let textMeasureCanvas: HTMLCanvasElement | undefined; export function measureTextWidth( text: string, fontSize: number, - fontFamily = "sans-serif" + fontFamily = "Roboto, Noto, sans-serif" ): number { if (!textMeasureCanvas) { textMeasureCanvas = document.createElement("canvas");