From fabfc6de31b42b688a40445884fdbcbd973a52ba Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 3 Dec 2025 16:07:40 -0500 Subject: [PATCH] build.rs: fix FontData and FontTweak --- build.rs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/build.rs b/build.rs index cdb8a3e..7c15ffc 100644 --- a/build.rs +++ b/build.rs @@ -4,11 +4,12 @@ use std::{ fs::File, io::{BufWriter, Write}, path::Path, + sync::Arc, }; use epaint::{ - FontFamily, text::{FontData, FontDefinitions, FontTweak}, + FontFamily, }; use run_script::ScriptOptions; @@ -104,37 +105,38 @@ fn main() { font_data: BTreeMap::from([ ( "Ubuntu-Light".to_owned(), - FontData::from_owned( + Arc::new(FontData::from_owned( font_stripper( "Ubuntu-Light.ttf", "ubuntu-light.ttf", [main_chars, vec!['∫']].concat(), ) .unwrap(), - ), + )), ), ( "NotoEmoji-Regular".to_owned(), - FontData::from_owned( + Arc::new(FontData::from_owned( font_stripper( "NotoEmoji-Regular.ttf", "noto-emoji.ttf", vec!['🌞', '🌙', '✖'], ) .unwrap(), - ), + )), ), ( "emoji-icon-font".to_owned(), - FontData::from_owned( - font_stripper("emoji-icon-font.ttf", "emoji-icon.ttf", vec!['⚙']).unwrap(), - ) - .tweak(FontTweak { - scale: 0.8, - y_offset_factor: 0.07, - y_offset: 0.0, - baseline_offset_factor: -0.0333, - }), + Arc::new( + FontData::from_owned( + font_stripper("emoji-icon-font.ttf", "emoji-icon.ttf", vec!['⚙']).unwrap(), + ) + .tweak(FontTweak { + scale: 0.8, + y_offset_factor: 0.07, + y_offset: -0.0333, + }), + ), ), ]), families: BTreeMap::from([