This commit is contained in:
Simon Gardling 2022-05-05 21:18:49 -04:00
parent 506a878405
commit ff96995ea8
2 changed files with 16 additions and 13 deletions

12
Cargo.lock generated
View File

@ -663,7 +663,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]]
name = "eframe"
version = "0.18.0"
source = "git+https://github.com/Titaniumtown/egui.git#a672934d74c2b5c3c455421bbc2c6a2a40519c1e"
source = "git+https://github.com/Titaniumtown/egui.git#737aedad397d32299f514cb63228512c37674404"
dependencies = [
"bytemuck",
"egui",
@ -683,7 +683,7 @@ dependencies = [
[[package]]
name = "egui"
version = "0.18.1"
source = "git+https://github.com/Titaniumtown/egui.git#a672934d74c2b5c3c455421bbc2c6a2a40519c1e"
source = "git+https://github.com/Titaniumtown/egui.git#737aedad397d32299f514cb63228512c37674404"
dependencies = [
"ahash",
"epaint",
@ -694,7 +694,7 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.18.0"
source = "git+https://github.com/Titaniumtown/egui.git#a672934d74c2b5c3c455421bbc2c6a2a40519c1e"
source = "git+https://github.com/Titaniumtown/egui.git#737aedad397d32299f514cb63228512c37674404"
dependencies = [
"arboard",
"egui",
@ -707,7 +707,7 @@ dependencies = [
[[package]]
name = "egui_glow"
version = "0.18.0"
source = "git+https://github.com/Titaniumtown/egui.git#a672934d74c2b5c3c455421bbc2c6a2a40519c1e"
source = "git+https://github.com/Titaniumtown/egui.git#737aedad397d32299f514cb63228512c37674404"
dependencies = [
"bytemuck",
"egui",
@ -727,7 +727,7 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "emath"
version = "0.18.0"
source = "git+https://github.com/Titaniumtown/egui.git#a672934d74c2b5c3c455421bbc2c6a2a40519c1e"
source = "git+https://github.com/Titaniumtown/egui.git#737aedad397d32299f514cb63228512c37674404"
dependencies = [
"bytemuck",
]
@ -735,7 +735,7 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.18.1"
source = "git+https://github.com/Titaniumtown/egui.git#a672934d74c2b5c3c455421bbc2c6a2a40519c1e"
source = "git+https://github.com/Titaniumtown/egui.git#737aedad397d32299f514cb63228512c37674404"
dependencies = [
"ab_glyph",
"ahash",

View File

@ -147,8 +147,6 @@ impl MathApp {
.read_to_end(&mut tar_file_data)
.expect("failed to read assets");
let mut tar_archive = tar::Archive::new(&*tar_file_data);
// Stores fonts
let mut font_ubuntu_light: Option<FontData> = None;
let mut font_notoemoji: Option<FontData> = None;
@ -159,12 +157,17 @@ impl MathApp {
let mut text_data: Option<TextData> = None;
tracing::info!("Reading assets...");
// Iterate through all entries in the tarball
for file in tar_archive.entries().unwrap() {
let mut file = file.unwrap();
for file in unsafe {
tar::Archive::new(&*tar_file_data)
.entries()
.unwrap_unchecked()
} {
let mut file = unsafe { file.unwrap_unchecked() };
let mut data: Vec<u8> = Vec::new();
file.read_to_end(&mut data).unwrap();
let path = file.header().path().unwrap();
unsafe { file.read_to_end(&mut data).unwrap_unchecked() };
let path = unsafe { file.header().path().unwrap_unchecked() };
let path_string = path.to_string_lossy();
tracing::debug!("Loading file: {}", path_string);
@ -207,7 +210,7 @@ impl MathApp {
font_data: BTreeMap::from([
(
"Hack".to_owned(),
font_hack.expect("Hack -Regular.ttf not found!"),
font_hack.expect("Hack-Regular.ttf not found!"),
),
(
"Ubuntu-Light".to_owned(),