windows Web 标准字体中的 Unicode 支持
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1778492/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unicode support in Web standard fonts
提问by Pekka
I need to decide whether to render geometric symbols in a web GUI (e.g. arrows and triangles for buttons, menus, etc.) as Unicode symbols (MUCH easier and color-independent) or GIF/PNG files (lots of hassle I would like to avoid).
我需要决定是将 Web GUI 中的几何符号(例如按钮、菜单等的箭头和三角形)呈现为 Unicode 符号(更容易且与颜色无关)还是 GIF/PNG 文件(我想用很多麻烦避免)。
However, I have seen clients that have trouble displaying even advanced punctuation symbols declared as unicode characters (Example).
但是,我看到客户甚至无法显示声明为 unicode 字符的高级标点符号(示例)。
Does anybody know from which version on, OSs / Service Packs / Applications ship with Unicode versions of the standard fonts? There is, for example, Microsoft's Arial unicodethat ships with Office since 1999, however I do not have office installed and still my Arial has at least some of the Unicode range.
有谁知道从哪个版本开始,操作系统/服务包/应用程序附带标准字体的 Unicode 版本?例如,自 1999 年以来,Office 就随附了Microsoft 的Arial unicode,但是我没有安装 Office,但我的 Arial 仍然至少有一些 Unicode 范围。
Also, what is the situation with Mac OS and Linux?
另外,Mac OS 和 Linux 的情况如何?
Could somebody point me towards some comprehensive resources on this - reports, lists, overviews?
有人可以向我指出一些关于此的综合资源 - 报告、列表、概述吗?
回答by bobince
There's not really such a thing as a “Unicode version” of a font(*). “Arial Unicode” is a misleading name: it's not materially different to normal “Arial”, it just has some more characters in it. It does not contain usable glyphs for every single one of the tens of thousands of characters defined so far, and indeed there is no one OS standard font that does.
真的没有字体(*) 的“Unicode 版本”这样的东西。“Arial Unicode”是一个误导性的名称:它与普通的“Arial”没有实质性的不同,只是里面多了一些字符。它不包含迄今为止定义的数万个字符中的每一个的可用字形,而且确实没有一种操作系统标准字体可以。
The significant question is merely whether the characters you want to use have glyphs in the default fonts of commonly-deployed operating systems. You need to look to look at font support for particular characters you wish to use on an individual basis.
重要的问题仅仅是您要使用的字符是否在常用操作系统的默认字体中具有字形。您需要查看您希望单独使用的特定字符的字体支持。
The character U+0360 Combining Double Tilde you mentioned is not really ‘advanced punctuation', it's an curious and rarely-used diacritical mark for phonetics work. So it's not really surprising that font support for it is poor. On the other hand, Stack Overflow can get away with using U+25CF Black Circle (●) because lots of fonts have it. Some of the other characters from the Geometric Shapes block such as U+25B2 Black Up-pointing Triangle (▲) are also pretty common.
您提到的字符 U+0360 组合双波浪号并不是真正的“高级标点符号”,它是语音工作中一个奇怪且很少使用的变音符号。所以它的字体支持很差也就不足为奇了。另一方面,Stack Overflow 可以避免使用 U+25CF Black Circle (●),因为很多字体都有它。几何形状块中的其他一些字符,例如 U+25B2 黑色上指三角形 (▲) 也很常见。
fileformat.info has a list of common fonts that support each character, so you can check there to get a feel of how widely supported a symbol is, and whether the default OS fonts you recognise are present, before using it as a replacement for an image. For example U+25CFis in many fonts, but U+0360isn't that well-supported: none of the default Windows install fonts are there, and the ‘Libertine' font renders it badly wrong.
fileformat.info 有一个支持每个字符的常用字体列表,因此您可以查看该列表以了解某个符号的支持程度,以及您识别的默认操作系统字体是否存在,然后再使用它来替代图片。例如,U+25CF有很多字体,但U+0360并没有得到很好的支持:默认的 Windows 安装字体都不存在,而“Libertine”字体使其严重错误。
(*: OK, there is sort of such a thing as a Unicode font, in that a font's internal character lookup tables may be denominated in Unicode or some other character set. However this makes no practical difference as the application will always be addressing it as Unicode; the OS will do the conversion on lookup transparently.)
(*: 好的,有一种像 Unicode 字体这样的东西,因为字体的内部字符查找表可能以 Unicode 或其他一些字符集命名。但是这没有实际区别,因为应用程序将始终对其进行寻址作为 Unicode;操作系统将在查找时透明地进行转换。)
回答by devio
This question may be a duplicate of Unicode and fontswhere I posted a list of unicode font links:
这个问题可能是Unicode 和字体的副本,我在其中发布了 unicode 字体链接列表:
http://en.wikipedia.org/wiki/Category%3AFree%5Fsoftware%5FUnicode%5Ftypefaces
http://en.wikipedia.org/wiki/Category%3AFree%5Fsoftware%5FUnicode%5Ftypefaces
http://en.wikipedia.org/wiki/Unicode%5Ftypefaces
http://en.wikipedia.org/wiki/Unicode%5Ftypefaces
http://unifoundry.com/unifont.html
http://unifoundry.com/unifont.html
http://www.fileformat.info/info/unicode/font/index.htm
http://www.fileformat.info/info/unicode/font/index.htm
http://www.alanwood.net/unicode/fontsbyrange.html
http://www.alanwood.net/unicode/fontsbyrange.html
http://www.alanwood.net/unicode/fonts.html
http://www.alanwood.net/unicode/fonts.html
http://www.unifont.org/fontguide/
http://www.unifont.org/fontguide/
However, I am not sure how the Unicode standard defines how to render a stand-alone COMBINING DOUBLE character, as it is supposed to combineother characters.
但是,我不确定 Unicode 标准如何定义如何呈现独立的 COMBINING DOUBLE 字符,因为它应该组合其他字符。
回答by zoul
Some random observations:
一些随机观察:
- On OS?X the Unicode support is perfect, at least for your needs.
- On Windows the situation seems to depend on the browser. I don't use many arcane characters, but the few I do (mostly punctuation) seem to display just fine in Firefox. The only problem is in Internet Explorer, as usual.
- If you have some control over your clients you could distribute some good free fonts?
- Even web fontscould work.
- One drawback to Unicode charactes is that they are often quite ugly. Too big, too small, have wrong position, etc.