Replace magic boolean with new Hinting enum

This commit is contained in:
Héctor Ramón Jiménez 2025-11-23 20:43:33 +01:00 committed by Jeremy Soller
parent 48eda6bd7d
commit d779057d9c
16 changed files with 96 additions and 50 deletions

View file

@ -1,8 +1,8 @@
use std::path::PathBuf;
use cosmic_text::{
fontdb::Database, Attrs, AttrsOwned, Buffer, Color, Family, FontSystem, Metrics, Shaping,
SwashCache,
fontdb::Database, Attrs, AttrsOwned, Buffer, Color, Family, FontSystem, Hinting, Metrics,
Shaping, SwashCache,
};
use tiny_skia::{Paint, Pixmap, Rect, Transform};
@ -85,7 +85,7 @@ impl DrawTestCfg {
let mut font_system = FontSystem::new_with_locale_and_db("En-US".into(), font_db);
let mut swash_cache = SwashCache::new();
let metrics = Metrics::new(self.font_size, self.line_height);
let mut buffer = Buffer::new(&mut font_system, metrics, false);
let mut buffer = Buffer::new(&mut font_system, metrics, Hinting::Disabled);
let mut buffer = buffer.borrow_with(&mut font_system);
let margins = 5;
buffer.set_size(