Skip to content

Instantly share code, notes, and snippets.

@brandondurham
Last active June 24, 2024 14:48
Show Gist options
  • Save brandondurham/3828ac42766f9f187c8e to your computer and use it in GitHub Desktop.
Save brandondurham/3828ac42766f9f187c8e to your computer and use it in GitHub Desktop.
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
* 1. UI Theme: One Dark (comes with Atom, I believe) — https://github.com/atom/one-dark-syntax
* 2. Syntax Theme: Oceanic Next — https://github.com/voronianski/oceanic-next-theme
*/
atom-workspace,
atom-text-editor {
font-family: "OperatorMonoSSm-Light";
font-size: 14px;
font-weight: normal;
line-height: 1.7;
}
atom-panel.tool-panel {
font-size: 0.88em;
}
.editor .comment,
atom-text-editor.editor .syntax--comment {
font-family: "OperatorMonoSSm-LightItalic";
font-style: normal;
}
@aendra-rininsland
Copy link

aendra-rininsland commented Apr 27, 2017

@prsnnami I got it working by installing Vibur via Sky Fonts and then adding the following to Atom's styles.less file:

.entity.other.attribute-name {
    font-family: Vibur;
    font-weight: lighter;
    font-style: italic;
}
atom-text-editor.editor {
    .syntax--entity.syntax--other.syntax--attribute-name {
        font-family: Vibur;
        font-weight: lighter;
        font-style: italic;
    }
}

@hawkins
Copy link

hawkins commented May 17, 2017

For those still looking for alternatives like Vibur, Fira Code is also a great alternative to Operator Mono, but I personally still prefer Operator Mono.

@mrclayman
Copy link

mrclayman commented Jul 1, 2017

@brandondurham, have you tried a syntax theme that uses bold face for some of the markup elements? It seems to me that Atom (and VS Code for that matter) fake the bold face instead of using the true bold face that comes with the font family. Or is it just me and my Linux machine?

@jdkschang
Copy link

Has anyone had this setup work for VS Code ?

@FossPrime
Copy link

FossPrime commented Oct 2, 2017

This worked for me in Atom 2

atom-workspace,
atom-text-editor {
    font-family: "OperatorMono-Light";
    font-weight: normal;
}

atom-panel.tool-panel {
}

.editor .comment,
atom-text-editor.editor {
    font-family: "OperatorMono-Light";
    font-style: normal;
}

.syntax--keyword, .syntax--control, .syntax--attribute-name {
  font-style: italic;
}

@iamchriswick
Copy link

The following works fine on Atom 1.21.2 on macOS Sierra

.atom/styles.less

atom-text-editor,
atom-workspace {
    font-family: "OperatorSSm-Book";
    font-size: 14px;
    font-weight: 400;
    line-height: 1.9;
}

atom-panel.tool-panel {
    font-size: 0.88em;
}

.editor .comment,
atom-text-editor.editor .syntax--comment {
    font-family: "OperatorSSm-LightItalic";
    font-style: normal;
}

.syntax--attribute-name,
.entity.other.attribute-name,
.syntax--control,
.syntax--keyword {
    font-style: italic;
}

And as @caroso1222 mentioned above:

packages/oceanic-next/styles/base.less

.entity.other.attribute-name.pseudo-class.css,
.entity.other.inherited-class,
.storage.type,
.variable.parameter {
    font-style: italic;
}

@imyxh
Copy link

imyxh commented Apr 21, 2018

@mrclayman have you tried defining a separate font for the bold variant? That's what's usually done in web design and since Atom is an electron app I would assume the same is required.

@mrclayman
Copy link

@imyxh, it was actually the font family setting in the font files themselves. Once I changed that setting through FontForge, the problem went away.

@brandondurham
Copy link
Author

@mrclayman — Yes, it depends on how the source fonts want to have their weights declared. With some, you can’t use weight like bold or 700. You have to declare each “style” individually. Hope it worked out in the end!

@mrclayman
Copy link

Indeed, @brandondurham. I use Linux, which usually uses a font configuration system called "fontconfig" that appears to rely on TTF-based weight settings. After tweaking the weight settings in the font files, everything started working beautifully. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment