diff options
author | 2023-02-04 11:35:12 +0100 | |
---|---|---|
committer | 2023-02-24 13:29:12 +0100 | |
commit | d2825360a75600bb6b4097737c987e2d9e05da6a (patch) | |
tree | 277f59b9b8b1a71618b5fc74fa0fe2516fb72a0f /wgpu/src/text.rs | |
parent | 5a82fc654e2933c4c93dac5393685861feb07b1f (diff) | |
download | iced-d2825360a75600bb6b4097737c987e2d9e05da6a.tar.gz iced-d2825360a75600bb6b4097737c987e2d9e05da6a.tar.bz2 iced-d2825360a75600bb6b4097737c987e2d9e05da6a.zip |
Load `Iced-Icons.ttf` font in `text::Pipeline::new`
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r-- | wgpu/src/text.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 2ca3f0d8..4af57af3 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -45,7 +45,13 @@ impl Pipeline { Pipeline { system: Some( SystemBuilder { - fonts: glyphon::FontSystem::new(), + fonts: glyphon::FontSystem::new_with_fonts( + [glyphon::fontdb::Source::Binary(Arc::new( + include_bytes!("../fonts/Iced-Icons.ttf") + .as_slice(), + ))] + .into_iter(), + ), cache_builder: |fonts| glyphon::SwashCache::new(fonts), measurement_cache_builder: |_| RefCell::new(Cache::new()), render_cache_builder: |_| Cache::new(), |