Skip to content

Commit

Permalink
include font bytes instead of path for fontdb
Browse files Browse the repository at this point in the history
  • Loading branch information
zignis committed Apr 9, 2024
1 parent cceb585 commit 809efac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/utils/construct_svg_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ lazy_static! {
//
static ref FONT_DB: fontdb::Database = {
let mut font_db = fontdb::Database::new();
font_db.load_fonts_dir("fonts");

font_db.load_font_data(include_bytes!("../../fonts/CabinetGrotesk/CabinetGrotesk-Regular.ttf").to_vec());
font_db.load_font_data(include_bytes!("../../fonts/CabinetGrotesk/CabinetGrotesk-Medium.ttf").to_vec());
font_db.load_font_data(include_bytes!("../../fonts/CabinetGrotesk/CabinetGrotesk-Bold.ttf").to_vec());
font_db.load_font_data(include_bytes!("../../fonts/CabinetGrotesk/CabinetGrotesk-Extrabold.ttf").to_vec());
font_db.load_font_data(include_bytes!("../../fonts/Satoshi/Satoshi-Regular.ttf").to_vec());
font_db.load_font_data(include_bytes!("../../fonts/Satoshi/Satoshi-Medium.ttf").to_vec());
font_db.load_font_data(include_bytes!("../../fonts/Satoshi/Satoshi-Bold.ttf").to_vec());

font_db
};
}
Expand Down

0 comments on commit 809efac

Please sign in to comment.