Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OK, this is odd. It looks like something browser dependent is going on.

You earlier comment shows up with thin spaces on Chrome for me, but not on Safari or Firefox.

I know Firefox handles thin spaces, because it handles this Reddit comment just fine: https://www.reddit.com/r/Physics/comments/67g28i/because_gra...

I'm going to paste the examples from there here and see what happens:

1​234​567 (U+200B, ZERO WIDTH SPACE)

1 234 567 (U+200A, HAIR SPACE)

1 234 567 (U+202F, NARROW NO-BREAK SPACE)

1 234 567 (U+2009, THIN SPACE)

1 234 567 (U+2006, SIX-PER-EM SPACE)

1 234 567 (U+2008, PUNCTUATION SPACE)

1 234 567 (U+2005, FOUR-PER-EM SPACE)

1 234 567 (U+2004, THREE-PER-EM SPACE)

1 234 567 (U+0020, SPACE)

1 234 567 (U+2000, EN QUAD)

1 234 567 (U+2002, EN SPACE)

1 234 567 (U+2007, FIGURE SPACE)

1 234 567 (U+2003, EM SPACE)

1 234 567 (U+2001, EM QUAD)

Edit: they displayed with the various different space sizes in Chrome, and with fixed space sizes in Firefox (1 regular space for all except 200B and 202F which showed up with no space).

Unlike Reddit, editing does not lose information.

Also displays right in Edge, and in Firefox on Windows. So it looks like it is just Firefox Mac and Safari that are not handling the various space sizes for me.



Looks good with Firefox on Linux too.

Given chrismorgan's comment about breaking, it seems that NARROW NO-BREAK SPACE would be a better choice for digit grouping, right?


Yeah, NARROW NO-BREAK SPACE is probably better.

As far as the display problem on Firefox and Safari on Mac goes, I've done some experimenting. It looks like it is a font thing. HN has "font-family:Verdana, Geneva, sans-serif;" as part of the style sheet.

I made a minimal test page with just the different space examples, and an internal style sheet that just set the font-family for the body, and it shows the problem. Changing it to "Arial, sans-serif" makes it work.

I've never looked seriously into fonts for browsers, so have no idea what is going on at this point. If there is a problem with the Mac versions of Verdana and/or Geneva, then why is it only affecting Firefox and Safari, and not Chrome, on my Mac?

If anyone else wants to try to figure this out, here is the test page I've been using:

  <!DOCTYPE html>
  <head>
      <meta charset="utf-8"/>
      <title>space test</title>
      <style>
          body { font-family:Verdana, Geneva, sans-serif; }
          xbody { font-family:sans-serif;}
          xbody { font-family:Arial, sans-serif;}
      </style>
      
  </head>
  <body>
  <p>
  1&#x200B;234&#x200B;567 (U+200B, ZERO WIDTH SPACE)<br/>
  1&#x200A;234&#x200A;567 (U+200A, HAIR SPACE)<br/>
  1&#x202F;234&#x202F;567 (U+202F, NARROW NO-BREAK SPACE<br/>
  1&#x2009;234&#x2009;567 (U+2009, THIN SPACE)<br/>
  1&#x2006;234&#x2006;567 (U+2006, SIX-PER-EM SPACE)<br/>
  1&#x2008;234&#x2008;567 (U+2008, PUNCTUATION SPACE)<br/>
  1&#x2005;234&#x2005;567 (U+2005, FOUR-PER-EM SPACE)<br/>
  1&#x2004;234&#x2004;567 (U+2004, THREE-PER-EM SPACE)<br/>
  1&#x0020;234&#x0020;567 (U+0020, SPACE)<br/>
  1&#x2000;234&#x2000;567 (U+2000, EN QUAD)<br/>
  1&#x2002;234&#x2002;567 (U+2002, EN SPACE)<br/>
  1&#x2007;234&#x2007;567 (U+2007, FIGURE SPACE)<br/>
  1&#x2003;234&#x2003;567 (U+2003, EM SPACE)<br/>
  1&#x2001;234&#x2001;567 (U+2001, EM QUAD)  </p>
  </p>
  </body>


It’s common for fonts to not include glyphs for all the fancy spaces, which will leave it to a fallback mechanism where a different font is used.

It’s also common for web fonts especially to possess glyphs for some of the fancier spaces, but as duplicates of SPACE, i.e. the wrong size.

Face it: fonts (to a degree the technology, but mostly the actual fonts) are generally pretty bad.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: