WIP: Allow specifying font features in the editor

This just lays the foundation for threading through a `fonts::Features`
struct, but it's not used yet.
This commit is contained in:
Antonio Scandurra 2023-03-17 09:51:07 +01:00
parent 3464961aa4
commit b2c733baab
17 changed files with 167 additions and 44 deletions

View file

@ -505,13 +505,18 @@ impl TerminalElement {
///Configures a text style from the current settings.
pub fn make_text_style(font_cache: &FontCache, settings: &Settings) -> TextStyle {
// TODO allow font features
// Pull the font family from settings properly overriding
let family_id = settings
.terminal_overrides
.font_family
.as_ref()
.or(settings.terminal_defaults.font_family.as_ref())
.and_then(|family_name| font_cache.load_family(&[family_name]).log_err())
.and_then(|family_name| {
font_cache
.load_family(&[family_name], Default::default())
.log_err()
})
.unwrap_or(settings.buffer_font_family);
let font_size = settings