Better font for template editor, add-on config editor, etc

The font used in the template editor, add-on config editor, etc. is hard to read. For example, compare the readability of the left and right sides in the first screenshot below. The left side is harder to read than the right side.


image

Changing this font to something like Arial, Roboto, etc. would be great.

Choosing the Best Coding Font for Programming – Real Python.

Do you want me to choose one from those given in the above link?

If so, what about Cascadia Code?

It’s also the default font in Visual Studio: GitHub - microsoft/cascadia-code: This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.

I assume it is about the reason why
a monospaced font is used.

FiraCode supremacy :crown:
Open source font with 76k stars and still being worked on


Anki uses Kozuka Gothic Pro

# QFont returns "Kozuka Gothic Pro L" but WebEngine expects "Kozuka Gothic Pro Light"
# - there may be other cases like a trailing 'Bold' that need fixing, but will
# wait for further reports first.
def fontMungeHack(font: str) -> str:
    return re.sub(" L$", " Light", font)

Sorry, I was not clear. Anki uses a monospace font in those screens. The exact font depends on what the toolkit selects when a monospace font is specified. We could potentially vary it depending on the platform, but any specific fonts would need to be available on any Windows 10+/macOS 10.13+ system.

@NameLessGO that’s a workaround for a toolkit issue, and does not mean Anki uses that font.

Then, what about using Consolas for Windows? It has been included with Windows since Windows Vista. Here is a screenshot of the same config file with Consolas font.

image

It is no doubt much easier to read than what the toolkit automatically selects.


Consolas font family - Typography | Microsoft Learn



Courier New font family - Typography | Microsoft Learn

There is Lucida family as well, but they didn’t had great pictures, even in their wiki

Windows 10 and 11 font list can be found here: Font List Windows 10 - Typography | Microsoft Learn

Yu Gothic is an RTL language


find them hard to read due to a lack of zoom shortcuts and line spacing tbh

Would be possible to change the line spacing (1,0-1.5)?

Consolas sounds like it could work. I’ve logged this on Change default monospace font in code editors · Issue #2982 · ankitects/anki · GitHub

1 Like

It looks much better in the new beta. Thanks!
However, I think that the font size can be reduced slightly.

I also noted that the HTML editor in the Note Editor still uses Courier.
image

1 Like