Closed samleibowitz closed 4 months ago
Hi there,
hm, we need to track down, which parameter gives silicon the problems. Could you try out the new bare minimum config like so:
{
"michaelrommel/nvim-silicon",
lazy = true,
cmd = "Silicon",
opts = {
debug = true,
disable_defaults = true,
-- command = "/opt/homebrew/bin/silicon",
-- command = "/Users/rommel/.local/share/mise/installs/rust/latest/bin/silicon"
}
},
or like you have it in a function:
{
"michaelrommel/nvim-silicon",
lazy = true,
cmd = "Silicon",
config = function()
require("silicon").setup {
debug = true,
disable_defaults = true,
-- command = "/opt/homebrew/bin/silicon",
-- command = "/Users/rommel/.local/share/mise/installs/rust/latest/bin/silicon"
}
end,
},
Then we can track down one by one, which argument poses the problem. I suppose it is actually the font...
Michael.
Sure thing! Here is the minimum configuration that I was able to get to run without errors:
{
"michaelrommel/nvim-silicon",
lazy = true,
cmd = "Silicon",
config = function()
require("silicon").setup {
-- Configuration here, or leave empty to use defaults
-- font = "FiraCode Nerd Font=34;Apple Color Emoji=34",
-- command = "/Users/sam/.cargo/bin/silicon",
command = "/opt/homebrew/bin/silicon",
debug = true,
disable_defaults = true,
language = "lua",
output = "/Users/sam/Desktop/silicon.png",
}
end,
},
That worked with both the homebrew and cargo installed versions.
Interestingly, adding font = "FiraCode Nerd Font=34",
also works, but font = "FiraCode Nerd Font=34;Apple Color Emoji=34",
does not. It looks to me like there is some special logic in the font-kit library which is supposed to handle Apple Color Emoji font specifically, but maybe it's not working?
unsafe fn reset_freetype_face_char_size(face: FT_Face) {
// Apple Color Emoji has 0 units per em. Whee!
let units_per_em = (*face).units_per_EM as i64;
if units_per_em > 0 {
assert_eq!(
FT_Set_Char_Size(face, ((*face).units_per_EM as FT_Long) << 6, 0, 0, 0),
0
);
}
}
If I do silicon -f "FiraCode Nerd Font=34;Apple Color Emoji=34" --output ~/Desktop/silicon.png treesitter.lua
at the command line, it also panics, so maybe this is really a font-kit issue?
I am not sure, which font parsing create silicon uses - I though I saw some harfbuzz
references. But I agree, it seems to be related to the Emoji Font - there are alwayse some strange things going on, that's why I also settled on the monochrome Emoji font, I referenced in the README.
This should be taken then upstream to the sillicon
maintainer, https://github.com/Aloxaf/silicon
If you agree with this analysis, I would be very grateful, if you could close the issue, because I cannot really do anything here.
Thanks for reporting this issue, it certainly is good to understand, where problems come from, highly appreciated!
Have a good time!
Michael.
Just out of curiosity: are there any Emoji characters in the treesitter.lua
file, you were trying? Is it panicking on the rendering of a specific glyph or generally, right at the time of initialization? Maybe when we try with a plain text file, we can narrow down the source...
Just out of curiosity: are there any Emoji characters in the
treesitter.lua
file, you were trying? Is it panicking on the rendering of a specific glyph or generally, right at the time of initialization? Maybe when we try with a plain text file, we can narrow down the source...
Nope! No emoji. But since you asked, I tried putting an emoji in there.
Apple Color Emoji
still in the font list, it panicked again.Noto Emoji
and specifying that, and that worked as you'd expect:I'll take a look upstream and see if I can find the right place to open this issue. Thanks for taking a look!
I'm getting a panic when trying to run
:Silicon
on an Apple M1. Silicon was installed viabrew install silicon
. Here's the relevant section of my lazy config:And the stack trace: