我应该为最新的Unicode字符使用哪种字体? [英] Which font should I use for the newest Unicode characters?

查看:144
本文介绍了我应该为最新的Unicode字符使用哪种字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注:他们不是新的。只是不支持,不知何故。

我试图做一个简单的控制我的网站上的一个元素,沿着简单的哑巴或not mute控件。

但是,我还没有找到任何能够处理新的Unicode符号的字体,例如扬声器符号(&# x1F507 &#x1F50A; &#128263; 到<$即使在堆栈溢出时也是如此(&#128266; ),它们被破坏了(&#x1F507;&#x1F508;&#x1F509;&#x1F50A; http://www.unicode.org/charts/PDF/U1F300.pdf =nofollow noreferrer>可以在Unicode字符列表中找到它们,并以某种方式显示在我的PDF阅读器中和Internet Explorer,但不是Chrome。



这是第一段(上面),从我的角度来看,中断了字符:






无论如何,这是我的snippit的代码。 (为了测试目的,视频控件是纯视图)。实际的元素有一个 z-index:-1000 附加到它;用作视频背景。



function mute(){document.getElementById( jsControl)。setAttribute(href,javascript:unmute()); document.getElementById(jsControl)。innerHTML =&#x1F508;; document.getElementById(videoPlayer)。volume = 0.0}; function unmute(){document.getElementById(jsControl)。setAttribute(href,javascript:mute()); document.getElementById(jsControl)。innerHTML =&#x1F50A;; document.getElementById(videoPlayer).volume = 1.0};

< HTML> < HEAD> <风格> body {font-family:[插入字体名称和尝试]; }< / style> < /头> <身体GT; < video id =videoPlayersrc =...>< / video> < a id =jsControlhref =javascript:unmute()>&#x1F508;< / a> < / body>< / html>

尝试了不同的Web安全字体,如Arial,Times New Roman和Tahoma以及Sergoe UI。




是否有任何字体可以用来支持那些在Chrome上运行的unicode字符?

(即使是将这些字体重新映射到Wingdings将被接受,因为它们可以使用 @ font-face {...} 来附加。)



另外,请不要抱怨JavaScript坏了(如果写得不正确) - 我可以自己修复。这是字体;文本(缺少符号),我很担心。



更新:在Internet Explorer中查看图标工作正常。似乎是Chrome浏览器和/或其他浏览器的问题。

解决方案

由于您只需使用几个符号在特殊的情况下,而不是文本字符,实际的选择是使用图像。



然而,如果你真的想使用字符,有一个非常有限的设置的字体考虑。根据 fileformat.info ,U + 1F507仅支持Quivira,Symbola,Segoe UI Symbol和Segoe UI表情符号。后两者是专有字体,仅在Windows的相对新版本中可用,并且作为不同的变体(例如,我的Windows 7缺少Segoe UI表情符号,并且有Segoe UI符号缺少该字符的变体)。



因此,合理工作的唯一方法是通过 @ font-face 使用Quivira或Symbola作为可下载的字体。由于它们字体相当大,而且您需要以不同的字体格式为跨浏览器功能提供服务,所以这种方法几乎不是一个实际的选择(除非您有许多其他特殊字符,可能在文本中使用,也需要这种特殊字体)。


Note: They aren't new. Just "not supported", somehow.

I'm trying to make simple controls for a element on my website, along the lines of a simple "mute" or "not mute" control.
However, I haven't been able to find any fonts capable of handling the newer Unicode symbols, such as the speaker symbols (&#x1F507 to &#x1F50A;, or &#128263; to &#128266;) which are broken (🔇 🔈 🔉 🔊) even on Stack Overflow, yet still - They can be found in the Unicode character listings and are somehow able to be displayed in my PDF reader and Internet Explorer, but not Chrome.

This is the first paragraph (above), from my perspective, with the characters broken:


Anyway, here's my snippit of the code. (The video controls are in plain view for testing purposes). The actual element has a z-index: -1000 attached to it; used as a video background.

function mute() {
  document.getElementById("jsControl").setAttribute ("href", "javascript:unmute()");
  document.getElementById("jsControl").innerHTML = "&#x1F508;";
  document.getElementById("videoPlayer").volume = 0.0
  };

function unmute() {
  document.getElementById("jsControl").setAttribute ("href", "javascript:mute()");
  document.getElementById("jsControl").innerHTML = "&#x1F50A;";
  document.getElementById("videoPlayer").volume = 1.0
  };

<html>
  <head>
    <style>
        body {
            font-family: [Insert font names and attempts];
        }
    </style>
  </head>
  <body>
    <video id="videoPlayer" src="..."></video>
    <a id="jsControl" href="javascript:unmute()">&#x1F508;</a>
  </body>
</html>

I've tried different web-safe fonts, such as Arial, Times New Roman and Tahoma and Sergoe UI.


Question: Is there any font that can be used that supports those unicode characters that works on Chrome?
(Even a font that has these remapped onto regular letters like Wingdings will be accepted as they can be attached using @font-face { ... }.)

Also, please don't complain about the broken Javascript (if it is not written correctly) - I can fix that myself. It's the font; text (missing symbols) that I'm worried about.

Update: Viewing the icons in Internet Explorer works fine. Seems to be a chrome-and/or-other-browser sort of issue.

解决方案

Since you would use just a few symbols in a special context, rather than as text characters, the practical choice is to use images.

However, if you really want to use characters, there is a very limited set of fonts to consider. According to fileformat.info, U+1F507 is supported only by Quivira, Symbola, Segoe UI Symbol, and Segoe UI Emoji. The latter two are proprietary fonts, available only in relative new versions of Windows, and as different variants (e.g., my Windows 7 lacks Segoe UI Emoji and has a variant of Segoe UI Symbol that lacks the character).

Thus, the only way that works reasonably is to use either Quivira or Symbola as a downloadable font, via @font-face. As they are rather large fonts, and you would need to serve them in different font formats for cross-browser functionality, this approach is hardly a practical option (unless you have many other special characters, possibly used in text, that also need such special fonts).

这篇关于我应该为最新的Unicode字符使用哪种字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆