diff --git a/Cargo.lock b/Cargo.lock index e2d87ee..9041323 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,8 +5,10 @@ version = 3 [[package]] name = "MFEKmath" version = "0.1.2" +source = "git+https://github.com/MFEK/math.rlib?branch=main#3b2f69684a72bd3bddfcc7d8e090dae17ac9b254" dependencies = [ "flo_curves", + "fontforge-typeconv", "glifparser", "kurbo", "log", @@ -23,6 +25,7 @@ dependencies = [ "MFEKmath", "clap", "env_logger", + "float-cmp", "glifparser", "log", "mfek-ipc", @@ -38,9 +41,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -94,15 +97,15 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bindgen" -version = "0.66.1" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ "bitflags 2.4.0", "cexpr", @@ -117,7 +120,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.31", + "syn 2.0.37", "which", ] @@ -135,9 +138,9 @@ checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" @@ -183,15 +186,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.29" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87d9d13be47a5b7c3907137f1290b0459a7f80efb26be8c52afb11963bccb02" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", "windows-targets 0.48.5", ] @@ -324,9 +326,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "either" @@ -355,9 +357,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ "errno-dragonfly", "libc", @@ -431,6 +433,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "fontforge-sys" +version = "0.1.0" +source = "git+https://github.com/MFEK/fontforge-sys.rlib#52d2b17e6541b8d0ce7db1ca9f9c44df41ff79dd" +dependencies = [ + "libc", +] + +[[package]] +name = "fontforge-typeconv" +version = "0.1.0" +source = "git+https://github.com/MFEK/fontforge-typeconv.rlib?branch=main#f0276288877e42371986d223569e474bcb2d84f2" +dependencies = [ + "fontforge-sys", + "glifparser", +] + [[package]] name = "form_urlencoded" version = "1.2.0" @@ -452,6 +471,7 @@ dependencies = [ [[package]] name = "glifparser" version = "2.0.1" +source = "git+https://github.com/MFEK/glifparser.rlib?branch=master#5ca4717b7bac9b6608041dda34a238ba2541dc5b" dependencies = [ "derivative", "derive_more", @@ -484,9 +504,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -505,9 +525,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "home" @@ -583,12 +603,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -639,7 +659,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "rustix", "windows-sys 0.48.0", ] @@ -712,9 +732,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -737,9 +757,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "log" @@ -749,13 +769,14 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "mfek-ipc" version = "0.0.4-beta1" +source = "git+https://github.com/MFEK/ipc.rlib#1d41a639e01c626873ba3d2937ee7f1ef6bf2a11" dependencies = [ "ansi_term", "atty", @@ -794,7 +815,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -894,7 +915,7 @@ dependencies = [ "line-wrap", "quick-xml", "serde", - "time 0.3.28", + "time", ] [[package]] @@ -917,14 +938,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.31", + "syn 2.0.37", ] [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -958,9 +979,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", @@ -970,9 +991,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -1023,9 +1044,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.11" +version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" +checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ "bitflags 2.4.0", "errno", @@ -1042,25 +1063,15 @@ checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", - "rustls-webpki 0.101.4", + "rustls-webpki", "sct", ] [[package]] name = "rustls-webpki" -version = "0.100.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.4" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -1099,9 +1110,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" [[package]] name = "serde" @@ -1120,14 +1131,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.37", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -1157,9 +1168,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "skia-bindings" -version = "0.64.0" +version = "0.66.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a30c13184ca65af3a989ea2efe8803335d011800c0c738ef89e003b69e08e6" +checksum = "2a42e3db408fbe7beafeadcaf5309c59eb99cc80979cab1b49e2a47539adf8ab" dependencies = [ "bindgen", "cc", @@ -1175,9 +1186,9 @@ dependencies = [ [[package]] name = "skia-safe" -version = "0.64.0" +version = "0.66.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace543b27749a9cade9fe57d0aadddd2fe1a99563f2976401966bda84b47284f" +checksum = "6d03680a0ce867756947f2d5fa92078915342f81996c43b61847fed565068f75" dependencies = [ "bitflags 2.4.0", "lazy_static", @@ -1186,9 +1197,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "spin" @@ -1230,9 +1241,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -1252,9 +1263,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -1267,20 +1278,9 @@ checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" [[package]] name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -1291,15 +1291,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -1321,9 +1321,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0a3ab2091e52d7299a39d098e200114a972df0a7724add02a273aa9aada592" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -1346,7 +1346,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -1367,9 +1367,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1388,16 +1388,16 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" +checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" dependencies = [ "base64", "flate2", "log", "once_cell", "rustls", - "rustls-webpki 0.100.2", + "rustls-webpki", "url", "webpki-roots", ] @@ -1423,12 +1423,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1456,7 +1450,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -1478,7 +1472,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1501,12 +1495,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.23.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.2", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "which" @@ -1538,9 +1529,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1712,9 +1703,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eee6bf5926be7cf998d7381a9a23d833fd493f6a8034658a9505a4dc4b20444" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "xmltree" diff --git a/Cargo.toml b/Cargo.toml index 560421e..495e419 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,23 +12,24 @@ license = "Apache-2.0" clap = { git = "https://github.com/MFEK/clap.rlib", branch = "master" } # parses .glif files -#glifparser = { git = "https://github.com/MFEK/glifparser.rlib", branch = "master", features=["mfek"] } -glifparser = { path = "../glifparser.rlib", features=["mfek"] } # for development -#MFEKmath = { git = "https://github.com/MFEK/math.rlib", branch = "nibstroking" } -MFEKmath = { path = "../math.rlib", features = ["skia"]} # for development -#mfek-ipc = { git = "https://github.com/MFEK/ipc.rlib" } -mfek-ipc = { path = "../ipc.rlib" } # for development +glifparser = { git = "https://github.com/MFEK/glifparser.rlib", branch = "master", features=["mfek"] } +#glifparser = { path = "../glifparser.rlib", features=["mfek"] } # for development +MFEKmath = { git = "https://github.com/MFEK/math.rlib", features=["skia"], branch = "main" } +#MFEKmath = { path = "../math.rlib" } # for development +mfek-ipc = { git = "https://github.com/MFEK/ipc.rlib" } +#mfek-ipc = { path = "../ipc.rlib" } # for development # For reading and writing glifs xmltree = "0.10" log = "0.4.11" env_logger = "0.9" serde_json = "1.0" # for glifjson +float-cmp = { version = "0.9.0", features = ["std"] } # Can link FontForge as a dylib, if you have it installed. For nib stroking -#[features] -#fontforge = ["MFEKmath/fontforge"] +[features] +fontforge = ["MFEKmath/fontforge"] [profile.release] opt-level = 'z' diff --git a/README.md b/README.md index 02fc0c4..fd4289c 100644 --- a/README.md +++ b/README.md @@ -93,47 +93,110 @@ cargo run -- --out Untitled2.ufo/glyphs/k.low.glif --path FRBStandardCursive-Reg ### Pattern Along Path ``` MFEKstroke-PAP 0.2.1 -Matthew Blanchard ; Fredrick R. Brennan ; MFEK Authors +Matthew Blanchard ; Fredrick R. Brennan ; MFEK +Authors Maps a pattern glyph along a path glyph. USAGE: - MFEKstroke PAP [OPTIONS] --path --pattern + MFEKstroke PAP [OPTIONS] --path OPTIONS: - -p, --pattern The path to the input pattern file. You may also provide either --dot-pattern or - --dash-pattern to use built-in patterns. - -=, --dash-pattern Use a simple dash pattern - -., --dot-pattern Use a simple dot pattern - -P, --path The path to the input path file. - -o, --output The path where the output will be saved. If omitted, or `-`, stdout. - - - -c, --contour if this is a positive number we stroke only that specific contour in the - outline by index. [default: -1] - -m, --mode Repeat mode. [default: single] [possible values: single, repeated] - -s, --subdivide how many times to subdivide the patterns at their midpoint. [default: 0] - - - -X, --sx how much we scale our input pattern on the x-axis. [default: 1] - -Y, --sy how much we scale our input pattern on the y-axis. [default: 1] - -n, --noffset how much to offset the pattern along the normal of the path. [default: 0] - -t, --toffset how much to offset the pattern along the tangent of the path. [default: 0] - - - -W, --spacing how much padding to trail each copy with. [default: 0] - -!, --stretch false if not given, true if given, spacing mode if value of spacing - given [possible values: spacing] - -S, --simplify if we should run the result through Skia's (buggy) simplify routine. - -O, --overdraw pattern copies overlapping more than arg% are removed. [default: 100%] - -Q, --one-pass whether we should not reflow the path after culling during overdraw - (faster but worse). - -C, --no-center-pattern supply if you wish to center the pattern - -r, --reverse true will reverse the path. - -R, --reverse-culling true will reverse the order we check for overlaps during overlap - culling. - - -h, --help Prints help information - -V, --version Prints version information + -p, --pattern + The path to the input pattern file. You may also provide either --dot-pattern or --dash- + pattern to use built-in patterns. + + -=, --dash-pattern + Use a simple dash pattern + + -w, --warp + Warp the pattern to fit the path. + + -., --dot-pattern + Use a simple dot pattern + + -P, --path + The path to the input path file. + + -o, --output + The path where the output will be saved. If omitted, or `-`, stdout. + + + + -c, --contour + if this is a positive number we stroke only that specific contour in the outline + by index. [default: -1] + + -m, --mode + Repeat mode. [default: single] [possible values: single, repeated] + + -s, --subdivide + how many times to subdivide the patterns at their midpoint. [default: 0] + + + + -°, --subdivide-angle + how many degrees of change in direction to subdivide the patterns at. [default: 0] + + + -X, --sx + how much we scale our input pattern on the x-axis. [default: 1] + + -Y, --sy + how much we scale our input pattern on the y-axis. [default: 1] + + -|, --split-at-discontinuity + Handle discontinuities by splitting the path. + + -n, --noffset + how much to offset the pattern along the normal of the path. [default: 0] + + -t, --toffset + how much to offset the pattern along the tangent of the path. [default: 0] + + + + -W, --spacing + how much padding to trail each copy with. [default: 0] + + -!, --stretch + false if not given, true if given, spacing mode if value of spacing given + [possible values: spacing] + + -S, --simplify + if we should run the result through Skia's (buggy) simplify routine. + + -O, --remove-overlapping + Remove patterns that would overlap. + + -Z, --erase-overlapping + Erase the area underneath patterns that would overlap. + + -z, --erase-overlapping-stroke + how much we should expand the pattern when erasing overlapping patterns. + + -%, --erase-overlapping-area-percent + how much we should expand the pattern when erasing overlapping patterns. + + -Q, --one-pass + whether we should not reflow the path after culling during overdraw (faster + but worse). + + -C, --no-center-pattern + supply if you wish to center the pattern + + -r, --reverse + true will reverse the path. + + -R, --reverse-culling + true will reverse the order we check for overlaps during overlap culling. + + + + -h, --help + Print help information + + -V, --version + Print version information ``` ### Variable Width Stroking (Note: In VWS mode, it is expected that you are using MFEKglif to generate the input files. Therefore, not many helpful command line options are provided. If you wish to use VWS programatically, play with MFEKglif's VWS tool, get some output, and study it; then generate conformant XML.) diff --git a/src/constant_width_stroke.rs b/src/constant_width_stroke.rs index 8234e21..1b49ad1 100644 --- a/src/constant_width_stroke.rs +++ b/src/constant_width_stroke.rs @@ -10,6 +10,7 @@ use glifparser::glif::contour_operations::vws::{InterpolationType, VWSHandle}; use glifparser::glif::mfek::{MFEKGlif}; use MFEKmath::variable_width_stroking::VWSSettings; + use glifparser::{Glif, Outline, PointData}; use clap::{App, AppSettings, Arg}; @@ -151,7 +152,7 @@ fn make_vws_contours(path: &Glif<()>, settings: &CWSSettings<()>) -> Vec clap::App<'static> { .validator(super::arg_validator_usize) .help(" how many times to subdivide the patterns at their midpoint. [default: 0]\n\n\n")) .arg(Arg::new("subdivide_angle") + .short('°') .long("subdivide-angle") .takes_value(true) .default_value("1") @@ -100,6 +103,7 @@ pub fn clap_app() -> clap::App<'static> { .validator(super::arg_validator_positive_f64) .help(" how much we scale our input pattern on the y-axis.")) .arg(Arg::new("split_at_discontinuity") + .short('|') .long("split-at-discontinuity") .help("Handle discontinuities by splitting the path.") ) @@ -146,12 +150,14 @@ pub fn clap_app() -> clap::App<'static> { .help("Erase the area underneath patterns that would overlap.")) .arg(Arg::new("erase_overlapping_stroke_width") .long("erase-overlapping-stroke") + .short('z') .takes_value(true) .default_value("5") .hide_default_value(true) .validator(super::arg_validator_f64) .help(" how much we should expand the pattern when erasing overlapping patterns.")) .arg(Arg::new("erase_overlapping_area_percent") + .short('%') .long("erase-overlapping-area-percent") .takes_value(true) .default_value("5") @@ -256,10 +262,11 @@ pub fn pap_cli(matches: &clap::ArgMatches) { if let Some(sub_angle_string) = matches.value_of("subdivide_angle") { let n = sub_angle_string.parse::().unwrap(); - settings.subdivide = match n { - 0. => PatternSubdivide::Off, - _ => PatternSubdivide::Angle(n), - }; + if 0.0f64.approx_eq(n, F64Margin { ulps: 2, epsilon: 0.01 }) { + settings.subdivide = PatternSubdivide::Off; + } else { + settings.subdivide = PatternSubdivide::Angle(n); + } } if let Some(spacing_string) = matches.value_of("spacing") { @@ -278,7 +285,7 @@ pub fn pap_cli(matches: &clap::ArgMatches) { settings.center_pattern = !matches.is_present("no-center-pattern"); settings.simplify = matches.is_present("simplify"); - if let Some(s) = matches.value_of("remove_overlapping") { + if matches.value_of("remove_overlapping").is_some() { settings.cull_overlap = glifparser::glif::contour_operations::pap::PatternCulling::RemoveOverlapping; } diff --git a/src/validators.rs b/src/validators.rs index 8ef2365..cc574c5 100644 --- a/src/validators.rs +++ b/src/validators.rs @@ -56,11 +56,3 @@ pub fn arg_validator_usize(v: &str) -> Result<(), String> { Err(_) => Err(String::from("Value must be a positive integer")), } } - -pub fn arg_validator_suffix(f: &impl Fn(&str) -> Result<(), String>, suffix: char) -> impl Fn(&str) -> Result<(), String> + '_ { - move |v| { - let len = if v.ends_with(suffix) { 1 } else { 0 }; - let vlen = v.len(); - f(&v[0..vlen - len - 1]) - } -} diff --git a/src/variable_width_stroke.rs b/src/variable_width_stroke.rs index d60f367..10fae68 100644 --- a/src/variable_width_stroke.rs +++ b/src/variable_width_stroke.rs @@ -1,7 +1,7 @@ use std::fs; use clap::{App, Arg}; -use MFEKmath::{variable_width_stroke_glif, VWSSettings}; +use MFEKmath::{variable_width_stroking::{variable_width_stroke_glif, VWSSettings}}; pub fn clap_app() -> clap::App<'static> { App::new("VWS")