diff --git a/Cargo.lock b/Cargo.lock index 02f5a09..4286095 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,6 +380,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "const-cstr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3d0b5ff30645a68f35ece8cea4556ca14ef8a1651455f789a099a0513532a6" + [[package]] name = "core-foundation" version = "0.6.4" @@ -856,6 +862,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fontconfig" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a25320ad784a9578ada0b395dd7dcd2321109404bbb341ec27e64b01a1e49b47" +dependencies = [ + "yeslogic-fontconfig-sys", +] + [[package]] name = "foreign-types" version = "0.3.2" @@ -1624,6 +1639,7 @@ dependencies = [ name = "mpd_info_screen" version = "0.2.20" dependencies = [ + "fontconfig", "freetype", "ggez", "image 0.24.3", @@ -3070,6 +3086,18 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" +[[package]] +name = "yeslogic-fontconfig-sys" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2bbd69036d397ebbff671b1b8e4d918610c181c5a16073b96f984a38d08c386" +dependencies = [ + "const-cstr", + "dlib 0.5.0", + "once_cell", + "pkg-config", +] + [[package]] name = "zip" version = "0.5.13" diff --git a/Cargo.toml b/Cargo.toml index 4c11325..93a2ac8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ structopt = "0.3" image = "0.24" ggez = "0.7" freetype = { version = "0.7", optional = true } +fontconfig = { version = "0.5", optional = true } [features] -noto = ["dep:freetype"] +unicode_support = ["dep:freetype", "dep:fontconfig"] diff --git a/src/main.rs b/src/main.rs index be43427..a5387e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,8 @@ mod debug_log; mod display; mod mpd_handler; +#[cfg(feature = "unicode_support")] +mod unicode_support; use ggez::conf::{WindowMode, WindowSetup}; use ggez::event::winit_event::{ElementState, KeyboardInput, ModifiersState}; diff --git a/src/unicode_support.rs b/src/unicode_support.rs new file mode 100644 index 0000000..42cc9b3 --- /dev/null +++ b/src/unicode_support.rs @@ -0,0 +1,2 @@ +mod fontconfig; +mod freetype; diff --git a/src/unicode_support/fontconfig.rs b/src/unicode_support/fontconfig.rs new file mode 100644 index 0000000..8f6520d --- /dev/null +++ b/src/unicode_support/fontconfig.rs @@ -0,0 +1 @@ +use fontconfig; diff --git a/src/unicode_support/freetype.rs b/src/unicode_support/freetype.rs new file mode 100644 index 0000000..9dab281 --- /dev/null +++ b/src/unicode_support/freetype.rs @@ -0,0 +1 @@ +use freetype;