diff --git a/.cargo/config.toml b/.cargo/config.toml index 262425c..6c0e94b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,4 +2,4 @@ #rustflags = ["-C", "link-arg=-fuse-ld=lld"] [env] -MFEK_REL_CODENAME = "Metafontverse" +MFEK_REL_CODENAME = "Repetitive Spline Injury" diff --git a/Cargo.lock b/Cargo.lock index 3cab93f..e168162 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "MFEKglif" -version = "1.1.1-beta2" +version = "2.0.0-beta1" dependencies = [ "MFEKmath", "arboard", @@ -54,7 +54,7 @@ dependencies = [ "shrinkwraprs", "skia-bindings", "skia-safe", - "spline 0.3.0 (git+https://github.com/linebender/spline)", + "spline 0.3.0", "strum 0.23.0", "which", "winapi", @@ -64,6 +64,7 @@ dependencies = [ [[package]] name = "MFEKmath" version = "0.1.1" +source = "git+https://github.com/MFEK/math.rlib?branch=main#281c881c51894c0157f3aaefad9400f50222b183" dependencies = [ "flo_curves", "glifparser", @@ -1325,6 +1326,7 @@ dependencies = [ [[package]] name = "glifparser" version = "1.2.8" +source = "git+https://github.com/MFEK/glifparser.rlib?branch=master#331bac41e7ee9b4e26ecfcd36107d58436ef0539" dependencies = [ "derivative", "derive_more", @@ -1346,6 +1348,7 @@ dependencies = [ [[package]] name = "glifrenderer" version = "0.1.2" +source = "git+https://github.com/MFEK/glifrenderer.rlib#3533fdac62453826f5d1a351b0a08e44ef4930c4" dependencies = [ "MFEKmath", "derive_more", @@ -1562,9 +1565,9 @@ dependencies = [ [[package]] name = "integer_or_float" -version = "0.1.5-1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c938d51818e629bbddf8c62cbdab9d83d91f80a33ea9b9edb92214af4c73dc" +checksum = "edf9d3b9fde0fc18066e6ba434e0b05863f7e7cccdecdae0f8d68c34089f5056" dependencies = [ "autocfg", "cargo-emit", @@ -1572,6 +1575,7 @@ dependencies = [ "derive_more", "float-cmp", "indoc", + "ryu", "serde", ] @@ -1760,6 +1764,7 @@ dependencies = [ [[package]] name = "mfek-ipc" version = "0.0.4-beta1" +source = "git+https://github.com/MFEK/ipc.rlib#1d41a639e01c626873ba3d2937ee7f1ef6bf2a11" dependencies = [ "ansi_term", "atty", @@ -2488,18 +2493,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.154" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" +checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.154" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" +checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630" dependencies = [ "proc-macro2", "quote", @@ -2616,16 +2621,10 @@ checksum = "4c845fbdc07cb9555a94806496be14d51dcda6d3bf6894d92af2c3a93bebc2c5" [[package]] name = "spline" version = "0.3.0" +source = "git+https://github.com/MFEK/spline.rlib#46d9121b03d2e6bea67b33078057ecad28666d07" dependencies = [ "kurbo 0.9.1", -] - -[[package]] -name = "spline" -version = "0.3.0" -source = "git+https://github.com/linebender/spline#19fc88988f1ac465fcedd11562f9b860f68f99f0" -dependencies = [ - "kurbo 0.8.3", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 545d418..42124ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "MFEKglif" -version = "1.1.1-beta2" +version = "2.0.0-beta1" authors = ["Fredrick Brennan ", "Matthew Blanchard ", "MFEK Authors"] edition = "2021" license = "Apache-2.0" @@ -88,20 +88,23 @@ ctrlc = "3.2" ## Our crates # parses .glif files and gives us a place to put arbitrary data -#glifparser = { git = "https://github.com/MFEK/glifparser.rlib", branch = "master", features=["skia", "mfek"] } -glifparser = { path = "../glifparser.rlib", features=["skia", "mfek"] } # for development +glifparser = { git = "https://github.com/MFEK/glifparser.rlib", branch = "master", features=["skia", "mfek"] } +#glifparser = { path = "../glifparser.rlib", features=["skia", "mfek"] } # for development -#MFEKmath = { git = "https://github.com/MFEK/math.rlib", branch = "main" } -MFEKmath = { path = "../math.rlib" } # for development +MFEKmath = { git = "https://github.com/MFEK/math.rlib", branch = "main" } +#MFEKmath = { path = "../math.rlib" } # for development pub-mod = { git = "https://github.com/MFEK/pub_mod.rlib" } -#mfek-ipc = { git = "https://github.com/MFEK/ipc.rlib" } -mfek-ipc = { path = "../ipc.rlib" } # for development +mfek-ipc = { git = "https://github.com/MFEK/ipc.rlib" } +#mfek-ipc = { path = "../ipc.rlib" } # for development -#glifrenderer = { git = "https://github.com/MFEK/glifrenderer.rlib" } -glifrenderer = { path = "../glifrenderer.rlib" } # for development +glifrenderer = { git = "https://github.com/MFEK/glifrenderer.rlib" } +#glifrenderer = { path = "../glifrenderer.rlib" } # for development +# forked from linebender/spline +#spline = { path = "../spline.rlib" } # for development +spline = { git = "https://github.com/MFEK/spline.rlib" } #xml parsing xmltree = "0.10" @@ -125,8 +128,7 @@ flo_curves = "0.6" plist = "1.3" # we use this for affine matrices in some of our data types -kurbo = {version = "0.9.0", features = ["serde"]} -spline = {git="https://github.com/linebender/spline"} +kurbo = { version = "0.9.0", features = ["serde"] } # show backtrace backtrace = "0.3" diff --git a/src/ipc.rs b/src/ipc.rs index add062e..4b08e68 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -6,6 +6,7 @@ use crate::user_interface::Interface; use std::path::PathBuf; use std::process; +use std::thread; lazy_static::lazy_static! { pub static ref METADATA_AVAILABLE: Result<(module::Version<'static>, PathBuf), ()> = mfek_ipc::module::available("metadata", "0.0.3-beta1"); @@ -155,15 +156,15 @@ pub fn fetch_metrics(v: &mut Editor) { v.ipc_info = Some(ipc_info); } -pub fn launch_fs_watcher(v: &mut Editor) { +pub fn launch_fs_watcher(v: &mut Editor) -> thread::JoinHandle<()> { let filename = v.with_glyph(|glyph| glyph.filename.clone()); let ipc_info = IPCInfo::from_glif_path("MFEKglif".to_string(), &filename.as_ref().unwrap()); if let Some(font) = ipc_info.font { - mfek_ipc::notifythread::launch(font, v.filesystem_watch_tx.clone()); + mfek_ipc::notifythread::launch(font, v.filesystem_watch_tx.clone()) } else { mfek_ipc::notifythread::launch( ipc_info.glyph.unwrap().parent().unwrap().to_owned(), v.filesystem_watch_tx.clone(), - ); + ) } } diff --git a/src/main.rs b/src/main.rs index c63b50c..d611d75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,7 +61,7 @@ fn main() { ctrlc::set_handler(util::quit_next_frame).expect("Could not set SIGTERM handler."); - ipc::launch_fs_watcher(&mut editor); + let _notify_thread = ipc::launch_fs_watcher(&mut editor); command::initialize_keybinds(); // TODO: Replace console! tools::console::initialize_console_commands(); diff --git a/src/user_interface/mod.rs b/src/user_interface/mod.rs index 2ead75d..56a4c32 100644 --- a/src/user_interface/mod.rs +++ b/src/user_interface/mod.rs @@ -38,7 +38,6 @@ pub struct Interface { prompts: Vec, sdl_context: Sdl, sdl_dpi: f32, - pub sdl_window: Window, pub context: Option<(f32, f32)>, pub grid: Grid, @@ -49,6 +48,10 @@ pub struct Interface { pub gl_ctx: GLContext, pub gr_context: RCHandle, pub fb_info: FramebufferInfo, + + // Window *must* be dropped at end to prevent a segmentation fault. + // See . + pub sdl_window: Window, } impl Interface {