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.
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:
It is tricky to get this stuff right, but a line-height of 1.1 is asking for trouble.
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:
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.
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.
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…
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.
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!