diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 2f4cdfc8b7..899d93576c 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -6929,7 +6929,7 @@ const gridContextMenuItems = computed(() => {
(() => { @contextmenu="onCanvasContext" @dblclick="onCanvasDblClick" /> -
-
+
+
(() => { autocapitalize="off" autocorrect="off" spellcheck="false" - class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-2.5 py-0 text-xs leading-[22px] outline-none z-10" + class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-2.5 py-0 text-[12.5px] leading-[22px] outline-none z-10" @blur="commitEditFromBlur" @click.stop @keydown.stop="onEditKeydown" @@ -7000,7 +7000,7 @@ const gridContextMenuItems = computed(() => { (() => {
(() => { autocapitalize="off" autocorrect="off" spellcheck="false" - class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-2.5 py-0 text-xs leading-[22px] outline-none z-10" + class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-2.5 py-0 text-[12.5px] leading-[22px] outline-none z-10" @blur="commitEditFromBlur" @click.stop @keydown.stop="onEditKeydown" @@ -8075,8 +8074,8 @@ const gridContextMenuItems = computed(() => { .canvas-grid-surface { cursor: cell; - font-family: var(--dbx-editor-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace)); - font-size: 0.75rem; + font-family: var(--dbx-data-grid-font-family); + font-size: 12.5px; font-weight: 400; line-height: 1rem; outline: none; diff --git a/apps/desktop/src/lib/canvasDataGridRenderer.ts b/apps/desktop/src/lib/canvasDataGridRenderer.ts index 41b830b8b3..c244091fcb 100644 --- a/apps/desktop/src/lib/canvasDataGridRenderer.ts +++ b/apps/desktop/src/lib/canvasDataGridRenderer.ts @@ -87,7 +87,7 @@ function setCanvasNumericVariant(ctx: CanvasRenderingContext2D, value: "normal" } function canvasTabularFontFamily(fontFamily: string): string { - return fontFamily; + return fontFamily.replace(/"Geist Variable"/g, '"Geist Variable Tabular"'); } const FIT_CANVAS_TEXT_CACHE_MAX = 10000; @@ -362,8 +362,8 @@ export function drawCanvasDataGrid(options: DrawCanvasDataGridOptions) { const value = item.data[actualColIdx]; ctx.textAlign = "left"; ctx.fillStyle = value === null ? theme.mutedForeground : theme.foreground; - ctx.font = value === null ? italicFont : typeof value === "number" ? tabularFont : normalFont; - setCanvasNumericVariant(ctx, typeof value === "number" ? "tabular-nums" : "normal"); + ctx.font = value === null ? italicFont : tabularFont; + setCanvasNumericVariant(ctx, value === null ? "normal" : "tabular-nums"); const textLeft = alignCanvasPixel(x + 12, dpr); const paddedMaxWidth = Math.max(0, x + colWidth - textLeft - 12); const isEditingThisCell = editingCell?.rowId === item.id && editingCell.col === actualColIdx; diff --git a/apps/desktop/src/styles/globals.css b/apps/desktop/src/styles/globals.css index cf9d75ddcc..b2e21738d4 100644 --- a/apps/desktop/src/styles/globals.css +++ b/apps/desktop/src/styles/globals.css @@ -275,6 +275,15 @@ body.dbx-table-reference-dragging * { font-family: var(--dbx-editor-font-family, var(--font-mono, monospace)); } +:root { + --dbx-data-grid-font-family: "Geist Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; +} + +.dbx-data-grid-font-family { + font-family: var(--dbx-data-grid-font-family); + font-size: 12.5px; +} + /* Splitpanes */ .splitpanes--horizontal .splitpanes__pane { transition: none !important;