Steps to reproduce
- Open Obsidian and navigate to Settings > Appearance.
- In the “Font” section, locate the “Interface font” or “Text font” setting.
- Add a custom font name that includes CJK characters or hyphens (e.g., jf金萱3.1).
- Apply the settings and observe the text rendering in the application interface.
- Open Developer Tools (Ctrl+Shift+I) and inspect the html root element.
Expected result
The application should wrap the custom font name in quotation marks within the CSS variable declaration when the name contains non-ASCII characters, spaces, or hyphens (e.g., --font-text-override: ‘jf金萱3.1’;). This ensures valid CSS syntax and allows the custom font to render correctly.
Actual result
The custom font fails to render. In the Developer Tools, the CSS variables injected into the html element lack the necessary quotation marks, resulting in an invalid CSS declaration (e.g., --font-text-override: jf金萱3.1; --font-print-override: jf金萱3.1;).
Environment
SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.7
Operating system: Windows 11 Pro 10.0.26200
Login status: not logged in
Language: zh-TW
Insider build toggle: off
Live preview: on
Base theme: dark
Community theme: Nord 2.1.2
Snippets enabled: 0
Restricted mode: off
Plugins installed: 2
Plugins enabled: 2
1: Self-hosted LiveSync v0.25.56
2: Advanced Tables v0.22.1
RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
Additional information
Workaround: Manually wrapping the font name in single quotes (e.g., ‘jf金萱3.1’) when entering it in the Appearance settings temporarily resolves the issue.