embed ttf in exe
This commit is contained in:
BIN
fonts/Miracode.ttf
Normal file
BIN
fonts/Miracode.ttf
Normal file
Binary file not shown.
@@ -15,8 +15,7 @@ use vte::{Params, Parser, Perform};
|
||||
|
||||
use zeno::{Mask, Transform};
|
||||
|
||||
// params
|
||||
const FONT: &str = "/home/andromeda/.nix-profile/share/fonts/truetype/Miracode.ttf";
|
||||
const FONT: &[u8] = std::include_bytes!("../fonts/Miracode.ttf");
|
||||
|
||||
struct Buffer<T: std::clone::Clone> {
|
||||
buffer: Vec<T>,
|
||||
@@ -159,8 +158,7 @@ impl OutlineBuilder for Builder {
|
||||
|
||||
fn main() {
|
||||
// initialize the font
|
||||
let font_data = std::fs::read(FONT).unwrap();
|
||||
let face = Face::parse(&font_data, 0).unwrap();
|
||||
let face = Face::parse(FONT, 0).unwrap();
|
||||
let font = generate_font(&face);
|
||||
|
||||
let mut model = Model::new(
|
||||
|
||||
Reference in New Issue
Block a user