问题描述
我正在使用Freetype 1.9.1和Harfbuzz 1.7.6渲染可能包含表情符号的文本,但是我不知道如何正确渲染Apple Color Emoji中的表情符号修饰符和ZWJ序列(颜色字体)。
I'm using Freetype 1.9.1 and Harfbuzz 1.7.6 to render text possibly including emoji, however I don't know how to correctly render emoji modifiers and ZWJ sequencces from Apple Color Emoji (sbix color font).
我还尝试了Noto Color Emoji(颜色字体),则呈现黑色&白色字形,但是似乎对COLR / CPAL的支持仅为,因此对我来说不是问题。
I've also tried Noto Color Emoji (CBDT/CBLC color font), which works as expected, and Segoe UI Emoji (COLR/CPAL color font), which renders black & white glyphs, however it seems that support for COLR/CPAL is just being developed in Freetype and therefore is not an issue for me.
任何人都可以找到所需的提示sbix字体?集群类型? Harfbuzz标志...?
Has anyone any tips on what to look out for with the sbix font? Cluster types? Harfbuzz flags...?
推荐答案
HarfBuzz逐渐改进了对不同序列的支持,现在可以使用了
HarfBuzz gradually improved different sequences support and now is reliable to be used for different Emoji modifiers and sequences.
此外,v2.1.0还通过简单的API简化了对所有可用Emoji文件格式的支持,当然,渲染部分仍将取决于您(或使用freetype进行渲染),但是您不必再处理字体结构了,至少简单易用的API,也是有关如何使用API的好例子。
Additionally, v2.1.0 added support to all of the available Emoji file formats with a simple and concise API, https://github.com/harfbuzz/harfbuzz/blob/master/src/hb-ot-color.h of course rendering parts still will be up to you (or use freetype to render then) but you don't have to deal with font structures at least anymore given the simple to use API which https://github.com/harfbuzz/harfbuzz/blob/1934652/src/main.cc#L46-L247 is also a good example on how to use the APIs.
这篇关于表情符号修饰符使用Harfbuzz&的ZWJ序列Apple Color Emoji中的Freetype的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!