servo / font-kit

A cross-platform font loading library written in Rust
Apache License 2.0
660 stars 98 forks source link

Panic on Mac OS trying to read Apple Color Emoji #236

Open samleibowitz opened 4 months ago

samleibowitz commented 4 months ago

Background - I have just started getting into using silicon and nvim-silicon on an M1 Macbook. In its default configuration, I noted I was getting panics trying to create screenshots using both the command line utility and the nvim plugin:

silicon returned with: thread 'main' panicked at /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/font-kit-0.11.0/src/loaders/freetype.rs:1146:9:
assertion `left == right` failed
  left: 23
 right: 0

I noticed that this lined up with this function, which makes special mention of Apple Color Emoji. I tried explicitly removing Apple Color Emoji from the list of fonts, after which it worked fine. Replacing it with Noto Emoji also works (albeit in monochrome).

(I am assuming that this is an issue somewhere in the underlying font support rather than in Silicon, apologies if this is in the wrong place.)