notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 300dfc8a4e70fc6f95cf2f5e1c7f25bccb758856
parent 97aaa651d83671bce93a3cb87c3d44d0e387d54e
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 16 Feb 2024 11:36:56 -0800

fonts: remove old font loading code

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/app.rs | 4++--
Msrc/fonts.rs | 30+-----------------------------
2 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/src/app.rs b/src/app.rs @@ -1,6 +1,6 @@ use crate::abbrev; use crate::error::Error; -use crate::fonts::{setup_gossip_fonts, NamedFontFamily}; +use crate::fonts::{setup_fonts, NamedFontFamily}; use crate::frame_history::FrameHistory; use crate::images::fetch_img; use crate::notecache::NoteCache; @@ -439,7 +439,7 @@ impl Damus { //} // - setup_gossip_fonts(&cc.egui_ctx); + setup_fonts(&cc.egui_ctx); cc.egui_ctx .set_pixels_per_point(cc.egui_ctx.pixels_per_point() + 0.2); diff --git a/src/fonts.rs b/src/fonts.rs @@ -19,37 +19,9 @@ impl NamedFontFamily { } } -pub fn setup_fonts(ctx: &egui::Context) { - let mut fonts = FontDefinitions::default(); - let _families = BTreeMap::<String, FontData>::new(); - - let our_font: String = "onest".to_owned(); - - // Install my own font (maybe supporting non-latin characters): - fonts.font_data.insert( - our_font.clone(), - FontData::from_static(include_bytes!( - "../assets/fonts/onest/OnestRegular1602-hint.ttf" - )), - ); // .ttf and .otf supported - - // Put my font first (highest priority): - fonts - .families - .get_mut(&egui::FontFamily::Proportional) - .unwrap() - .insert(0, our_font); - - // Put my font as last fallback for monospace: - //fonts.families.get_mut(&FontFamily::Monospace).unwrap() - //.push("onest".to_owned()); - - ctx.set_fonts(fonts); -} - // Use gossip's approach to font loading. This includes japanese fonts // for rending stuff from japanese users. -pub fn setup_gossip_fonts(ctx: &egui::Context) { +pub fn setup_fonts(ctx: &egui::Context) { let mut font_data: BTreeMap<String, FontData> = BTreeMap::new(); let mut families = BTreeMap::new();