0

I have two laptops, both running the same version of latest Manjaro. The same version of visual-studio-code-bin from AUR is installed. Both use the same font for code. Yet, they render Unicode symbols outside of Latin differently.

Laptop 1:

enter image description here

Laptop 2:

enter image description here

You see that Greek kappa in the first screenshot is very small. I can't catch the difference in configuration between these two desktops. On both laptops settings.json has

"editor.fontFamily": "'FiraCode Nerd Font', monospace"

I can check what font files are actually used:

$ strace -fe openat code . 2>&1 | grep -i 'Fira'
[pid  6004] openat(AT_FDCWD, "/usr/share/fonts/OTF/Fira Code Regular Nerd Font Complete.otf", O_RDONLY <unfinished ...>
[pid  6004] openat(AT_FDCWD, "/usr/share/fonts/OTF/Fira Code Bold Nerd Font Complete.otf", O_RDONLY) = 110

These files are physically the same on both laptops.

Any ideas?

1
  • This doesn't check what font files are actually used, this checks what Fira font files are used and completely ignores the rest. Grep for fonts instead. Commented Apr 28, 2022 at 4:53

1 Answer 1

2

I would argue that both are incorrect (not monospace). This hints at the font not contain a glyph for this codepoint. And indeed it doesn’t contain a glyph for MATHEMATICAL ITALIC KAPPA SYMBOL (U+1D718), which is what this probably is.

That means this character is substituted in from another font. This other font is probably different on the two systems, because they could have different fonts installed. Please also check user1686’s note about how to check which fonts are used.

Furthermore, you could try investigating using the built-in Developer Tools (Help → Toggle Developer Tools). Pick the text element in question (make sure to select a <span>), then switch to the “Computed” style tab:

VS Code Dev Tools

Under “Rendered Fonts” you can clearly see how many glyphs were taken from which fonts.

3
  • Fantastic! This was really helpful. On one laptop, the font was Garamond-Math, on the other it was DejaVu Math TeX Gyre. Do I have any control over which font is used for substitution?
    – facetus
    Commented Apr 28, 2022 at 14:55
  • Phew, no idea. First, you should try adding fonts to the “Font Family” setting. The CSS you really need is not accessible in VS Code. Other than that, things seems to vary wildly between browsers and operating systems. Maybe try this answer on Stack Overflow.
    – Daniel B
    Commented Apr 28, 2022 at 15:08
  • I found it out. I listed the substitute font after Fira in editor.fontFamily: "editor.fontFamily": "'FiraCode Nerd Font', 'DejaVu Math TeX Gyre'".
    – facetus
    Commented Apr 28, 2022 at 15:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .