2

I purchased the Operator Mono fonts to use for my development workstation. I love the readability of the font and really prefer Operator Mono Book; however, it will not display in Visual Studio Code.

All other fonts in the Operator Mono font family display (Operator Mono Light, Medium, etc.). Below is my configuration.

{
    "window.zoomLevel": 0,
    "editor.formatOnSave": true,
    "editor.fontLigatures": true,
    "vscode_custom_css.imports": [
        "file:///D:/vscode_styles.css"
    ],
    "workbench.colorTheme": "Monokai Pro",
    "workbench.iconTheme": "Monokai Pro Icons",
    "editor.fontFamily": "'Operator Mono Book', 'Fira Code', Consolas, 'Courier New', monospace"
}

Has anybody had this issue? It displays in Sublime Text and Word with no problems. The workstation is running Windows 10 Pro.

Thanks!

2
  • See if this github issue thread answers your question: github.com/Microsoft/vscode/issues/43626 Commented Sep 18, 2019 at 21:18
  • I did read through that before posting with no success; however, if I delete every Operator Mono font and only reinstall Operator Mono Book, it display when I use editor.fontFamily": "'Operator Mono'" It is not a perfect workaround because I do use some of the other weights depending on which language I am in. Unfortunately, I think I'm just going to have to forget about the Book weight and just use the light and medium, respectively. Not a huge deal and thank you for your help @MichaelFrank!
    – user1091624
    Commented Sep 18, 2019 at 22:00

2 Answers 2

1

Upon further research and testing in some of our custom election apps, it appears this issue is entirely confined to the Windows builds of Chromium. For some reason, Chromium will not render the Book weight. It works perfectly in Election applications running in Linux.

The following snippet is where I was testing various fonts successfully (except for Operator Mono Book) in Visual Studio Code on Windows.

<div class="view-lines" role="presentation" aria-hidden="true" data-mprt="7" style="position: absolute; font-family:'Operator Mono Medium' ">
</div>

Below is a screenshot from Microsoft Word 2019, and it displays all Operator Mono font weights properly as is the case with Sublime Text 3+ (I am not sure about earlier versions).

Screenshot from Microsoft Office 2019 Correctly Displaying Operator Mono Book font weight

2
  • I still think this is due to Windows itself not recognising Book as a legitimate font weight. Some applications might rely on the Windows Font API, (like Chromium?) while others access font files directly and retrieve font names from the files themselves, and not the API. Commented Sep 24, 2019 at 21:45
  • You may be correct, but I have a hard time believing Microsoft isn't using the Windows Font API. Microsoft Office 2013, 2016, and 2019 display the Book weight of the Operator Mono family.
    – user1091624
    Commented Sep 25, 2019 at 15:04
0

I'm pretty sure this is caused by the font names being incorrect.

Here is a screenshot from my font folder on Windows:

Operator Mono font file names As you can see, there seems to be a double up of Operator Mono Light and Operator Mono Light Italic, but if we look at the actual file path, you can see that two of them should be Operator Mono Book and Operator Mono Book Italic.

This is further highlighted by the fact that if you open the two Operator Mono Light fonts, they are obviously different, and even have different names!

Operator Mono Light vs Operator Mono Book

Using something that can modify a font file, like http://www.glyphrstudio.com/online/ , I was able to modify the Operator Mono Book Regular font and give it a name of Operator Mono Boook, download it and install it onto my system:

Modified font file installed

After this, Visual Studio Code correctly detects the font... Sorta. You do need to reference the "new" font...

VS Code showing Book weight

NOTE: This method isn't perfect, as there seems to be some quality lost in the import and export of the font.

4
  • 1
    I wonder if this is due to Windows not recognising a font weight of "Book". See: docs.microsoft.com/en-us/uwp/api/windows.ui.text.fontweights Commented Sep 19, 2019 at 12:19
  • From what I can tell, it appears the chromium version on Windows does not recognize the book weight because it works in all other applications.
    – user1091624
    Commented Sep 24, 2019 at 21:08
  • Yes, I found that as well. Though I still find it strange that Windows displays both Light and Book weights as just Light, as you can see from my screenshot above. Commented Sep 24, 2019 at 21:11
  • I tested it with Sublime Text 3 without modifying any fonts and Windows displays all of the font weights correctly. I posted an answer and it really seems to be entirely a Chromium issue and how it is rendering fonts on Windows. I get a clear distinction between the light and book weights everywhere else.
    – user1091624
    Commented Sep 24, 2019 at 21:29

You must log in to answer this question.