fix: 修复 IMSS 文本框中 emoji 无法正常显示的问题#893
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在解决 IMSS 文本框中 emoji 显示异常的问题。由于文本框原有的特殊渲染效果(通过多层叠加实现透明文字、渐变和描边),导致彩色 emoji 无法正确呈现。本次修改通过引入 emoji 检测机制,并对包含 emoji 的文本进行条件渲染,使其以普通文本形式显示,从而允许系统正确处理 emoji 的字体回退,确保 emoji 能够正常、清晰地展示。 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
几个问题
关键问题emoji 没法显示的关键问题在于, webgal .outer 样式的字体默认着色方式是 background + background-clip, 这导致整个 emoji 被染色, 我认为此问题应该从样式着手, 例如将字体颜色样式改为简单的 color 属性 |
修复 IMSS 文本框中 emoji 无法正常显示的问题。
此前文本框会将所有文本统一渲染为多层叠加结构(
outer/inner/zhanwei),通过透明文字、渐变和描边来实现视觉效果。这套方案对普通文字有效,但会破坏彩色 emoji 的正常渲染。我之前即使将Segoe UI Emoji或者Noto Emoji等设为回退字体也依然会持出现emoji只有轮廓但是被涂黑的情况本次修改增加了对 emoji 内容的检测:
当检测到当前节点包含 emoji 时,不再走渐变描边的叠层渲染,而是改为普通文本渲染,从而让系统 emoji 字体回退机制正常生效。
问题原因
问题不在于字体没有注册,而在于文本框当前的特效实现方式会影响彩色 emoji 的显示。
"Segoe UI Emoji"作为系统字体本身可以直接作为回退字体使用,但由于文本实际是通过透明占位和多层覆盖来呈现的,导致 emoji 无法按正常方式绘制。修改内容
IMSSTextbox中增加 emoji 检测逻辑验证方式