Comments (2)
same
warning] No font found for character `🤣`
[warning] No font found for character `👻`
[warning] No font found for character `🦉`
`warning] No font found for character `
[warning] No font found for character `🤣`
[warning] No font found for character `👻`
[warning] No font found for character `🦉`
`warning] No font found for character `
from silicon.
So here is what I tried.
silicon --font "Apple Color Emoji" inputfile.sh -o output.png
No error is shown, unless I run Rust in debug mode with RUST_BACKTRACE
. Then I get this:
The panic is being thrown when calling Self:get_glyph_width()
. I think this is the offending line:
fn get_glyph_width(font: &Font, id: u32, size: f32) -> u32 {
let metrics = font.metrics();
let advance = font.advance(id).unwrap();
(advance / metrics.units_per_em as f32 * size).x().ceil() as u32; // offending line here
}
I guess with emoji, the metrics.units_per_em
appears to be zero (see screenshot), but since it is coerced to a number, the end result of get_glyph_width
is a large number that overflows and causes the panic.
Edit: I did verify that "Apple Color Emoji" is a font that is listed by the silicon --list-fonts
output. Same result with other fallback emoji font, like "Noto Color Emoji".
from silicon.
Related Issues (20)
- NeoVim package silicon.lua HOT 9
- Feature request: automatically trim indentation
- document all arguments/flags HOT 1
- Ability to change Output Image Resolution HOT 1
- Install failing on Fedora 37 HOT 2
- [Build Failed] `silicon` build failed on RISC-V board, looking for a solution.
- Cannot use `silicon` as a library HOT 1
- Allow setting a custom clipboard handler
- [improvement] anti-aliasing for the round corners
- Should not just use `xclip` HOT 1
- Publish new release for recent changes HOT 2
- support chinese
- Chinese Font support? HOT 1
- Silicon assumes all config directories exist HOT 1
- `cargo install silicon` fails HOT 1
- Getting a stacktrace when trying to use the font Berkeley Mono
- Add dedicated highlighter for CLI usage
- Add support for plaintext
- Unable to override argument set in config file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silicon.