views:

197

answers:

3

Is it possible to detect if the client supports a particular Unicode character or if it will be rendered as a missing glyph box?

Important: Support in as many browsers as possible

Not important: Efficiency, speed, or elegance

The only method I can think of trying is using a canvas, so I figured I'd ask before I start going down that road.

Thanks!

Edit: This is not intended for use on a public web site; I am just trying to compile a list of characters supported by each browser.

A: 

If you want to maximize browser support, you probably don't want to rely on javascript for anything. Many mobile browsers don't even support it.

If the browser does not support a char set, what is the fall back? Displaying the content in another language? Perhaps links one the site that switch languages on demand would be more robust.

Chase Seibert
I am trying to compile a list of characters supported by each browser, not maximize support for a public page.
i-g
A: 

Since efficiency and speed do not matter, save yourself the trouble and use an image of the character instead of an HTML entity.

Josh Stodola
Thanks for answering, but this is not what I'm looking for.
i-g
+2  A: 

This is more of a wild idea than a real answer:

If you could find a character which you knew would always render as a missing glyph box, you could use the same technique as this javascript font detector--render the character and the missing glyph box offscreen and compare their widths. If they're different, then you know the character is not rendering as a missing glyph box. Of course, this won't work at all for fixed-width fonts, and it could have a lot of fixed negatives for other fonts where a lot of the characters are the same width.

Annie
Thank you! This helps a lot. Of course, it won't work for any characters that are the same width and height as a missing glyph box, but it's a step in the right direction.
i-g
this will not work for every character, but if you raise the font size you should get good results. I still like this answer... some kind of wierd but could it could work :-)
Hippo
@Hippo - that's a good point: since the fonts are rendered off screen you could make them really really huge.
Annie