Add set_hinting method to Buffer

This commit is contained in:
Héctor Ramón Jiménez 2025-11-27 23:18:30 +01:00 committed by Jeremy Soller
parent d779057d9c
commit a07a619054
14 changed files with 54 additions and 48 deletions

View file

@ -2,7 +2,7 @@
use cosmic_text::{
Action, BidiParagraphs, BorrowedWithFontSystem, Buffer, Color, Edit, Editor, FontSystem,
Hinting, Metrics, Motion, SwashCache,
Metrics, Motion, SwashCache,
};
use orbclient::{EventOption, Renderer, Window, WindowFlag};
use std::{env, fs, process, time::Instant};
@ -71,11 +71,7 @@ fn main() {
];
let font_size_default = 1; // Body
let mut buffer = Buffer::new(
&mut font_system,
font_sizes[font_size_default],
Hinting::Disabled,
);
let mut buffer = Buffer::new(&mut font_system, font_sizes[font_size_default]);
buffer
.borrow_with(&mut font_system)
.set_size(Some(window.width() as f32), Some(window.height() as f32));