Skip to content

Working with fonts

Falcion edited this page Nov 7, 2024 · 2 revisions

The UNITADE Code Editor module not only supports customization of visual parameters like themes and line folding but also allows users to personalize font settings in the editor, including support for ligatures.

Warning

Obsidian registers fonts in the app only after initialization. If you want to add a font that you just installed, you’ll need to restart the application.

Font Size

The font size setting controls the text size in the editor view, essentially adjusting the "zoom" level within the file. Larger values increase text size, while smaller values reduce it.

  • By default, the minimum and maximum font sizes are 5 and 32, respectively. To adjust these limits, you can directly modify the plugin’s configuration in the "data.json" file located in the plugin folder:
{
    ...
    "SYS_FONTSIZE_MAX": 32,
    "SYS_FONTSIZE_MIN": 5
}

Font Family

This setting defines which fonts the editor will use to render text. You can specify multiple fonts in a comma-separated list. The editor will attempt to use the first listed font, and if unavailable, it will fall back to the next font, and so on.

Monaco Editor supports custom font settings, allowing you to choose a typeface for the editor.

  • Fonts must be enclosed in '' and separated by commas.
  • Monospaced fonts are not required but are recommended for a consistent programming experience:

Monospace (or monospaced) fonts give each character the same horizontal space, enhancing readability for code.

# Input example (JSON):
"'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace",

Typing multiple fonts as a fallback ensures the editor always has a font available on the user’s machine to render text.

Important

Before using a font, make sure it is installed on your device.

Font ligatures

Font ligatures are special characters that combine two or more letters into a single glyph or symbol.

Warning

Not all fonts support ligatures. Fonts designed specifically for coding, such as Fira Code, JetBrains Mono, and Cascadia Code, often include ligature support.

More about ligatures with visual examples you can read here: https://hilton.org.uk/blog/fira-code

Clone this wiki locally