6

I’m trying to use a reasonably esoteric Unicode character on a website — specifically “︙”. Windows XP, as far as I know, didn’t ship with a font that included a glyph for this character — the Virtual PC IE 6 test image doesn’t display it at any rate.

Is there any way I can detect whether the character is displaying properly, in case people are looking at the site using Windows XP without Arial Unicode MS installed?

An answer on a similar question suggested comparing the width of an element containing just this character with the width of an element containing an unprintable Unicode character. Unfortunately, both seem to render at the same width in browsers that display my character properly as well.

Community
  • 1
  • 1
Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
  • 1
    What are you using this character for? Also, have you tried ⋮ (U+8942) which seems to be an alternate character for the same thing? – Will Martin Jun 09 '11 at 04:42
  • @Will: holy moly, I think you’ve cracked it. Lucida Sans Unicode (which was included with Windows XP) has a glyph for that character. If you put that in as an answer, upvotes and acceptances will flow towards you like spring water down a mountainside. – Paul D. Waite Jun 09 '11 at 08:45
  • @Will: oh yes, and I’m using it like this: `` to indicate a range between two things. The design calls for a vertical character, because the things are positioned above and below the ⋮. – Paul D. Waite Jun 09 '11 at 08:47
  • 1
    In case anyone stumble here nowdays, I recommend considering actual three dots ... and rotate them using css; Something like that `#mydots{transform:rotate(90deg);}` would work on IE10+ an all non-ie browsers. For IE9 support add `-ms-transform`. – oriadam Mar 15 '16 at 13:32
  • 1
    [Detecting individual Unicode character support with JavaScript](https://stackoverflow.com/q/1911000/995714) – phuclv Jul 04 '18 at 15:38

4 Answers4

2

Try using ⋮ (⋮), which is an alternate character for the same thing (a vertical ellipsis). I'm not sure why there are two glyphs for this, and they are slightly different; in my own testing, ︙ (︙) uses circles for the dots, while the other one uses squares. That probably varies by font though. And anyway, you have to increase the font size to ridiculous sizes to notice a difference.

Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
Will Martin
  • 4,142
  • 1
  • 27
  • 38
  • That’s the stuff: Lucida Sans Unicode, which was included with Windows XP, displays the character you suggest. To my eyes it’s not *quite* as nice as the other one, but in order to be more confident that it’ll actually work, I’ll very happily go with it. – Paul D. Waite Jun 10 '11 at 09:11
  • 4
    There are two code points because they have two separate meanings. U+22EE (`⋮` as a character reference) is a vertical ellipsis, which is a mathematical operator. U+FE19 is a normal horizontal ellipsis, meaning a trailing-off or pause, that is being written rotated by 90 degrees because it is part of East Asian vertically-arranged text. – bobince Jun 11 '11 at 11:07
  • 3
    U+FE19 is a ‘compatibility character’, only present in order to ensure that text can round-trip to the GB-18030 encoding, and in fact the normal horizontal ellipsis character U+2026 `…` is a compatibility character too. In modern Unicode one is expected to just write three dots instead and let the font and text processor work out whether it needs to be arranged vertically or kerned. (That doesn't really happen much yet, though.) – bobince Jun 11 '11 at 11:09
0

What you are trying to do is virtually impossible, at least not in a safe way.

Instead you should clearly define your supported audience, specifying exactly what browsers you will support and for unsupported ones display an warning.

BTW, Do not display the warning for any browser that it was not identified by you, just for the that were identified as bad.

You could add an embedded font but this will work only on some browsers and probably not on mobile devices. I wouldn't recommend you to use such esoteric characters.

One idea http://www.devslide.com/labs/browser-detection

NOTE: in the text above, I refer to a browser as a combination of browser and operating system. Today most browsers do properly display Unicode characters, BUT the fonts do not, and the user will see boxes instead of correct characters. A well designed web page must render properly with the default fonts existing on the client computer.

sorin
  • 161,544
  • 178
  • 535
  • 806
  • 3
    This isn’t a browser issue though. It’s a font issue. All modern browsers are absolutely fine with Unicode, including IE 6. Unicode is not exotic. It is not unreliable. It is everywhere, and for the most part, it works fine. The issue is that Windows XP did not ship with a font that includes most Unicode characters. – Paul D. Waite Jun 08 '11 at 23:06
  • And, as oddy’s link shows, embedded fonts are pretty well-supported too. – Paul D. Waite Jun 08 '11 at 23:08
  • @sorin: “Today most browsers do properly display Unicode characters, BUT the fonts do not” — depends on your definition of “Today”. Mac OS X came out in 2000; Vista came out in 2006, and they both work fine out of the box. At some point, it becomes fine to stop supporting old clients. I could just do that. Instead, I’m trying to find a way to detect their lack of support. I think that’s a more reasonable approach than limiting all websites to only use what’s supported out-of-the-box on a 10-year-old operating system. – Paul D. Waite Jun 09 '11 at 08:41
  • Shorty: you cannot rely on character size in order to determine if a browser can display properly a character or not - It is just too risky. – sorin Jun 09 '11 at 10:37
  • @sorin: possibly (it’s not like anyone’s going to die if it goes wrong). I do see your point though. I think testing with specific fonts is important. One could maybe test for the presence of Windows XP. – Paul D. Waite Jun 09 '11 at 10:58
0

Use an embeded font. You have to have 4 versions or so of the font file around for it to work in all browsers, but it works in IE6 Up and all modern browsers, including iOS mobile devices..

http://www.fontsquirrel.com/fontface/generator

You can upload a TTF font and get the whole package back as a download - all the font files needed and the CSS plus a sample page to test with. I have not found a browser that this will not work in (including 1-2 version back from current, depending on the browser).

Justin808
  • 20,859
  • 46
  • 160
  • 265
  • Sure, it just seems a bit much to ask every user to download a font just because Windows XP can’t render this character in its default state. Do Font Squirrel let you customise the font to just include, say, one glyph? – Paul D. Waite Jun 09 '11 at 08:42
  • 1
    I know it have some customization (include all unicode or just standard characters.) The resulting fonts are relatively small, its best to think of it as you would a custom image for a site. It gets cached as well so its only downloaded once. The benefit of this method is you now that the font (in your case single glyph) will look the same is all browsers across all operating systems. At least as close as you can get, some browsers use different font rendering engines than others which cause small differences. – Justin808 Jun 09 '11 at 08:53
  • there is that benefit. In my case, I think I’ll only be using one Unicode character for the whole site, so I think I’ll go with a different solution. If I was using a few though, a custom font would be well worth it. (At least whilst Windows XP still stalks the internet like a retarded zombie.) – Paul D. Waite Jun 09 '11 at 09:28
-1

I am not sure you need to worry about this... according to the Microsoft site, Arial Unicode MS is automatically installed for Windows XP.

http://office.microsoft.com/en-us/visio-help/install-the-universal-font-for-unicode-HP005255840.aspx

Jason Gennaro
  • 34,535
  • 8
  • 65
  • 86
  • 1
    I have XP and Arial Unicode MS. I just checked Character Map, though, and it doesn't have a glyph for U+FE19. – Will Martin Jun 09 '11 at 04:30
  • @Will: does it not? Crikey. It’s got 50,000 glyphs! – Paul D. Waite Jun 09 '11 at 08:41
  • 1
    ah, I think that page means that Microsoft *Office* will install Arial Unicode MS automatically *if* it’s installed on Windows XP. I don’t think Arial Unicode MS came with the stock Windows XP though. – Paul D. Waite Jun 09 '11 at 08:44