In title bar, Ñ, Ằ, ขึ้น and similar diacriticals are clipped in Linux

AI-generated summary

Issue: In the title bar, diacritical marks such as Ñ, Ằ, and ขึ้น are clipped in Linux.

Discussion:

  • sujato reported the issue, which is caused by insufficient line spacing in the title bar.
  • codinghorror suggested that the issue might be platform-specific, but sujato provided screenshots showing the issue in both Linux and Mac.
  • Bas shared a comparison of the characters with and without clipping.
  • sujato noted that the issue affects not only Linux but also Mac and some Windows configurations.
  • codinghorror initially suggested that the issue was not a bug, but rather a CSS issue that could be adjusted by individual users.
  • sam proposed a CSS fix by setting overflow: visible on the .extra-info-wrapper element, but sujato noted that this fix was only partial and did not work consistently.
  • gerhard shared screenshots showing the issue in Windows and Mac, and sujato requested a screenshot from codinghorror to confirm the issue in Windows.
  • sujato suggested that a theme or option for tall scripts might be useful to address this issue.

Solution:

  • Johani proposed a simpler solution by reducing the font size of the title text using CSS: font-size: 90%. This solution was tested and confirmed to work by sujato.

In many languages, Thai and Vietnamese being examples, multiple marks may be added above letters. Normally extra line-spacing is incorporated to allow for this. The main heading in the title bar has line-spacing of 1.1em, which is not enough, so such marks get clipped. I’ve even seen plain ol’ apostrophes get clipped.

This will vary depending on font, so may not show up for everyone. But it’s good practice to leave plenty of headroom, especially in the title.

Clipped where? The title isn’t clipped for me at all in Windows / Chrome.

Maybe indicate platform and browser, with cropped screenshot.

Sure, it’s Chromium 59, Ubuntu 17.04. I just checked and the same problem appears in Firefox, too. I have also tried a couple of different fonts, same deal. Here’s a screenshot using Source Sans Pro, with Loma (system default) for Thai.

I was originally referring to the top bar when contracted. But the same issue is showing up in the regular view, which is what you see above. Here’s the same problem in the title bar when contracted:

Screenshot from 2017-08-02 18-21-24

It is tricky to get this stuff right, but a line-height of 1.1 is asking for trouble.

Just to be complete, here are the characters unclipped: Ñ, Ằ, ขึ้น

This is how it renders for me (Safari, Mac)

Compared to the screenshot, they indeed have more ‘stuff’ above the characters.

Thanks. This is even worse than mine: the second diacritcals in mine are at least visible, even if badly clipped, but here they are gone entirely.

This is the kind of thing you can adjust with CSS @sujato so this is not a bug.

Okay, well, can’t say i’m happy, but anyway, thanks for looking at the problem. If I get the chance I’ll see if I can make a CSS fix and post it here.

.extra-info-wrapper has overflow: hidden. Changing it to:

.extra-info-wrapper {
   overflow: visible; 
}

Fixes this but may result in other edge cases, @awesomerobot should we change this so we allow bleed out of bounding box by default?

1 curtida

Historically that kind of change has caused problems later down the line.. I think it is better for sites that need this, to adjust their CSS.

Thanks for trying, Sam, but this is only a partial fix for me. I am applying the CSS here on meta. It works inconsistently, and only for the regular title, not when it’s contracted into the title bar

After considerable playing around, what works for me is:

.extra-info-wrapper,
.extra-info-wrapper .topic-link,
#topic-title h1 {
     overflow: visible;
}

Why repeat .extra-info-wrapper and .extra-info-wrapper .topic-link? I wish I knew: but that’s the only way I could get it to work.

This will potentially affect users in most Indic languages, Thai, Vietnamese, and languages using Arabic script: that’s a couple of billion people right there. The Ñ is of course in Spanish, too, so you can do the math.

It seems to me that failure to properly display characters in titles for scripts used by billions of people is, in fact, a bug, and one deserving of a little love.

4 curtidas

They display properly in my browser in Windows. How many people run Linux on the desktop? Billions? Maybe dial down the hysteria a notch.

1 curtida

That’s strange. I see a difference on Windows 10 and Chrome 60.

Without overflow: visible:
image

With overflow: visible:
image

But, yeah, there’s no reason for hysteria :wink:

2 curtidas

Can you share a screenshot in Windows? We’ve seen issues in Linux and Mac, and at least some Windows, as per Gerhard. And we haven’t so far as I know, even looked at mobile.

Oh, I see, it looks fine in Chrome on Windows as long as you don’t scroll down in the topic. If you scroll and the title gets moved into the header it looks like my screenshots. Same behavior on iPad (iOS 10).

There’s no problem on my mobile (Android 7), since the title is hidden when you scroll down.

1 curtida

I just changed the title to make it easier to test in mobile, so the tall characters don’t get hidden when the title is shortened.

And just to confirm, in the regular view, the diacriticals in the title aren’t clipped?

I’ve checked in the Chrome browser emulator, and it shows the clipping in all different devices; but I don’t know how accurate they are when it comes to these kinds of deatils.

There’s definitely no problem on Android 7 and Chrome on my mobile, because the title bar is hidden when you scroll down.

I have no Android tablet, so I can’t say for sure, but I think it will be the same problem as on Windows and iOS. At least my test on mobile with Desktop mode enabled shows the same behavior…

Thanks for that.

Please forgive me if I’m being obtuse, I am not used to developing Discourse, and am just an ordinary user. But I’m still not completely clear when you say:

For me, the diacriticals are clipped both when you’re right at the top, so that the title appears in the post body, and when you’ve scrolled down, and the title goes into the header or title bar. I understand that the latter is not an issue for you on mobile, but I am still unclear about the former.

1 curtida

Cool, thanks so much. So it looks like the CSS adjustment applied to desktop will solve the issue. It doesn’t seem to create any problems.

I wouldn’t go so far. The fix needs to be tested on multiple platforms. And there probably was a good reason for using overflow: hidden in the first place. So, let’s wait for a response from @awesomerobot.

But, if the CSS works for you, go ahead and use it!