feat(frontend): unify font rendering and add font picker in settings

The UI used hardcoded "PingFang SC" in 50+ components, while the global
font stack in App.vue used a different fallback chain. Outside of mainland
China this caused visibly different fonts in the sidebar, breadcrumbs,
search and agent views compared to settings and document panes.

- Introduce --app-font-family / --app-font-family-mono CSS variables in
  theme.css and route TDesign's --td-font-family through them
- Add a useFont composable that persists the user's choice in localStorage
  and applies it via document.documentElement.style before mount
- Replace hardcoded font-family declarations across the app with the new
  variables (TencentSans logo and the SVG attribute list are preserved)
- Add UI font and monospace font selectors in General Settings with
  i18n strings for en-US, zh-CN, ko-KR and ru-RU

https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
This commit is contained in:
Claude
2026-05-02 08:06:56 +00:00
committed by lyingbug
parent 6c1442aaf9
commit f140c12518
59 changed files with 542 additions and 251 deletions
+5 -5
View File
@@ -30,7 +30,7 @@
margin-top: 5px;
font-weight: bold;
color: var(--td-text-color-placeholder);
font-family: "PingFang SC", "Cascadia Code";
font-family: var(--app-font-family);
transition: all 0.2s ease-out;
font-size: 20px;
}
@@ -91,7 +91,7 @@
table {
font-size: 14px;
margin: 10px 0;
font-family: "PingFang SC", "Cascadia Code";
font-family: var(--app-font-family);
}
h2 {
@@ -307,7 +307,7 @@
.md-image>.md-meta {
border-radius: 3px;
font-family: var(--font-monospace);
font-family: var(--app-font-family-mono);
padding: 2px 0 0 4px;
font-size: 0.9em;
color: inherit;
@@ -337,7 +337,7 @@
.context-menu,
.megamenu-content,
footer {
font-family: var(--font-sans-serif);
font-family: var(--app-font-family);
}
.file-node-content:hover .file-node-icon,
@@ -436,6 +436,6 @@
}
.outline-label {
font-family: "Cascadia Code", "PingFang SC";
font-family: var(--app-font-family);
}
}