Template talk:Char

Latest comment: 10 months ago by Synpath in topic En vs Em space behaviour

En vs Em space behaviour edit

Came here from Em (typography) where the em space in the {{char}} template is noticeably shorter than the em dash, which I thought was a typo, but apparently not, see:

En space: Em space:
En dash : Em dash :

Reading the template doc I see that the {{angbr}} template is recommended, but it suffers from the same thing:

En space: ⟨ ⟩ Em space: ⟨ ⟩

A table for comparison with other whitespace

Template Char Angbr
Em space ⟨ ⟩
En space ⟨ ⟩
nb space   ⟨ ⟩
thin space ⟨ ⟩
hair space ⟨ ⟩

What's going on here? It feels like I'm not understanding something basic. ― Synpath 22:49, 30 June 2023 (UTC)Reply

Strange... The only function of the char template is to surround the character in a one-pixel frame and apply a very faint grey background: "border: 1px solid #ddd; background-color: #fdfdfd; padding: 1px 1px;" Since {{angbr}} is doing the same thing, it can't be an obvious template error.
Maybe someone at Wikipedia:Village pump (technical) can throw some light on it? --𝕁𝕄𝔽 (talk) 22:59, 30 June 2023 (UTC)Reply
I should have been more careful - I accidentally added normal spaces to the templates which made things look weirder. That being said em and en spaces are rendered as the same width on my browser (Firefox) and Chrome as well. I've been trying to find an answer online and it seems like this is something that is font dependent? ― Synpath 00:10, 1 July 2023 (UTC)Reply
It's something going on in your browser. Viewing this on my system in Firefox, the em space and em dash are indistinguishable in terms of advance width, and are double the width of the en space and en dash at a glance. VanIsaac, GHTV contWpWS 03:25, 1 July 2023 (UTC)Reply
Definitely a problem on my end. I opened this up on mobile and it looks as expected as well. Thanks for your replies. ― Synpath 17:06, 1 July 2023 (UTC)Reply