Ligature not properly right-justified

Hi,

The is a justification issue with ligature (I assume), the code below show it:

   void paintOverChildren(Graphics &g) override {
        g.setFont(FontOptions{20.f});

        g.setColour(Colours::white);
        int h = 30, y = 40;
        auto r = getLocalBounds().withWidth(0.9*getWidth());
        g.drawText("f", r.withY(y), Justification::topRight); y += h;
        g.drawText("ff", r.withY(y), Justification::topRight); y += h;
        g.drawText("fff", r.withY(y), Justification::topRight); y += h;
        g.drawText("ffff", r.withY(y), Justification::topRight); y += h;
        g.drawText("fffff", r.withY(y), Justification::topRight); y += h;
        g.drawText("x", r.withY(y), Justification::topRight); y += h;
        g.drawText("xx", r.withY(y), Justification::topRight); y += h;
        g.drawText("xxx", r.withY(y), Justification::topRight); y += h;
        g.drawText("xxxx", r.withY(y), Justification::topRight); y += h;
        g.drawText("xxxxx", r.withY(y), Justification::topRight); y += h;
    }

When there is an even number of β€˜f’ in the right-justified string, the last β€˜f’ sticks out.

I have tested on macOS, with latest juce develop branch.

A proper fix would be better, but does anyone has an idea for a workaround ?

Disable ligature rendering somehow or remove all ligatures from your font using FontForge?

Yep. I had to edit out a problematic ligature from the font I use. No need to do all of them. It’s not that difficult to figure out with FontForge.

We know about this and are working on a fix :slight_smile:

1 Like

This should be fixed here:

2 Likes