Why Does IntelliJ Show ‘≠’ Instead of ‘!=’? Unlock the Font Ligatures Switch
Discover how IntelliJ IDEA’s Font Ligatures feature can transform the standard ‘!=’ operator into the mathematical ‘≠’ symbol, how to toggle this setting via Reader Mode, and why disabling it may improve code readability, with visual examples and a Java code demo.
Strange Not Equal (≠)
While browsing source code in IntelliJ IDEA, the author noticed that the usual "!=" operator appeared as the mathematical "≠" symbol.
At first it seemed like a visual glitch, but the cause is the Font Ligatures setting.
Preferences > Editor > Reader Mode > Font ligatures
Reader Mode is a read‑only editor mode, and enabling Font ligatures allows certain character combinations to be rendered as a single glyph. Thus "!=" is displayed as "≠".
Turning off this switch restores the normal appearance of the source code.
Ligatures Extension
The same effect can be achieved in other editor settings that control Font ligatures.
Preferences > Editor > Font > Enable font ligatures
After enabling the option, the author wrote a small Java test program to verify the behavior.
The test code demonstrates that both "!=" and ">=" are rendered with their ligature symbols when the switch is on, and revert to the standard characters when it is off.
<code>public class Test {
public static void main(String[] args) {
int n = 1;
if (n != 0) {
System.out.println(1);
}
if (n >= 1) {
System.out.println(2);
}
}
}
</code>Even though the editor shows the ligature symbols, copying the code yields the original, syntactically correct Java source.
Summary
The author shares the discovery of IntelliJ IDEA’s Font Ligatures switch, notes that it can be confusing, and ultimately prefers to keep the option disabled to avoid visual ambiguity, though some developers may appreciate the feature.
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.