表情符号如何呈现?

发布于 2025-02-12 15:31:28 字数 400 浏览 2 评论 0原文

据我了解,字体或字体家庭可能没有为每个Unicode字符定义的所有字形。每当我具有表情符号角色时,font farty faction效果是什么?

例如,如果我有:

<p style="font-family:Arial">&#x1f354; Hamburger</p>

汉堡表情符号从哪个字体中获取?

我要问的原因是,在我的桌面镀铬上,表情符号相对较普通和丑陋,而在我的Android Chrome上,同样的表情符号具有更多的细节和颜色。作为网页创建者,我可以控制或选择哪些“字体”用于在客户端中呈现表情符号?

From what I understand, a font, or font-family, may not have all the glyphs defined for every Unicode character. Whenever I have an emoji character, what is the font-family in effect?

For example, if I have:

<p style="font-family:Arial">🍔 Hamburger</p>

from which typeface is the hamburger emoji taken?

The reason I am asking is, on my desktop Chrome, emojis are relatively plain and ugly, whereas on my Android Chrome, the same emojis have lots more details and colors. As a web page creator, can I control or select what "fonts" are used to render emojis in a client?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你对谁都笑 2025-02-19 15:31:28

根据应用程序或站点/服务的不同,可以使用

  • 位图图像文件显示表情符号,例如.pngs
  • svg文件
  • 颜色字体

颜色字体通常使用,因为表情符号表示为文本,并且字体是显示文本的最直接方法。

如果您告诉浏览器使用Arial显示文本,但文本包含表情符号字符,则这些字符不受Arial字体支持,并且浏览器将选择其他字体。 Unicode中定义的字符比Arial可以支持的单个字体要多得多,并且浏览器将具有字体后退逻辑,可以根据要显示的字符在许多不同的字体中进行选择。至于浏览器将用作表情符号的后备字体,这可能取决于浏览器,也取决于主机OS环境:应用程序通常使用主机OS中包含的字体作为后备,但也可以捆绑其自己的字体。

Windows提供Segoe UI表情符号作为表情符号字体;苹果的OS提供了苹果颜色表情符号字体; Google提供Noto Color Emoji。

有不同的颜色字体格式,并且上述表情符号字体的当前版本均使用不同的格式。您可以使用此站点带有不同的浏览器,以查看支持哪种颜色格式。

如果您想控制使用哪些字体来显示表情符号,那么不要简单地具体一个像Arial这样的单一家庭,不支持任何表情符号。否则,您将其保留到浏览器和主机环境中。找到您喜欢的表情符号字体,并获得使用许可证将其用作网络字体;然后将其用作网络字体,并使用 @font-face在您的网站中适当引用;然后将该网络字体添加到您的字体家庭链中。

Depending on the app or site/service, emoji might be displayed using

  • bitmap image files, like .pngs
  • SVG files
  • colour fonts

Colour fonts are commonly used because emoji are represented as text, and a font is the most direct way of displaying text.

If you tell a browser to display text using Arial but the text contains emoji characters, then those characters are not supported by the Arial font and the browser will select a different font. There are far more characters defined in Unicode than a single font like Arial can support, and browsers will have font fallback logic to select from among a number of different fonts depending on the characters to be displayed. As for which font a browser would use as a fallback for emoji, that might depend on the browser, but also on the host OS environment: apps typically use fonts included in the host OS for fallback, but could also bundle their own fonts.

Windows provides Segoe UI Emoji as an emoji font; Apple's OSes provide the Apple Color Emoji font; Google provides Noto Color Emoji.

There are different colour font formats, and current versions of the above emoji fonts each use a different format. You can use this site with different browsers to see which of the colour formats is supported.

If you want to control what fonts are used to display emojis, then don't simply specific a single family like Arial that doesn't support any emoji. Otherwise, you're leaving it up to the browser and host environment. Find an emoji font you like and get a license to use it as a web font; then get it served up as a web font and referenced appropriately in your site using @font-face; and then add that web font into your font-family chain.

独自←快乐 2025-02-19 15:31:28

我更喜欢Noto Color Emoji作为表情符号字体,但表情符号通常是从浏览器中获取的。无论您想要什么,您都可以选择表情符号字体。

I prefer noto color emoji as a emoji font, but the emojis is normally taken from the browser. You can choose the emoji font whatever you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文