Clock separator renders incorrectly under GNOME 3.38 on Arch Linux with Ubuntu font

I recently switched to Arch Linux from Ubuntu, and so to ease the switch, I've installed the GTK themes used by Ubuntu and switched to the Ubuntu font family across the system. However, there is a minor flaw with the clocks in the GNOME interface, such that all of the colons : are replaced with tricolons , which is starting to bother me a lot.

Clock at top of screen

Lock screen clock

Clocks app

Could this possibly be caused by an improperly set locale setting, or is this likely a bug that I need to file on GNOME?

Edit 1: I installed the Ubuntu font family from ttf-ubuntu-font-family in the Arch repos.


Solution 1:

Well, this question sounded interesting to me so I did some digging...

Here is the gnome-clocks source code. From world-item.vala:

public string time_label {
    owned get {
        return Utils.WallClock.get_default ().format_time (date_time);
    }
}

Ok. From Utils.vala:

public string format_time (GLib.DateTime date_time) {
    string time = date_time.format (format == Format.TWELVE ? "%I:%M %p" : "%H:%M");

    // Replace ":" with ratio, space with thin-space, and prepend LTR marker
    // to force direction. Replacement is done afterward because date_time.format
    // may fail with utf8 chars in some locales
    time = time.replace (":", "\xE2\x80\x8E\xE2\x88\xB6");

    if (format == Format.TWELVE) {
        time = time.replace (" ", "\xE2\x80\x89");
    }

    return time;
}

Seems weird to me personally, but alright, : is replaced by "\xE2\x80\x8E\xE2\x88\xB6".

I ran this on my system: $ echo -e "\xE2\x80\x8E\xE2\x88\xB6" and got:

Run it on yours and see what you get.

According to this website, the above sequence also converts to :. But what is :? Copy it from the website and paste it here. Result:

U+200E : LEFT-TO-RIGHT MARK [LRM]
U+2236 : RATIO

And now it's up to you to find out whether your font prints RATIO as a tricolon or if your locale is messed up and UTF-8 is handled incorrectly. I'm not on GNOME right now but I think you can enter U+2236 in the global GNOME search to look it up and copy it. If it results in a tricolon then I'd suggest to change your font and try again, if it results in a colon then it's definitely your font, if not most likely your locale/UTF-8 setup.

Edit: In any textbox (e.g. the search on superuser) press CTRL+SHIFT+u, then enter 2236 and press enter. If it's a tricolon I'd blame your font.

Edit2: I found an ubuntu font tester online and did the above mentioned key-combo on it. It results in a normal : colon for me. I double-checked, it is the RATIO character...

Can you please do me a favor and run the following command: fc-match "∶" - Make sure to copy it as the colon (tricolon?) is the RATIO character. If it outputs the right (ubuntu) font then either that ubuntu font test website is wrong or drunk me is out of ideas...

Edit3: Another easy way to check if it's the font or not: If the above echo command's result gives you a tricolon, try changing the terminal font and see if it becomes a colon. If you do get a colon on first try, change the font of the terminal to the same as the system font and see if it becomes a tricolon...

Edit4: Trying the Ubuntu font here with the u+2236 character shows that indeed the Ubuntu font doesn't even contain the ratio symbol, so whichever font your system falls back to causes this issue.