You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use font_kit::family_name::FamilyName;use font_kit::properties::Properties;use font_kit::source::SystemSource;use raqote::*;fnmain(){letmut dt = DrawTarget::new(512,128);
dt.clear(SolidSource::from_unpremultiplied_argb(0xff,0x0,0x0,0x0));// let font_name = "Source Code Pro".to_string();let font_name = "DejaVu Sans".to_string();let font = SystemSource::new().select_best_match(&[FamilyName::Title(font_name)],&Properties::new()).unwrap().load().unwrap();let pos = Point::new(0.0,64.0);let color = SolidSource::from_unpremultiplied_argb(0xff,0xff,0xff,0xff);
dt.draw_text(&font,16.0,"The brown fox jump over the lazy dog",
pos,&Source::Solid(color),&DrawOptions::new(),);
dt.write_png("out.png").unwrap();}
The text was updated successfully, but these errors were encountered:
JetBrainsMono Nerd Font also renders in shrinked text, but FiraCode Mono Nerd Font doesn't. It's very random to me, but there must be an identifiable problem somewhere.
I'm not sure whether it's a raqote or font-kit issue, but with "Source Code Pro" font text renders to that:
and "DejaVu Sans" produces an expected result:
source code
The text was updated successfully, but these errors were encountered: