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