Файли
openidea/src/platform/consoleFont.ts
T
arookieofcтаa-rookie-of-C-language 51793e02c5 fix(debugger): use the same console font as the Run window (#2865)
The debug console used the UI mono font and size instead of the console font the Run window resolves from Tools › Terminal › Font (or Editor › Font). Both consoles now take family, size and row height from a shared useConsoleFont() hook, the debug console re-measures its rows when the size changes, and its evaluate input uses the same font.

Closes #2844

Co-authored-by: a-rookie-of-C-language <[email protected]>
2026-11-12 18:57:51 +08:00

15 рядки
679 B
TypeScript
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
import { useProject } from "./project";
import { resolveMonoFont } from "./fonts";
import { useWorkflowSettings } from "./workflowSettings";
/**
* The font of the Run and Debug consoles: Tools › Terminal › Font (which can follow
* Editor › Font), with the row height both consoles lay their lines out with.
*/
export function useConsoleFont(): { family: string; size: number; rowHeight: number } {
const terminalFont = useWorkflowSettings((s) => s.terminal);
const editorFont = useProject((s) => s.settings?.editor);
const { family, size } = resolveMonoFont(terminalFont, editorFont);
return { family, size, rowHeight: Math.max(16, Math.round(size * 1.5)) };
}