Large emoji is cut off on chrome and mobile browsers

霸气de小男生 提交于 2020-01-23 13:15:42

问题


I am trying to display some large emojis with unicode in HTML or CSS.
However, in Chrome, the lower part of some emojis are cut off, while others are displayed just fine.
It also couldn't render in mobile Firefox on Android.

Example of working emoji: ☀

Example of non-working emoji: 🌝

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <style>
    body {
      margin: 0;
      background-color: #fff;
    }
    p {
      font-size: 20em;
      margin: 0;
    }
  </style>
</head>
<body>
  <p>&#x1F31D;</p>
  <p>&#x2600;</p>
</body>
</html>

minimal codepen example:
Thanks.


回答1:


There is a bug reported in Chromium bug tracker - Color glyphs have a 256pt limit

We cache the "correct" version of color glyphs (as we do for alpha masks), but in both cases we have a size limit for the cache (i.e. 256pt).

In the case of non-color glyphs, we fall back on draw-as-path for larger sizes. We don't have such a fallback for color glyphs :(

In my Windows 10 system Chrome Version 69.0.3497.92 (Official Build) (64-bit), above font-size of 216px, the icon with color breaks.

Related issue: https://bugs.chromium.org/p/chromium/issues/detail?id=625191

Similar SO issue: Why do emoji not render above a certain size in Chrome?



来源:https://stackoverflow.com/questions/52324767/large-emoji-is-cut-off-on-chrome-and-mobile-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!