tonsky / tonsky/FiraCode

[Windows, LoDPI, OTF, some font sizes] Weird dot placement over "i" and "j"

Open
#693 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
82k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

On Windows in Java-based apps for bold font variant I get weird placement for dots over "i" and "j".

It is easier to spot in Java-based applications due to specific font sizing, bug it looks like actually every program is susceptible to this.

  1. Install OTF Fira Code fonts on Windows
  2. Make sure you have a LoDPI display (e.g. Windows font scale = 100%)
  3. Execute the following Java program:
import javax.swing.*;
import java.awt.*;

public class Main {
    private static void createAndShowGUI() {
        JLabel label = new JLabel("AggressiveInlining ijij ijij");
        label.setFont(new Font("Fira Code", Font.BOLD, 14));

        JFrame frame = new JFrame("Fira Code Demonstration Program");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.getContentPane().add(label);

        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}

Check how dots over "i" and "j" are weirdly placed (looks like they've been moved to the right):

image

Other font sizes (e.g. 13 or 15) usually work okay, but e.g. for 16 it looks like dots are moved to the left:

image

I'm not sure if it's Fira Code issue or not, but looks like dots placement works strange not only for Java programs. E.g. compare these two screenshots from Visual Studio (which works better in that aspect but still not ideal):

image

image

Looks like the dot is misplaced to the left for size = 12.

I wasn't able to reproduce the issue with TTF fonts or on a retina display. So, for now the best advice for users who have the issue is to switch to TTF variant of Fira Code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Java Swing program on Windows with the OTF font at sizes 14 and 16, then compare the TTF variant and a retina display as described. Investigate whether the misplaced dots originate in Fira Code or the rendering environment; done means the bold OTF glyphs render i and j dots consistently at the affected sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics, desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.