fontconfig-parser-0.5.7/.cargo_vcs_info.json0000644000000001360000000000100144730ustar { "git": { "sha1": "f7d13a779e6ee282ce75acbc00a1270c0350e0c2" }, "path_in_vcs": "" }fontconfig-parser-0.5.7/.github/workflows/rust.yml000064400000000000000000000005521046102023000204020ustar 00000000000000name: Build and Test on: push: branches: [ "master" ] pull_request: branches: [ "master" ] env: CARGO_TERM_COLOR: always jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build run: cargo build --all-features --verbose - name: Run tests run: cargo test --all-features --verbose fontconfig-parser-0.5.7/.gitignore000064400000000000000000000000231046102023000152460ustar 00000000000000/target Cargo.lock fontconfig-parser-0.5.7/.vscode/settings.json000064400000000000000000000000651046102023000173600ustar 00000000000000{ "rust-analyzer.cargo.features": ["serialize"] }fontconfig-parser-0.5.7/Cargo.lock0000644000000507400000000000100124540ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anes" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anyhow" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "autocfg" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", "serde", ] [[package]] name = "ciborium-io" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", ] [[package]] name = "clap" version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" dependencies = [ "anstyle", "clap_lex", ] [[package]] name = "clap_lex" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colored" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ "lazy_static", "windows-sys 0.48.0", ] [[package]] name = "criterion" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ "anes", "cast", "ciborium", "clap", "criterion-plot", "is-terminal", "itertools", "num-traits", "once_cell", "oorandom", "plotters", "rayon", "regex", "serde", "serde_derive", "serde_json", "tinytemplate", "walkdir", ] [[package]] name = "criterion-plot" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", "itertools", ] [[package]] name = "crossbeam-deque" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "diff" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "errno" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "fontconfig-parser" version = "0.5.7" dependencies = [ "criterion", "glob", "k9", "log", "roxmltree", "serde", "serde_json", ] [[package]] name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", ] [[package]] name = "hermit-abi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "io-lifetimes" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi", "libc", "windows-sys 0.48.0", ] [[package]] name = "is-terminal" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", "libc", "windows-sys 0.52.0", ] [[package]] name = "itertools" version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "k9" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "088bcebb5b68b1b14b64d7f05b0f802719250b97fdc0338ec42529ea777ed614" dependencies = [ "anyhow", "colored", "diff", "lazy_static", "libc", "proc-macro2", "regex", "syn", "terminal_size", ] [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "linux-raw-sys" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "plotters" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", "plotters-svg", "wasm-bindgen", "web-sys", ] [[package]] name = "plotters-backend" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] [[package]] name = "proc-macro2" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rayon" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", ] [[package]] name = "rayon-core" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] [[package]] name = "regex" version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "roxmltree" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rustix" version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", "windows-sys 0.48.0", ] [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ "winapi-util", ] [[package]] name = "serde" version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" dependencies = [ "itoa", "memchr", "ryu", "serde", ] [[package]] name = "syn" version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "terminal_size" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ "rustix", "windows-sys 0.48.0", ] [[package]] name = "tinytemplate" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ "serde", "serde_json", ] [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "walkdir" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", ] [[package]] name = "wasm-bindgen" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "winapi-util" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets 0.48.5", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm 0.48.5", "windows_aarch64_msvc 0.48.5", "windows_i686_gnu 0.48.5", "windows_i686_msvc 0.48.5", "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm 0.48.5", "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" fontconfig-parser-0.5.7/Cargo.toml0000644000000025050000000000100124730ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "fontconfig-parser" version = "0.5.7" description = "fontconfig file parser in pure Rust" homepage = "https://github.com/Riey/fontconfig-parser" documentation = "https://docs.rs/fontconfig-parser" readme = "README.md" keywords = ["fontconfig"] categories = ["parser-implementations"] license = "MIT" repository = "https://github.com/Riey/fontconfig-parser" [profile.bench] lto = "thin" [profile.release] lto = "thin" [[bench]] name = "parse_test_conf" harness = false [dependencies.log] version = "0.4" optional = true [dependencies.roxmltree] version = "0.20.0" [dependencies.serde] version = "1" features = ["derive"] optional = true [dev-dependencies.criterion] version = "0.5" [dev-dependencies.glob] version = "0.3" [dev-dependencies.k9] version = "0.12" [dev-dependencies.serde_json] version = "1" [features] serialize = ["serde"] fontconfig-parser-0.5.7/Cargo.toml.orig0000644000000013750000000000100134360ustar [package] name = "fontconfig-parser" version = "0.5.7" edition = "2018" license = "MIT" documentation = "https://docs.rs/fontconfig-parser" description = "fontconfig file parser in pure Rust" repository = "https://github.com/Riey/fontconfig-parser" homepage = "https://github.com/Riey/fontconfig-parser" readme = "README.md" categories = ["parser-implementations"] keywords = ["fontconfig"] [features] serialize = ["serde"] [dependencies] log = { version = "0.4", optional = true } roxmltree = "0.20.0" serde = { version = "1", optional = true, features = ["derive"] } [dev-dependencies] criterion = "0.5" glob = "0.3" k9 = "0.12" serde_json = "1" [[bench]] name = "parse_test_conf" harness = false [profile.bench] lto = "thin" [profile.release] lto = "thin" fontconfig-parser-0.5.7/Cargo.toml.orig000064400000000000000000000013751046102023000161600ustar 00000000000000[package] name = "fontconfig-parser" version = "0.5.7" edition = "2018" license = "MIT" documentation = "https://docs.rs/fontconfig-parser" description = "fontconfig file parser in pure Rust" repository = "https://github.com/Riey/fontconfig-parser" homepage = "https://github.com/Riey/fontconfig-parser" readme = "README.md" categories = ["parser-implementations"] keywords = ["fontconfig"] [features] serialize = ["serde"] [dependencies] log = { version = "0.4", optional = true } roxmltree = "0.20.0" serde = { version = "1", optional = true, features = ["derive"] } [dev-dependencies] criterion = "0.5" glob = "0.3" k9 = "0.12" serde_json = "1" [[bench]] name = "parse_test_conf" harness = false [profile.bench] lto = "thin" [profile.release] lto = "thin" fontconfig-parser-0.5.7/LICENSE000064400000000000000000000020451046102023000142710ustar 00000000000000MIT License Copyright (c) 2021 Riey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. fontconfig-parser-0.5.7/README.md000064400000000000000000000006071046102023000145450ustar 00000000000000# fontconfig-parser This crate provide parsing fontconfig file but not yet complete all features see for more detail infomation of fontconfig file ## Example ```rust use fontconfig_parser::FontConfig; let mut config = FontConfig::default(); config.merge_config("/etc/fonts/fonts.conf").unwrap(); ``` License: MIT fontconfig-parser-0.5.7/examples/dump.rs000064400000000000000000000005301046102023000164120ustar 00000000000000use fontconfig_parser::FontConfig; fn main() { let args = std::env::args().collect::>(); if args.len() < 2 { eprintln!("Usage: cargo run --example dump -- "); return; } let mut config = FontConfig::default(); config.merge_config(&args[1]).unwrap(); println!("{:#?}", config); } fontconfig-parser-0.5.7/examples/list_all_fonts.rs000064400000000000000000000016451046102023000204710ustar 00000000000000use fontconfig_parser::{FontConfig, Result}; use std::path::PathBuf; fn visit_dir(dir: PathBuf, fonts: &mut Vec) -> Result<()> { let dir = std::fs::read_dir(dir)?; for entry in dir { if let Ok(entry) = entry { if let Ok(ty) = entry.file_type() { if ty.is_dir() { visit_dir(entry.path(), fonts).ok(); } else if ty.is_file() || ty.is_symlink() { fonts.push(entry.path()); } } } } Ok(()) } fn main() -> Result<()> { let mut config = FontConfig::default(); config.merge_config("/etc/fonts/fonts.conf").unwrap(); println!("dirs: {:#?}", config.dirs); let mut fonts = Vec::new(); for dir in config.dirs { visit_dir(dir.path, &mut fonts).ok(); } println!("Find all {} fonts!", fonts.len()); println!("fonts: {:#?}", fonts); Ok(()) } fontconfig-parser-0.5.7/examples/parse_dump_json.rs000064400000000000000000000007031046102023000206370ustar 00000000000000#[cfg(feature = "serde")] fn main() { let args = std::env::args().collect::>(); if args.len() < 2 { eprintln!("Usage: cargo run --example parse_dump_json -- "); return; } let parts = fontconfig_parser::parse_config_parts(&std::fs::read_to_string(&args[1]).unwrap()).unwrap(); serde_json::to_writer(std::io::stdout(), &parts).unwrap(); } #[cfg(not(feature = "serde"))] fn main() {} fontconfig-parser-0.5.7/src/error.rs000064400000000000000000000031741046102023000155560ustar 00000000000000use std::fmt; use std::num::ParseFloatError; use std::num::ParseIntError; use std::str::ParseBoolError; #[derive(Debug)] pub enum Error { Xml(roxmltree::Error), NoFontconfig, InvalidFormat(String), IoError(std::io::Error), ParseEnumError(&'static str, String), ParseIntError(ParseIntError), ParseFloatError(ParseFloatError), ParseBoolError(ParseBoolError), } impl From for Error { fn from(e: std::io::Error) -> Self { Self::IoError(e) } } impl From for Error { fn from(e: roxmltree::Error) -> Self { Self::Xml(e) } } impl From for Error { fn from(e: ParseIntError) -> Self { Self::ParseIntError(e) } } impl From for Error { fn from(e: ParseFloatError) -> Self { Self::ParseFloatError(e) } } impl From for Error { fn from(e: ParseBoolError) -> Self { Self::ParseBoolError(e) } } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Error::Xml(e) => e.fmt(f), Error::NoFontconfig => write!(f, "Can't find fontconfig element"), Error::InvalidFormat(msg) => write!(f, "Config format is invalid: {}", msg), Error::IoError(e) => write!(f, "IO error: {}", e), Error::ParseEnumError(ty, s) => write!(f, "Unknown variant for {}: {}", ty, s), Error::ParseIntError(e) => e.fmt(f), Error::ParseFloatError(e) => e.fmt(f), Error::ParseBoolError(e) => e.fmt(f), } } } impl std::error::Error for Error {} fontconfig-parser-0.5.7/src/lib.rs000064400000000000000000000020021046102023000151600ustar 00000000000000//! This crate provide parsing fontconfig file but not yet complete all features //! //! see for more detail infomation of fontconfig file //! //! # Example //! //! ```no_run //! use fontconfig_parser::FontConfig; //! //! let mut config = FontConfig::default(); //! //! config.merge_config("/etc/fonts/fonts.conf").unwrap(); //! ``` #[macro_use] mod util; mod error; mod parser; mod types; pub type Result = core::result::Result; pub use crate::error::Error; pub use crate::types::*; /// Parse as raw config parts use this when you want custom handling config file /// /// Otherwise, you may want [`FontConfig::merge_config`] pub fn parse_config_parts(s: &str) -> Result> { crate::parser::parse_config(&roxmltree::Document::parse_with_options( s, roxmltree::ParsingOptions { allow_dtd: true, ..Default::default() }, )?)? .collect() } #[cfg(test)] mod tests {} fontconfig-parser-0.5.7/src/parser.rs000064400000000000000000000301521046102023000157150ustar 00000000000000#![allow(clippy::useless_format)] use crate::*; use roxmltree::Node; pub fn parse_config<'a>( xml_doc: &'a roxmltree::Document, ) -> Result> + 'a> { let fontconfig = xml_doc.root_element(); if fontconfig.tag_name().name() != "fontconfig" { return Err(Error::NoFontconfig); } Ok(fontconfig .children() .filter_map(|c| parse_config_part(c).transpose())) } fn parse_config_part(child: Node) -> Result> { let part = match child.tag_name().name() { "description" => ConfigPart::Description(try_text!(child).into()), "alias" => { let mut alias = Alias::default(); for child in child.children() { let families = child .children() .filter_map(|family| match family.tag_name().name() { "family" => family.text().map(Into::into), _ => None, }); match child.tag_name().name() { "family" => { alias.alias = try_text!(child).into(); } "prefer" => { alias.prefer.extend(families); } "accept" => { alias.accept.extend(families); } "default" => { alias.default.extend(families); } _ => {} } } ConfigPart::Alias(alias) } "dir" => { let mut dir = Dir::default(); parse_attrs!(child, { "prefix" => dir.prefix, }, { "salt" => dir.salt, }); dir.path = try_text!(child).into(); ConfigPart::Dir(dir) } "reset-dirs" => ConfigPart::ResetDirs, "remap-dir" => { let mut dir = RemapDir::default(); parse_attrs!(child, { "prefix" => dir.prefix, }, { "salt" => dir.salt, "as-path" => dir.as_path, }); dir.path = try_text!(child).into(); ConfigPart::RemapDir(dir) } "cachedir" => { let mut dir = CacheDir::default(); parse_attrs!(child, { "prefix" => dir.prefix, }); dir.path = try_text!(child).into(); ConfigPart::CacheDir(dir) } "include" => { let mut dir = Include::default(); let mut ignore_missing = ""; parse_attrs!(child, { "prefix" => dir.prefix, }, { "ignore_missing" => ignore_missing, }); dir.ignore_missing = matches!(ignore_missing, "yes"); dir.path = try_text!(child).into(); ConfigPart::Include(dir) } "config" => { let mut config = Config::default(); for child in child.children() { match child.tag_name().name() { "rescan" => { if let Some(int) = child.first_element_child() { if int.tag_name().name() == "int" { config.rescans.push(try_text!(int).parse()?); } } } "blank" => { if let Some(child) = child.first_element_child() { config.blanks.push(parse_int_or_range(child)?); } } _ => {} } } ConfigPart::Config(config) } "selectfont" => { let mut s = SelectFont::default(); for child in child.children() { let matches = child.children().filter_map(|c| match c.tag_name().name() { "pattern" => { let patelts = c.children().filter_map(|patelt| { if patelt.tag_name().name() == "patelt" { let mut kind = PropertyKind::default(); parse_attrs_opt!(patelt, { "name" => kind, }); parse_expr(patelt.first_element_child()?) .ok() .map(|expr| kind.make_property(expr)) } else { None } }); Some(FontMatch::Pattern(patelts.collect())) } "glob" => c.text().map(Into::into).map(FontMatch::Glob), _ => None, }); match child.tag_name().name() { "acceptfont" => { s.accepts.extend(matches); } "rejectfont" => { s.rejects.extend(matches); } _ => {} } } ConfigPart::SelectFont(s) } "match" => { let mut m = Match::default(); parse_attrs!(child, { "target" => m.target, }); for child in child.children() { match child.tag_name().name() { "test" => { let mut t = Test::default(); let mut kind = PropertyKind::default(); parse_attrs!(child, { "name" => kind, "qual" => t.qual, "target" => t.target, "compare" => t.compare, }); t.value = kind.make_property(parse_expr( child .first_element_child() .ok_or_else(|| Error::InvalidFormat(format!("Empty test value")))?, )?); m.tests.push(t); } "edit" => { let mut e = Edit::default(); let mut kind = PropertyKind::default(); parse_attrs!(child, { "name" => kind, "mode" => e.mode, "binding" => e.binding, }); e.value = kind.make_property(parse_expr( child .first_element_child() .ok_or_else(|| Error::InvalidFormat(format!("Empty edit value")))?, )?); m.edits.push(e); } _ => {} } } ConfigPart::Match(m) } _ => { return Ok(None); } }; Ok(Some(part)) } fn parse_int_or_range(node: Node) -> Result { let mut texts = get_texts(&node); match node.tag_name().name() { "int" => Ok(IntOrRange::Int(try_text!(node).parse()?)), "range" => Ok(IntOrRange::Range( try_next!(texts, "Expect int").parse()?, try_next!(texts, "Expect int").parse()?, )), _ => Err(Error::InvalidFormat(format!("Expect IntOrRange"))), } } fn parse_expr(node: Node) -> Result { let mut exprs = get_exprs(&node); let mut texts = get_texts(&node); macro_rules! next { ($iter:expr) => { try_next!($iter, "Expect expression") }; } match node.tag_name().name() { "string" => Ok(Value::String(try_text!(node).into()).into()), "langset" => Ok(Value::LangSet(try_text!(node).into()).into()), "double" => Ok(Value::Double(try_text!(node).parse()?).into()), "int" => Ok(Value::Int(try_text!(node).parse()?).into()), "bool" => Ok(Value::Bool(try_text!(node).parse()?).into()), "const" => Ok(Value::Constant(try_text!(node).parse()?).into()), "matrix" => Ok(Expression::Matrix(Box::new([ next!(exprs)?, next!(exprs)?, next!(exprs)?, next!(exprs)?, ]))), "charset" => { let charset = node .children() .filter_map(|c| parse_int_or_range(c).ok()) .collect(); Ok(Value::CharSet(charset).into()) } "range" => Ok(Value::Range(next!(texts).parse()?, next!(texts).parse()?).into()), "name" => { let mut target = PropertyTarget::default(); parse_attrs!(node, { "target" => target, }); let kind = try_text!(node).parse()?; Ok(Value::Property(target, kind).into()) } name => { if let Ok(list_op) = name.parse() { Ok(Expression::List( list_op, exprs.collect::>>()?, )) } else if let Ok(unary_op) = name.parse() { Ok(Expression::Unary(unary_op, Box::new(next!(exprs)?))) } else if let Ok(binary_op) = name.parse() { Ok(Expression::Binary( binary_op, Box::new([next!(exprs)?, next!(exprs)?]), )) } else if let Ok(ternary_op) = name.parse() { Ok(Expression::Ternary( ternary_op, Box::new([next!(exprs)?, next!(exprs)?, next!(exprs)?]), )) } else { Err(Error::InvalidFormat(format!( "Unknown expression: {:?}", node.tag_name(), ))) } } } } fn get_exprs<'a>(node: &'a Node) -> impl Iterator> + 'a { node.children().filter_map(|n| { if n.is_element() { Some(parse_expr(n)) } else { None } }) } fn get_texts<'a>(node: &'a Node) -> impl Iterator { node.children() .filter_map(|n| if n.is_element() { n.text() } else { None }) } #[cfg(test)] mod tests { use super::*; macro_rules! make_parse_failed_test { ($name:ident, $test_fn:ident, $text:expr,) => { #[test] #[should_panic] fn $name() { let doc = roxmltree::Document::parse($text).expect("Parsing xml"); let node = doc.root_element(); $test_fn(node).expect("Run parse"); } }; } macro_rules! make_parse_test { ($name:ident, $test_fn:ident, $text:expr, $value:expr,) => { #[test] fn $name() { let doc = roxmltree::Document::parse($text).expect("Parsing xml"); let node = doc.root_element(); let ret = $test_fn(node).expect("Run parse"); let expected = $value; k9::assert_equal!(expected, ret); } }; } make_parse_test!( test_parse_charset, parse_expr, "0123", Expression::from(vec![IntOrRange::Range(0, 123)]), ); make_parse_test!( test_parse_int, parse_expr, "123", Expression::from(123), ); make_parse_failed_test!(test_parse_invalid_int, parse_expr, "123f",); make_parse_test!( test_parse_range, parse_expr, "010", Expression::from(Value::Range(0, 10)), ); make_parse_failed_test!( test_parse_invalid_range, parse_expr, "010", ); make_parse_test!( test_langset, parse_expr, "ko-KR", Expression::from(Value::LangSet("ko-KR".into())), ); } fontconfig-parser-0.5.7/src/types/alias.rs000064400000000000000000000014561046102023000166630ustar 00000000000000/// Alias elements provide a shorthand notation for the set of common match operations needed to substitute one font family for another. They contain a element followed by optional , and elements. Fonts matching the element are edited to prepend the list of ed families before the matching , append the able families after the matching and append the families to the end of the family list. #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Alias { /// alias name pub alias: String, /// `` pub prefer: Vec, /// `` pub accept: Vec, /// `` pub default: Vec, } fontconfig-parser-0.5.7/src/types/config.rs000064400000000000000000000003561046102023000170350ustar 00000000000000use crate::{Int, IntOrRange}; #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Config { pub blanks: Vec, pub rescans: Vec, } fontconfig-parser-0.5.7/src/types/constant.rs000064400000000000000000000067371046102023000174320ustar 00000000000000use crate::PropertyKind; macro_rules! define_constant { ( $( $variant:ident = $(($ty:ident, $value:expr),)+ )+ ) => { #[derive(Copy, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Constant { $( $variant, )+ } impl Constant { pub fn get_value(self, kind: PropertyKind) -> Option { match (self, kind) { $( $( (Constant::$variant, PropertyKind::$ty) => Some($value), )+ )+ _ => None, } } } }; } define_constant! { Thin = (Weight, 0), Extralight = (Weight, 40), Ultralight = (Weight, 40), Light = (Weight, 50), Demilight = (Weight, 55), Semilight = (Weight, 55), Book = (Weight, 75), Regular = (Weight, 80), Normal = (Weight, 80), (Width, 100), Medium = (Weight, 100), Demibold = (Weight, 180), Semibold = (Weight, 180), Bold = (Weight, 200), Extrabold = (Weight, 205), Black = (Weight, 210), Heavy = (Weight, 210), Roman = (Slant, 0), Italic = (Slant, 100), Oblique = (Slant, 110), Ultracondensed = (Width, 50), Extracondensed = (Width, 63), Condensed = (Width, 75), Semicondensed = (Width, 87), // Merged into above Normal // Normal = (Width, 100), Semiexpanded = (Width, 113), Expanded = (Width, 125), Extraexpanded = (Width, 150), Ultraexpanded = (Width, 200), Proportional = (Spacing, 0), Dual = (Spacing, 90), Mono = (Spacing, 100), Charcell = (Spacing, 110), Unknown = (Rgba, 0), Rgb = (Rgba, 1), Bgr = (Rgba, 2), Vrgb = (Rgba, 3), Vbgr = (Rgba, 4), None = (Rgba, 5), Lcdnone = (Lcdfilter, 0), Lcddefault = (Lcdfilter, 1), Lcdlight = (Lcdfilter, 2), Lcdlegacy = (Lcdfilter, 3), Hintnone = (HintStyle, 0), Hintslight = (HintStyle, 1), Hintmedium = (HintStyle, 2), Hintfull = (HintStyle, 3), } parse_enum! { Constant, (Thin, "thin"), (Extralight, "extralight"), (Ultralight, "ultralight"), (Light, "light"), (Demilight, "demilight"), (Semilight, "semilight"), (Book, "book"), (Regular, "regular"), (Normal, "normal"), (Medium, "medium"), (Demibold, "demibold"), (Semibold, "semibold"), (Bold, "bold"), (Extrabold, "extrabold"), (Black, "black"), (Heavy, "heavy"), (Roman, "roman"), (Italic, "italic"), (Oblique, "oblique"), (Ultracondensed, "ultracondensed"), (Extracondensed, "extracondensed"), (Condensed, "condensed"), (Semicondensed, "semicondensed"), (Semiexpanded, "semiexpanded"), (Expanded, "expanded"), (Extraexpanded, "extraexpanded"), (Ultraexpanded, "ultraexpanded"), (Proportional, "proportional"), (Dual, "dual"), (Mono, "mono"), (Charcell, "charcell"), (Unknown, "unknown"), (Rgb, "rgb"), (Bgr, "bgr"), (Vrgb, "vrgb"), (Vbgr, "vbgr"), (None, "none"), (Lcdnone, "lcdnone"), (Lcddefault, "lcddefault"), (Lcdlight, "lcdlight"), (Lcdlegacy, "lcdlegacy"), (Hintnone, "hintnone"), (Hintslight, "hintslight"), (Hintmedium, "hintmedium"), (Hintfull, "hintfull"), } #[test] fn convert_test() { assert_eq!(Constant::Roman.get_value(PropertyKind::Slant).unwrap(), 0,); } fontconfig-parser-0.5.7/src/types/dir.rs000064400000000000000000000125031046102023000163430ustar 00000000000000#[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Dir { pub prefix: DirPrefix, pub salt: String, pub path: String, } #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct CacheDir { pub prefix: DirPrefix, pub path: String, } #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Include { pub prefix: DirPrefix, pub ignore_missing: bool, pub path: String, } /// This element contains a directory name where will be mapped as the path 'as-path' in cached information. This is useful if the directory name is an alias (via a bind mount or symlink) to another directory in the system for which cached font information is likely to exist. /// 'salt' property affects to determine cache filename as same as [`Dir`] element. #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct RemapDir { pub prefix: DirPrefix, pub as_path: String, pub salt: String, pub path: String, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum DirPrefix { Default, Cwd, Xdg, Relative, } pub enum PrefixBehavior { Config, Cwd, Xdg, Relative, } parse_enum! { DirPrefix, (Default, "default"), (Cwd, "cwd"), (Xdg, "xdg"), (Relative, "relative"), } impl Default for DirPrefix { fn default() -> Self { DirPrefix::Default } } /// Get the location to user home directory. /// /// This implementation follows `FcConfigHome` function of freedesktop.org's /// Fontconfig library. #[allow(unused_mut, clippy::let_and_return)] fn config_home() -> Result { let mut home = std::env::var("HOME"); #[cfg(target_os = "windows")] { home = home.or_else(|_| std::env::var("USERPROFILE")); } home } /// Given a relative path to a config file, this function returns /// the complete file name to load. /// /// This is a simplified version of `FcConfigGetFilename` from the Fontconfig /// library. fn config_get_file_name(p: &std::path::PathBuf) -> std::path::PathBuf { if cfg!(target_os = "windows") { // TODO: get config file path properly for Windows return p.clone(); } else { std::path::Path::new("/etc/fonts").join(p) } } fn expand_tilde(path: &String) -> std::path::PathBuf { let parsed_path = std::path::Path::new(path); if let Ok(stripped_path) = parsed_path.strip_prefix("~") { let home = config_home().unwrap_or("/".to_string()); std::path::Path::new(&home).join(stripped_path) } else { parsed_path.into() } } macro_rules! define_calculate_path { ($ty:ident, $xdg_env:expr, $xdg_fallback:expr, $default_prefix_behavior:expr) => { impl $ty { /// Environment variable name which used `xdg` prefix pub const XDG_ENV: &'static str = $xdg_env; /// Fallback path when `XDG_ENV` is not exists pub const XDG_FALLBACK_PATH: &'static str = $xdg_fallback; const DEFAULT_PREFIX_BEHAVIOR: PrefixBehavior = $default_prefix_behavior; fn get_prefix_behavior(prefix: DirPrefix) -> PrefixBehavior { match prefix { DirPrefix::Default => Self::DEFAULT_PREFIX_BEHAVIOR, DirPrefix::Cwd => PrefixBehavior::Cwd, DirPrefix::Xdg => PrefixBehavior::Xdg, DirPrefix::Relative => PrefixBehavior::Relative, } } /// Calculate actual path pub fn calculate_path + ?Sized>( &self, config_file_path: &P, ) -> std::path::PathBuf { let expanded_path = expand_tilde(&self.path); if expanded_path.is_absolute() { return expanded_path; } let prefix = Self::get_prefix_behavior(self.prefix); match prefix { PrefixBehavior::Config => config_get_file_name(&expanded_path), PrefixBehavior::Cwd => std::path::Path::new(".").join(expanded_path), PrefixBehavior::Relative => match config_file_path.as_ref().parent() { Some(parent) => parent.join(expanded_path), None => std::path::Path::new(".").join(expanded_path), }, PrefixBehavior::Xdg => { let xdg_path = std::env::var($xdg_env).unwrap_or_else(|_| $xdg_fallback.into()); expand_tilde(&xdg_path).join(expanded_path) } } } } }; } define_calculate_path!(Dir, "XDG_DATA_HOME", "~/.local/share", PrefixBehavior::Cwd); define_calculate_path!(CacheDir, "XDG_CACHE_HOME", "~/.cache", PrefixBehavior::Cwd); define_calculate_path!( Include, "XDG_CONFIG_HOME", "~/.config", PrefixBehavior::Config ); define_calculate_path!( RemapDir, "XDG_CONFIG_HOME", "~/.config", PrefixBehavior::Cwd ); fontconfig-parser-0.5.7/src/types/document.rs000064400000000000000000000137131046102023000174070ustar 00000000000000use crate::parser::parse_config; use crate::*; use std::collections::{BinaryHeap, HashSet}; use std::fs; use std::path::{Path, PathBuf}; #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum ConfigPart { Description(String), SelectFont(SelectFont), Dir(Dir), CacheDir(CacheDir), Include(Include), Match(Match), Config(Config), Alias(Alias), RemapDir(RemapDir), ResetDirs, } #[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FontConfig { pub select_fonts: Vec, pub dirs: Vec, pub cache_dirs: Vec, pub remap_dirs: Vec, pub matches: Vec, pub config: Config, pub aliases: Vec, pub config_files: HashSet, } impl FontConfig { pub fn merge_config + ?Sized>(&mut self, config_path: &P) -> Result<()> { match std::fs::canonicalize(&config_path) { Ok(p) => { if !self.config_files.insert(std::path::PathBuf::from(p)) { return Ok(()); } } Err(err) => return Err(Error::IoError(err)), } let config = fs::read_to_string(config_path.as_ref())?; let xml_doc = roxmltree::Document::parse_with_options( &config, roxmltree::ParsingOptions { allow_dtd: true, ..Default::default() }, )?; for part in parse_config(&xml_doc)? { match part? { ConfigPart::Alias(alias) => self.aliases.push(alias), ConfigPart::Config(mut c) => { self.config.rescans.append(&mut c.rescans); self.config.blanks.append(&mut c.blanks); } ConfigPart::Description(_) => {} ConfigPart::Dir(dir) => self.dirs.push(DirData { path: dir.calculate_path(config_path), salt: dir.salt, }), ConfigPart::CacheDir(dir) => self.cache_dirs.push(dir.calculate_path(config_path)), ConfigPart::Match(m) => self.matches.push(m), ConfigPart::ResetDirs => self.dirs.clear(), ConfigPart::SelectFont(s) => self.select_fonts.push(s), ConfigPart::RemapDir(remap) => self.remap_dirs.push(RemapDirData { path: remap.calculate_path(config_path), salt: remap.salt, as_path: remap.as_path, }), ConfigPart::Include(dir) => { let include_path = dir.calculate_path(config_path); match self.include(&include_path) { Ok(_) => {} #[allow(unused_variables)] Err(err) => { if !dir.ignore_missing { #[cfg(feature = "log")] log::warn!("Failed to include {}: {}", include_path.display(), err); } } } } } } Ok(()) } fn include(&mut self, include_path: &Path) -> Result<()> { let meta = fs::metadata(include_path)?; let ty = meta.file_type(); // fs::metadata follow symlink so ty is never symlink if ty.is_file() { self.merge_config(include_path)?; } else if ty.is_dir() { let dir = std::fs::read_dir(include_path)?; let config_paths = dir .filter_map(|entry| { let entry = entry.ok()?; let ty = entry.file_type().ok()?; if ty.is_file() || ty.is_symlink() { Some(entry.path()) } else { None } }) .collect::>(); for config_path in config_paths { match self.merge_config(&config_path) { Ok(_) => {} #[allow(unused_variables)] Err(err) => { #[cfg(feature = "log")] log::warn!("Failed to merge {}: {}", config_path.display(), err); } } } } Ok(()) } } macro_rules! define_config_part_from { ($($f:ident,)+) => { $( impl From<$f> for ConfigPart { fn from(v: $f) -> Self { ConfigPart::$f(v) } } )+ }; } define_config_part_from! { SelectFont, Dir, CacheDir, Include, Match, Config, Alias, RemapDir, } #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Final dir data pub struct DirData { /// dir path pub path: PathBuf, /// 'salt' property affects to determine cache filename. this is useful for example when having different fonts sets on same path at container and share fonts from host on different font path. pub salt: String, } #[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Final remap-dirs data pub struct RemapDirData { /// dir path will be mapped as the path [`as-path`](Self::as_path) in cached information. This is useful if the directory name is an alias (via a bind mount or symlink) to another directory in the system for which cached font information is likely to exist. pub path: PathBuf, /// 'salt' property affects to determine cache filename. this is useful for example when having different fonts sets on same path at container and share fonts from host on different font path. pub salt: String, // remapped path pub as_path: String, } fontconfig-parser-0.5.7/src/types/match_/edit.rs000064400000000000000000000023211046102023000177420ustar 00000000000000use crate::Property; #[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Edit { pub mode: EditMode, pub binding: EditBinding, pub value: Property, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum EditBinding { Strong, Weak, Same, } parse_enum! { EditBinding, (Strong, "strong"), (Weak, "weak"), (Same, "same"), } impl Default for EditBinding { fn default() -> Self { EditBinding::Weak } } #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum EditMode { Assign, AssignReplace, Prepend, PrependFirst, Append, AppendLast, Delete, DeleteAll, } parse_enum! { EditMode, (Assign, "assign"), (AssignReplace, "assign_replace"), (Prepend, "prepend"), (PrependFirst, "prepend_first"), (Append, "append"), (AppendLast, "append_last"), (Delete, "delete"), (DeleteAll, "delete_all"), } impl Default for EditMode { fn default() -> Self { EditMode::Assign } } fontconfig-parser-0.5.7/src/types/match_/test.rs000064400000000000000000000047461046102023000200110ustar 00000000000000use crate::Property; /// This element contains a single value which is compared with the target ('pattern', 'font', 'scan' or 'default') property "property" (substitute any of the property names seen above). /// 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", "more_eq", "contains" or "not_contains". /// 'qual' may either be the default, "any", in which case the match succeeds if any value associated with the property matches the test value, /// or "all", in which case all of the values associated with the property must match the test value. 'ignore-blanks' takes a boolean value. /// if 'ignore-blanks' is set "true", any blanks in the string will be ignored on its comparison. this takes effects only when compare="eq" or compare="not_eq". /// When used in a element, the target= attribute in the element selects between matching the original pattern or the font. /// "default" selects whichever target the outer element has selected. #[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Test { pub qual: TestQual, pub target: TestTarget, pub compare: TestCompare, pub value: Property, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TestTarget { Default, Pattern, Font, Scan, } parse_enum! { TestTarget, (Default, "default"), (Pattern, "pattern"), (Font, "font"), (Scan, "scan"), } impl Default for TestTarget { fn default() -> Self { TestTarget::Default } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TestCompare { Eq, NotEq, Less, LessEq, More, MoreEq, Contains, NotContains, } parse_enum! { TestCompare, (Eq, "eq"), (NotEq, "not_eq"), (Less, "less"), (LessEq, "less_eq"), (More, "more"), (MoreEq, "more_eq"), (Contains, "contains"), (NotContains, "not_contains"), } impl Default for TestCompare { fn default() -> Self { TestCompare::Eq } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TestQual { Any, All, } parse_enum! { TestQual, (Any, "any"), (All, "all"), } impl Default for TestQual { fn default() -> Self { TestQual::Any } } fontconfig-parser-0.5.7/src/types/match_.rs000064400000000000000000000012341046102023000170170ustar 00000000000000mod edit; mod test; pub use self::edit::*; pub use self::test::*; #[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Match { pub target: MatchTarget, pub tests: Vec, pub edits: Vec, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum MatchTarget { Pattern, Font, Scan, } parse_enum! { MatchTarget, (Pattern, "pattern"), (Font, "font"), (Scan, "scan"), } impl Default for MatchTarget { fn default() -> Self { MatchTarget::Pattern } } fontconfig-parser-0.5.7/src/types/property.rs000064400000000000000000000130211046102023000174450ustar 00000000000000use crate::{Expression, Value}; macro_rules! define_property { ( $( $(#[$attr:meta])* $variant:ident($value_ty:ident, $name:expr), )+ ) => { #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Property { $( $(#[$attr])* $variant(Expression), )+ Dynamic(String, Expression), } impl Property { pub fn kind(&self) -> PropertyKind { match self { $( Property::$variant(_) => PropertyKind::$variant, )+ Property::Dynamic(s, _) => PropertyKind::Dynamic(s.clone()), } } } #[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum PropertyKind { $( $(#[$attr])* $variant, )+ Dynamic(String), } parse_enum! { PropertyKind, $( ($variant, $name), )+ |s| Ok(PropertyKind::Dynamic(s.into())), } impl PropertyKind { pub fn make_property(self, expr: Expression) -> Property { match self { $( PropertyKind::$variant => Property::$variant(expr), )+ PropertyKind::Dynamic(name) => Property::Dynamic(name.clone(), expr), } } } }; } define_property! { /// Font family names Family(String, "family"), /// Languages corresponding to each family FamilyLang(String, "familylang"), /// Font style. Overrides weight and slant Style(String, "style"), /// Languages corresponding to each style StyleLang(String, "stylelang"), /// Font full names (often includes style) FullName(String, "fullname"), /// Languages corresponding to each fullname FullNameLang(String, "fullnamelang"), /// Italic, oblique or roman Slant(Int, "slant"), /// Light, medium, demibold, bold or black Weight(Int, "weight"), /// Point size Size(Double, "size"), /// Condensed, normal or expanded Width(Int, "width"), /// Stretches glyphs horizontally before hinting Aspect(Double, "aspect"), /// Pixel size PixelSize(Double, "pixelsize"), /// Proportional, dual-width, monospace or charcell Spacing(Int, "spacing"), /// Font foundry name Foundry(String, "foundry"), /// Whether glyphs can be antialiased Antialias(Bool, "antialias"), /// Whether the rasterizer should use hinting Hinting(Bool, "hinting"), /// Automatic hinting style HintStyle(Int, "hintstyle"), /// Automatic hinting style VerticalLayout(Bool, "verticallayout"), /// Use autohinter instead of normal hinter AutoHint(Bool, "autohint"), /// Use font global advance data (deprecated) GlobalAdvance(Bool, "globaladvance"), /// The filename holding the font File(String, "file"), /// The index of the font within the file Index(Int, "index"), // TODO: // /// Use the specified FreeType face object // Ftface(FT_Face), /// Which rasterizer is in use (deprecated) Rasterizer(String, "rasterizer"), /// Whether the glyphs are outlines Outline(Bool, "outline"), /// Whether glyphs can be scaled Scalable(Bool, "scalable"), /// Whether any glyphs have color Color(Bool, "color"), /// Scale factor for point->pixel conversions (deprecated) Scale(Double, "scale"), /// Target dots per inch Dpi(Double, "dpi"), /// unknown, rgb, bgr, vrgb, vbgr, none - subpixel geometry Rgba(Int, "rgba"), /// Type of LCD filter Lcdfilter(Int, "lcdfilter"), /// Eliminate leading from line spacing Minspace(Bool, "minspace"), /// Unicode chars encoded by the font Charset(CharSet, "charset"), /// List of RFC-3066-style languages this font supports Lang(String, "lang"), /// Version number of the font Fontversion(Int, "fontversion"), /// List of layout capabilities in the font Capability(String, "capability"), /// String name of the font format Fontformat(String, "fontformat"), /// Rasterizer should synthetically embolden the font Embolden(Bool, "embolden"), /// Use the embedded bitmap instead of the outline Embeddedbitmap(Bool, "embeddedbitmap"), /// Whether the style is a decorative variant Decorative(Bool, "decorative"), /// List of the feature tags in OpenType to be enabled Fontfeatures(String, "fontfeatures"), /// Language name to be used for the default value of familylang, stylelang, and fullnamelang Namelang(String, "namelang"), /// String Name of the running program Prgname(String, "prgname"), /// Font family name in PostScript Postscriptname(String, "postscriptname"), /// Whether the font has hinting Fonthashint(Bool, "fonthashint"), /// Order number of the font Order(Int, "order"), // custom Matrix(Matrix, "matrix"), PixelSizeFixupFactor(Double, "pixelsizefixupfactor"), ScalingNotNeeded(Bool, "scalingnotneeded"), } impl Default for Property { fn default() -> Self { Property::Family(Expression::Simple(Value::String(String::default()))) } } impl Default for PropertyKind { fn default() -> Self { PropertyKind::Family } } fontconfig-parser-0.5.7/src/types/selectfont.rs000064400000000000000000000006411046102023000177330ustar 00000000000000use crate::Property; #[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct SelectFont { pub rejects: Vec, pub accepts: Vec, } #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum FontMatch { Glob(String), Pattern(Vec), } fontconfig-parser-0.5.7/src/types/value.rs000064400000000000000000000076051046102023000167100ustar 00000000000000use crate::{Constant, IntOrRange, PropertyKind}; pub type Bool = bool; pub type Int = u32; pub type Double = f64; #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum ListOp { Times, Divide, Or, And, Plus, Minus, } parse_enum! { ListOp, (Times, "times"), (Divide, "divide"), (Or, "or"), (And, "and"), (Plus, "plus"), (Minus, "minus"), } #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum UnaryOp { Not, // these operator not exists in document page but exists in dtd Cecil, Floor, Round, Trunc, } parse_enum! { UnaryOp, (Not, "not"), (Cecil, "cecil"), (Floor, "floor"), (Round, "round"), (Trunc, "trunc"), } #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum BinaryOp { Eq, NotEq, Less, LessEq, More, MoreEq, Contains, NotContains, } parse_enum! { BinaryOp, (Eq, "eq"), (NotEq, "not_eq"), (Less, "less"), (LessEq, "less_eq"), (More, "more"), (MoreEq, "more_eq"), (Contains, "contains"), (NotContains, "not_contains"), } #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TernaryOp { If, } parse_enum! { TernaryOp, (If, "if"), } #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Expression { Simple(Value), Unary(UnaryOp, Box), Binary(BinaryOp, Box<[Self; 2]>), Ternary(TernaryOp, Box<[Self; 3]>), List(ListOp, Vec), Matrix(Box<[Self; 4]>), } #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum PropertyTarget { Default, Font, Pattern, } parse_enum! { PropertyTarget, (Default, "default"), (Font, "font"), (Pattern, "pattern"), } impl Default for PropertyTarget { fn default() -> Self { PropertyTarget::Default } } pub type CharSet = Vec; /// Runtime typed fontconfig value #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Value { /// `0` Int(Int), /// `1.5` Double(Double), /// `str` String(String), /// `hintslight` Constant(Constant), /// `false` Bool(Bool), /// This element holds the two [`Value::Int`] elements of a range representation. Range(Int, Int), /// This element holds at least one [`Value::String`] element of a RFC-3066-style languages or more. LangSet(String), /// This element holds at least one [`Value::Int`] element of an Unicode code point or more. CharSet(CharSet), /// `pixelsize` Property(PropertyTarget, PropertyKind), } macro_rules! from_value { ($($name:ident,)+) => { $( impl From<$name> for Value { fn from(v: $name) -> Value { Value::$name(v) } } )+ }; } from_value! { Int, Bool, Double, Constant, CharSet, } impl<'a> From<&'a str> for Value { fn from(s: &'a str) -> Self { Value::String(s.into()) } } impl From for Value { fn from(s: String) -> Self { Value::String(s) } } impl From<(PropertyTarget, PropertyKind)> for Value { fn from((target, kind): (PropertyTarget, PropertyKind)) -> Self { Value::Property(target, kind) } } impl From for Expression where Value: From, { fn from(v: V) -> Self { Expression::Simple(Value::from(v)) } } fontconfig-parser-0.5.7/src/types.rs000064400000000000000000000007331046102023000155670ustar 00000000000000mod alias; mod config; mod constant; mod dir; mod document; mod match_; mod property; mod selectfont; mod value; #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(untagged))] pub enum IntOrRange { Int(Int), Range(Int, Int), } pub use self::{ alias::*, config::*, constant::*, dir::*, document::*, match_::*, property::*, selectfont::*, value::*, }; fontconfig-parser-0.5.7/src/util.rs000064400000000000000000000044441046102023000154030ustar 00000000000000macro_rules! try_next { ($iter:expr, $($tt:tt)*) => { match $iter.next() { Some(e) => e, None => return Err(crate::Error::InvalidFormat(format!($($tt)*))), } } } macro_rules! try_text { ($node:expr) => { match $node.text() { Some(t) => t, None => return Err(crate::Error::InvalidFormat("Can't get text".into())), } }; } macro_rules! parse_attrs_opt { ($node:expr, { $($key:expr => $lvalue:expr,)+ } $(, { $($str_key:expr => $str_lvalue:expr,)+ } )?) => { for attr in $node.attributes() { match attr.name() { $( $key => $lvalue = attr.value().parse().ok()?, )+ $( $( $str_key => $str_lvalue = attr.value().into(), )+ )? _ => {} } } }; } macro_rules! parse_attrs { ($node:expr, { $($key:expr => $lvalue:expr,)+ } $(, { $($str_key:expr => $str_lvalue:expr,)+ } )?) => { for attr in $node.attributes() { match attr.name() { $( $key => $lvalue = attr.value().parse()?, )+ $( $( $str_key => $str_lvalue = attr.value().into(), )+ )? _ => {} } } }; } macro_rules! parse_enum { ( $ty:ty, $( ($variant:ident, $text:expr), )+ |$arg:ident| $fallback:expr, ) => { impl core::str::FromStr for $ty { type Err = crate::Error; fn from_str($arg: &str) -> crate::Result<$ty> { match $arg { $( $text => Ok(<$ty>::$variant), )+ _ => { $fallback } } } } }; ( $ty:ty, $( ($variant:ident, $text:expr), )+ ) => { parse_enum! { $ty, $( ($variant, $text), )+ |s| Err(crate::Error::ParseEnumError(core::any::type_name::<$ty>(), s.into())), } }; } fontconfig-parser-0.5.7/test-conf/conf.d/00-nixos-cache.conf000064400000000000000000000017341046102023000216260ustar 00000000000000 /nix/store/i1yhgnfvaihqzs079lcx4zjnrdzcvaak-noto-fonts-2020-01-23 /nix/store/4glxr7vyi0a68c6vgz2gn5c2ljkl7x37-noto-fonts-cjk-2.001 /nix/store/cwbgs1zpk0pb8jjldgdqmvmdgl3zd5vb-noto-fonts-emoji-2.028 /nix/store/imnk1n6llkh089xgzqyqpr6yw9qz9b3z-d2codingfont-1.3.2 /nix/store/41qphrp1ksc1fqm01i7khs30n1zjl56r-fira-code-5.2 /nix/store/391caw6m9k1fv4fzhgjabkqni7hf1hvj-fira-code-symbols-20160811 /nix/store/ah9gyp7rxak9ig2q829myn6172jn302f-hack-font-3.003 /nix/store/314zk48rhqbprza0i2nxch27x0h0jaim-sarasa-gothic-0.32.9 /nix/store/fn89l2wvilp6p0jj2dgk7iv8p9hcyqbw-nerdfonts-2.1.0 /nix/store/wnv4za94mh0li42qz0da1za483jmz5kh-mplus-063a /nix/store/3yd10s1cq2xjqq3f1nlgjmvcwpbh74sf-fc-cache fontconfig-parser-0.5.7/test-conf/conf.d/00-nixos-cache.conf.json000064400000000000000000000031641046102023000225750ustar 00000000000000[ { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/i1yhgnfvaihqzs079lcx4zjnrdzcvaak-noto-fonts-2020-01-23" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/4glxr7vyi0a68c6vgz2gn5c2ljkl7x37-noto-fonts-cjk-2.001" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/cwbgs1zpk0pb8jjldgdqmvmdgl3zd5vb-noto-fonts-emoji-2.028" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/imnk1n6llkh089xgzqyqpr6yw9qz9b3z-d2codingfont-1.3.2" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/41qphrp1ksc1fqm01i7khs30n1zjl56r-fira-code-5.2" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/391caw6m9k1fv4fzhgjabkqni7hf1hvj-fira-code-symbols-20160811" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/ah9gyp7rxak9ig2q829myn6172jn302f-hack-font-3.003" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/314zk48rhqbprza0i2nxch27x0h0jaim-sarasa-gothic-0.32.9" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/fn89l2wvilp6p0jj2dgk7iv8p9hcyqbw-nerdfonts-2.1.0" } }, { "Dir": { "prefix": "Default", "salt": "", "path": "/nix/store/wnv4za94mh0li42qz0da1za483jmz5kh-mplus-063a" } }, { "CacheDir": { "prefix": "Default", "path": "/nix/store/3yd10s1cq2xjqq3f1nlgjmvcwpbh74sf-fc-cache" } } ] fontconfig-parser-0.5.7/test-conf/conf.d/10-hinting-slight.conf000064400000000000000000000011541046102023000223520ustar 00000000000000 Set hintslight to hintstyle hintslight fontconfig-parser-0.5.7/test-conf/conf.d/10-hinting-slight.conf.json000064400000000000000000000006141046102023000233220ustar 00000000000000[ { "Description": "Set hintslight to hintstyle" }, { "Match": { "target": "Pattern", "tests": [], "edits": [ { "mode": "Append", "binding": "Weak", "value": { "HintStyle": { "Simple": { "Constant": "Hintslight" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/10-nixos-rendering.conf000064400000000000000000000012251046102023000225340ustar 00000000000000 true false hintslight true rgb lcddefault fontconfig-parser-0.5.7/test-conf/conf.d/10-nixos-rendering.conf.json000064400000000000000000000026671046102023000235170ustar 00000000000000[ { "Match": { "target": "Pattern", "tests": [], "edits": [ { "mode": "Append", "binding": "Weak", "value": { "Hinting": { "Simple": { "Bool": true } } } }, { "mode": "Append", "binding": "Weak", "value": { "AutoHint": { "Simple": { "Bool": false } } } }, { "mode": "Append", "binding": "Weak", "value": { "HintStyle": { "Simple": { "Constant": "Hintslight" } } } }, { "mode": "Append", "binding": "Weak", "value": { "Antialias": { "Simple": { "Bool": true } } } }, { "mode": "Append", "binding": "Weak", "value": { "Rgba": { "Simple": { "Constant": "Rgb" } } } }, { "mode": "Append", "binding": "Weak", "value": { "Lcdfilter": { "Simple": { "Constant": "Lcddefault" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/10-scale-bitmap-fonts.conf000064400000000000000000000040241046102023000231110ustar 00000000000000 Bitmap scaling false pixelsize pixelsize false false true pixelsizefixupfactor 1.2 pixelsizefixupfactor 0.8 true 1.0 false 1.0 matrix pixelsizefixupfactor 0 0 pixelsizefixupfactor size pixelsizefixupfactor fontconfig-parser-0.5.7/test-conf/conf.d/10-scale-bitmap-fonts.conf.json000064400000000000000000000151551046102023000240700ustar 00000000000000[ { "Description": "Bitmap scaling" }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Outline": { "Simple": { "Bool": false } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "PixelSizeFixupFactor": { "List": [ "Divide", [ { "Simple": { "Property": [ "Pattern", "PixelSize" ] } }, { "Simple": { "Property": [ "Font", "PixelSize" ] } } ] ] } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Outline": { "Simple": { "Bool": false } } } }, { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Scalable": { "Simple": { "Bool": false } } } }, { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Hinting": { "Simple": { "Bool": true } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "ScalingNotNeeded": { "List": [ "And", [ { "Binary": [ "Less", [ { "Simple": { "Property": [ "Default", "PixelSizeFixupFactor" ] } }, { "Simple": { "Double": 1.2 } } ] ] }, { "Binary": [ "More", [ { "Simple": { "Property": [ "Default", "PixelSizeFixupFactor" ] } }, { "Simple": { "Double": 0.8 } } ] ] } ] ] } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "ScalingNotNeeded": { "Simple": { "Bool": true } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "PixelSizeFixupFactor": { "Simple": { "Double": 1 } } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Outline": { "Simple": { "Bool": false } } } }, { "qual": "Any", "target": "Default", "compare": "NotEq", "value": { "PixelSizeFixupFactor": { "Simple": { "Double": 1 } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Matrix": { "List": [ "Times", [ { "Simple": { "Property": [ "Default", "Matrix" ] } }, { "Matrix": [ { "Simple": { "Property": [ "Default", "PixelSizeFixupFactor" ] } }, { "Simple": { "Double": 0 } }, { "Simple": { "Double": 0 } }, { "Simple": { "Property": [ "Default", "PixelSizeFixupFactor" ] } } ] } ] ] } } }, { "mode": "Assign", "binding": "Weak", "value": { "Size": { "List": [ "Divide", [ { "Simple": { "Property": [ "Default", "Size" ] } }, { "Simple": { "Property": [ "Default", "PixelSizeFixupFactor" ] } } ] ] } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/20-unhint-small-vera.conf000064400000000000000000000025411046102023000227720ustar 00000000000000 Disable hinting for Bitstream Vera fonts when the size is less than 8ppem Bitstream Vera Sans 7.5 false Bitstream Vera Serif 7.5 false Bitstream Vera Sans Mono 7.5 false fontconfig-parser-0.5.7/test-conf/conf.d/20-unhint-small-vera.conf.json000064400000000000000000000051171046102023000237440ustar 00000000000000[ { "Description": "Disable hinting for Bitstream Vera fonts when the size is less than 8ppem" }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Bitstream Vera Sans" } } } }, { "qual": "Any", "target": "Default", "compare": "Less", "value": { "PixelSize": { "Simple": { "Double": 7.5 } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Hinting": { "Simple": { "Bool": false } } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Bitstream Vera Serif" } } } }, { "qual": "Any", "target": "Default", "compare": "Less", "value": { "PixelSize": { "Simple": { "Double": 7.5 } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Hinting": { "Simple": { "Bool": false } } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Bitstream Vera Sans Mono" } } } }, { "qual": "Any", "target": "Default", "compare": "Less", "value": { "PixelSize": { "Simple": { "Double": 7.5 } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Hinting": { "Simple": { "Bool": false } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/30-metric-aliases.conf000064400000000000000000000316621046102023000223350ustar 00000000000000 Set substitutions for similar/metric-compatible families Nimbus Sans L Helvetica Nimbus Sans Helvetica TeX Gyre Heros Helvetica Nimbus Sans Narrow Helvetica Narrow TeX Gyre Heros Cn Helvetica Narrow Nimbus Roman No9 L Times Nimbus Roman Times TeX Gyre Termes Times Nimbus Mono L Courier Nimbus Mono Courier Nimbus Mono PS Courier TeX Gyre Cursor Courier Avant Garde ITC Avant Garde Gothic URW Gothic L ITC Avant Garde Gothic URW Gothic ITC Avant Garde Gothic TeX Gyre Adventor ITC Avant Garde Gothic Bookman ITC Bookman URW Bookman L ITC Bookman Bookman URW ITC Bookman URW Bookman ITC Bookman TeX Gyre Bonum ITC Bookman Bookman Old Style ITC Bookman Zapf Chancery ITC Zapf Chancery URW Chancery L ITC Zapf Chancery Chancery URW ITC Zapf Chancery Z003 ITC Zapf Chancery TeX Gyre Chorus ITC Zapf Chancery URW Palladio L Palatino Palladio URW Palatino P052 Palatino TeX Gyre Pagella Palatino Palatino Linotype Palatino Century Schoolbook L New Century Schoolbook Century SchoolBook URW New Century Schoolbook C059 New Century Schoolbook TeX Gyre Schola New Century Schoolbook Century Schoolbook New Century Schoolbook Arimo Arial Liberation Sans Arial Liberation Sans Narrow Arial Narrow Albany Arial Albany AMT Arial Tinos Times New Roman Liberation Serif Times New Roman Thorndale Times New Roman Thorndale AMT Times New Roman Cousine Courier New Liberation Mono Courier New Cumberland Courier New Cumberland AMT Courier New Gelasio Georgia Caladea Cambria Carlito Calibri SymbolNeu Symbol Helvetica Arial Helvetica Narrow Arial Narrow Times Times New Roman Courier Courier New Arial Helvetica Arial Narrow Helvetica Narrow Times New Roman Times Courier New Courier Helvetica TeX Gyre Heros Helvetica Narrow TeX Gyre Heros Cn Times TeX Gyre Termes Courier TeX Gyre Cursor Courier Std Courier ITC Avant Garde Gothic TeX Gyre Adventor ITC Bookman Bookman Old Style TeX Gyre Bonum ITC Zapf Chancery TeX Gyre Chorus Palatino Palatino Linotype TeX Gyre Pagella New Century Schoolbook Century Schoolbook TeX Gyre Schola Arial Arimo Liberation Sans Albany Albany AMT Arial Narrow Liberation Sans Narrow Times New Roman Tinos Liberation Serif Thorndale Thorndale AMT Courier New Cousine Liberation Mono Cumberland Cumberland AMT Georgia Gelasio Cambria Caladea Calibri Carlito Symbol SymbolNeu fontconfig-parser-0.5.7/test-conf/conf.d/30-metric-aliases.conf.json000064400000000000000000000302431046102023000232770ustar 00000000000000[ { "Description": "Set substitutions for similar/metric-compatible families" }, { "Alias": { "alias": "Nimbus Sans L", "prefer": [], "accept": [], "default": [ "Helvetica" ] } }, { "Alias": { "alias": "Nimbus Sans", "prefer": [], "accept": [], "default": [ "Helvetica" ] } }, { "Alias": { "alias": "TeX Gyre Heros", "prefer": [], "accept": [], "default": [ "Helvetica" ] } }, { "Alias": { "alias": "Nimbus Sans Narrow", "prefer": [], "accept": [], "default": [ "Helvetica Narrow" ] } }, { "Alias": { "alias": "TeX Gyre Heros Cn", "prefer": [], "accept": [], "default": [ "Helvetica Narrow" ] } }, { "Alias": { "alias": "Nimbus Roman No9 L", "prefer": [], "accept": [], "default": [ "Times" ] } }, { "Alias": { "alias": "Nimbus Roman", "prefer": [], "accept": [], "default": [ "Times" ] } }, { "Alias": { "alias": "TeX Gyre Termes", "prefer": [], "accept": [], "default": [ "Times" ] } }, { "Alias": { "alias": "Nimbus Mono L", "prefer": [], "accept": [], "default": [ "Courier" ] } }, { "Alias": { "alias": "Nimbus Mono", "prefer": [], "accept": [], "default": [ "Courier" ] } }, { "Alias": { "alias": "Nimbus Mono PS", "prefer": [], "accept": [], "default": [ "Courier" ] } }, { "Alias": { "alias": "TeX Gyre Cursor", "prefer": [], "accept": [], "default": [ "Courier" ] } }, { "Alias": { "alias": "Avant Garde", "prefer": [], "accept": [], "default": [ "ITC Avant Garde Gothic" ] } }, { "Alias": { "alias": "URW Gothic L", "prefer": [], "accept": [], "default": [ "ITC Avant Garde Gothic" ] } }, { "Alias": { "alias": "URW Gothic", "prefer": [], "accept": [], "default": [ "ITC Avant Garde Gothic" ] } }, { "Alias": { "alias": "TeX Gyre Adventor", "prefer": [], "accept": [], "default": [ "ITC Avant Garde Gothic" ] } }, { "Alias": { "alias": "Bookman", "prefer": [], "accept": [], "default": [ "ITC Bookman" ] } }, { "Alias": { "alias": "URW Bookman L", "prefer": [], "accept": [], "default": [ "ITC Bookman" ] } }, { "Alias": { "alias": "Bookman URW", "prefer": [], "accept": [], "default": [ "ITC Bookman" ] } }, { "Alias": { "alias": "URW Bookman", "prefer": [], "accept": [], "default": [ "ITC Bookman" ] } }, { "Alias": { "alias": "TeX Gyre Bonum", "prefer": [], "accept": [], "default": [ "ITC Bookman" ] } }, { "Alias": { "alias": "Bookman Old Style", "prefer": [], "accept": [], "default": [ "ITC Bookman" ] } }, { "Alias": { "alias": "Zapf Chancery", "prefer": [], "accept": [], "default": [ "ITC Zapf Chancery" ] } }, { "Alias": { "alias": "URW Chancery L", "prefer": [], "accept": [], "default": [ "ITC Zapf Chancery" ] } }, { "Alias": { "alias": "Chancery URW", "prefer": [], "accept": [], "default": [ "ITC Zapf Chancery" ] } }, { "Alias": { "alias": "Z003", "prefer": [], "accept": [], "default": [ "ITC Zapf Chancery" ] } }, { "Alias": { "alias": "TeX Gyre Chorus", "prefer": [], "accept": [], "default": [ "ITC Zapf Chancery" ] } }, { "Alias": { "alias": "URW Palladio L", "prefer": [], "accept": [], "default": [ "Palatino" ] } }, { "Alias": { "alias": "Palladio URW", "prefer": [], "accept": [], "default": [ "Palatino" ] } }, { "Alias": { "alias": "P052", "prefer": [], "accept": [], "default": [ "Palatino" ] } }, { "Alias": { "alias": "TeX Gyre Pagella", "prefer": [], "accept": [], "default": [ "Palatino" ] } }, { "Alias": { "alias": "Palatino Linotype", "prefer": [], "accept": [], "default": [ "Palatino" ] } }, { "Alias": { "alias": "Century Schoolbook L", "prefer": [], "accept": [], "default": [ "New Century Schoolbook" ] } }, { "Alias": { "alias": "Century SchoolBook URW", "prefer": [], "accept": [], "default": [ "New Century Schoolbook" ] } }, { "Alias": { "alias": "C059", "prefer": [], "accept": [], "default": [ "New Century Schoolbook" ] } }, { "Alias": { "alias": "TeX Gyre Schola", "prefer": [], "accept": [], "default": [ "New Century Schoolbook" ] } }, { "Alias": { "alias": "Century Schoolbook", "prefer": [], "accept": [], "default": [ "New Century Schoolbook" ] } }, { "Alias": { "alias": "Arimo", "prefer": [], "accept": [], "default": [ "Arial" ] } }, { "Alias": { "alias": "Liberation Sans", "prefer": [], "accept": [], "default": [ "Arial" ] } }, { "Alias": { "alias": "Liberation Sans Narrow", "prefer": [], "accept": [], "default": [ "Arial Narrow" ] } }, { "Alias": { "alias": "Albany", "prefer": [], "accept": [], "default": [ "Arial" ] } }, { "Alias": { "alias": "Albany AMT", "prefer": [], "accept": [], "default": [ "Arial" ] } }, { "Alias": { "alias": "Tinos", "prefer": [], "accept": [], "default": [ "Times New Roman" ] } }, { "Alias": { "alias": "Liberation Serif", "prefer": [], "accept": [], "default": [ "Times New Roman" ] } }, { "Alias": { "alias": "Thorndale", "prefer": [], "accept": [], "default": [ "Times New Roman" ] } }, { "Alias": { "alias": "Thorndale AMT", "prefer": [], "accept": [], "default": [ "Times New Roman" ] } }, { "Alias": { "alias": "Cousine", "prefer": [], "accept": [], "default": [ "Courier New" ] } }, { "Alias": { "alias": "Liberation Mono", "prefer": [], "accept": [], "default": [ "Courier New" ] } }, { "Alias": { "alias": "Cumberland", "prefer": [], "accept": [], "default": [ "Courier New" ] } }, { "Alias": { "alias": "Cumberland AMT", "prefer": [], "accept": [], "default": [ "Courier New" ] } }, { "Alias": { "alias": "Gelasio", "prefer": [], "accept": [], "default": [ "Georgia" ] } }, { "Alias": { "alias": "Caladea", "prefer": [], "accept": [], "default": [ "Cambria" ] } }, { "Alias": { "alias": "Carlito", "prefer": [], "accept": [], "default": [ "Calibri" ] } }, { "Alias": { "alias": "SymbolNeu", "prefer": [], "accept": [], "default": [ "Symbol" ] } }, { "Alias": { "alias": "Helvetica", "prefer": [], "accept": [], "default": [ "Arial" ] } }, { "Alias": { "alias": "Helvetica Narrow", "prefer": [], "accept": [], "default": [ "Arial Narrow" ] } }, { "Alias": { "alias": "Times", "prefer": [], "accept": [], "default": [ "Times New Roman" ] } }, { "Alias": { "alias": "Courier", "prefer": [], "accept": [], "default": [ "Courier New" ] } }, { "Alias": { "alias": "Arial", "prefer": [], "accept": [], "default": [ "Helvetica" ] } }, { "Alias": { "alias": "Arial Narrow", "prefer": [], "accept": [], "default": [ "Helvetica Narrow" ] } }, { "Alias": { "alias": "Times New Roman", "prefer": [], "accept": [], "default": [ "Times" ] } }, { "Alias": { "alias": "Courier New", "prefer": [], "accept": [], "default": [ "Courier" ] } }, { "Alias": { "alias": "Helvetica", "prefer": [], "accept": [ "TeX Gyre Heros" ], "default": [] } }, { "Alias": { "alias": "Helvetica Narrow", "prefer": [], "accept": [ "TeX Gyre Heros Cn" ], "default": [] } }, { "Alias": { "alias": "Times", "prefer": [], "accept": [ "TeX Gyre Termes" ], "default": [] } }, { "Alias": { "alias": "Courier", "prefer": [], "accept": [ "TeX Gyre Cursor" ], "default": [] } }, { "Alias": { "alias": "Courier Std", "prefer": [], "accept": [ "Courier" ], "default": [] } }, { "Alias": { "alias": "ITC Avant Garde Gothic", "prefer": [], "accept": [ "TeX Gyre Adventor" ], "default": [] } }, { "Alias": { "alias": "ITC Bookman", "prefer": [], "accept": [ "Bookman Old Style", "TeX Gyre Bonum" ], "default": [] } }, { "Alias": { "alias": "ITC Zapf Chancery", "prefer": [], "accept": [ "TeX Gyre Chorus" ], "default": [] } }, { "Alias": { "alias": "Palatino", "prefer": [], "accept": [ "Palatino Linotype", "TeX Gyre Pagella" ], "default": [] } }, { "Alias": { "alias": "New Century Schoolbook", "prefer": [], "accept": [ "Century Schoolbook", "TeX Gyre Schola" ], "default": [] } }, { "Alias": { "alias": "Arial", "prefer": [], "accept": [ "Arimo", "Liberation Sans", "Albany", "Albany AMT" ], "default": [] } }, { "Alias": { "alias": "Arial Narrow", "prefer": [], "accept": [ "Liberation Sans Narrow" ], "default": [] } }, { "Alias": { "alias": "Times New Roman", "prefer": [], "accept": [ "Tinos", "Liberation Serif", "Thorndale", "Thorndale AMT" ], "default": [] } }, { "Alias": { "alias": "Courier New", "prefer": [], "accept": [ "Cousine", "Liberation Mono", "Cumberland", "Cumberland AMT" ], "default": [] } }, { "Alias": { "alias": "Georgia", "prefer": [], "accept": [ "Gelasio" ], "default": [] } }, { "Alias": { "alias": "Cambria", "prefer": [], "accept": [ "Caladea" ], "default": [] } }, { "Alias": { "alias": "Calibri", "prefer": [], "accept": [ "Carlito" ], "default": [] } }, { "Alias": { "alias": "Symbol", "prefer": [], "accept": [ "SymbolNeu" ], "default": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/40-nonlatin.conf000064400000000000000000000171371046102023000212570ustar 00000000000000 Set substitutions for non-Latin fonts Nazli serif Lotoos serif Mitra serif Ferdosi serif Badr serif Zar serif Titr serif Jadid serif Kochi Mincho serif AR PL SungtiL GB serif AR PL Mingti2L Big5 serif MS 明朝 serif NanumMyeongjo serif UnBatang serif Baekmuk Batang serif MgOpen Canonica serif Sazanami Mincho serif AR PL ZenKai Uni serif ZYSong18030 serif FreeSerif serif SimSun serif Arshia sans-serif Elham sans-serif Farnaz sans-serif Nasim sans-serif Sina sans-serif Roya sans-serif Koodak sans-serif Terafik sans-serif Kochi Gothic sans-serif AR PL KaitiM GB sans-serif AR PL KaitiM Big5 sans-serif MS ゴシック sans-serif NanumGothic sans-serif UnDotum sans-serif Baekmuk Dotum sans-serif MgOpen Modata sans-serif Sazanami Gothic sans-serif AR PL ShanHeiSun Uni sans-serif ZYSong18030 sans-serif FreeSans sans-serif NSimSun monospace ZYSong18030 monospace NanumGothicCoding monospace FreeMono monospace Homa fantasy Kamran fantasy Fantezi fantasy Tabassom fantasy IranNastaliq cursive Nafees Nastaleeq cursive Noto Sans Arabic UI system-ui Noto Sans Bengali UI system-ui Noto Sans Devanagari UI system-ui Noto Sans Gujarati UI system-ui Noto Sans Gurmukhi UI system-ui Noto Sans Kannada UI system-ui Noto Sans Khmer UI system-ui Noto Sans Lao UI system-ui Noto Sans Malayalam UI system-ui Noto Sans Myanmar UI system-ui Noto Sans Oriya UI system-ui Noto Sans Sinhala UI system-ui Noto Sans Tamil UI system-ui Noto Sans Telugu UI system-ui Noto Sans Thai UI system-ui Leelawadee UI system-ui Nirmala UI system-ui Yu Gothic UI system-ui Meiryo UI system-ui MS UI Gothic system-ui Khmer UI system-ui Lao UI system-ui Microsoft JhengHei UI system-ui Microsoft YaHei UI system-ui fontconfig-parser-0.5.7/test-conf/conf.d/40-nonlatin.conf.json000064400000000000000000000255361046102023000222310ustar 00000000000000[ { "Description": "Set substitutions for non-Latin fonts" }, { "Alias": { "alias": "Nazli", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Lotoos", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Mitra", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Ferdosi", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Badr", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Zar", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Titr", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Jadid", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Kochi Mincho", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "AR PL SungtiL GB", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "AR PL Mingti2L Big5", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "MS 明朝", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "NanumMyeongjo", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "UnBatang", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Baekmuk Batang", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "MgOpen Canonica", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Sazanami Mincho", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "AR PL ZenKai Uni", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "ZYSong18030", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "FreeSerif", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "SimSun", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Arshia", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Elham", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Farnaz", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Nasim", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Sina", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Roya", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Koodak", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Terafik", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Kochi Gothic", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "AR PL KaitiM GB", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "AR PL KaitiM Big5", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "MS ゴシック", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "NanumGothic", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "UnDotum", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Baekmuk Dotum", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "MgOpen Modata", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Sazanami Gothic", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "AR PL ShanHeiSun Uni", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "ZYSong18030", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "FreeSans", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "NSimSun", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "ZYSong18030", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "NanumGothicCoding", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "FreeMono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Homa", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Kamran", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Fantezi", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Tabassom", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "IranNastaliq", "prefer": [], "accept": [], "default": [ "cursive" ] } }, { "Alias": { "alias": "Nafees Nastaleeq", "prefer": [], "accept": [], "default": [ "cursive" ] } }, { "Alias": { "alias": "Noto Sans Arabic UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Bengali UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Devanagari UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Gujarati UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Gurmukhi UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Kannada UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Khmer UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Lao UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Malayalam UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Myanmar UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Oriya UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Sinhala UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Tamil UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Telugu UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans Thai UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Leelawadee UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Nirmala UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Yu Gothic UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Meiryo UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "MS UI Gothic", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Khmer UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Lao UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Microsoft JhengHei UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Microsoft YaHei UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/45-generic.conf000064400000000000000000000066421046102023000210550ustar 00000000000000 Set substitutions for emoji/math fonts Noto Color Emoji emoji Apple Color Emoji emoji Segoe UI Emoji emoji Twitter Color Emoji emoji EmojiOne Mozilla emoji Emoji Two emoji JoyPixels emoji Emoji One emoji Noto Emoji emoji Android Emoji emoji emoji und-zsye und-zsye emoji emoji XITS Math math STIX Two Math math Cambria Math math Latin Modern Math math Minion Math math Lucida Math math Asana Math math math und-zmth und-zmth math math fontconfig-parser-0.5.7/test-conf/conf.d/45-generic.conf.json000064400000000000000000000123671046102023000220260ustar 00000000000000[ { "Description": "Set substitutions for emoji/math fonts" }, { "Alias": { "alias": "Noto Color Emoji", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Apple Color Emoji", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Segoe UI Emoji", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Twitter Color Emoji", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "EmojiOne Mozilla", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Emoji Two", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "JoyPixels", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Emoji One", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Noto Emoji", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Alias": { "alias": "Android Emoji", "prefer": [], "accept": [], "default": [ "emoji" ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "emoji" } } } } ], "edits": [ { "mode": "Prepend", "binding": "Weak", "value": { "Lang": { "Simple": { "String": "und-zsye" } } } } ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Lang": { "Simple": { "String": "und-zsye" } } } }, { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Family": { "Simple": { "String": "emoji" } } } } ], "edits": [ { "mode": "Append", "binding": "Strong", "value": { "Family": { "Simple": { "String": "emoji" } } } } ] } }, { "Alias": { "alias": "XITS Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Alias": { "alias": "STIX Two Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Alias": { "alias": "Cambria Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Alias": { "alias": "Latin Modern Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Alias": { "alias": "Minion Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Alias": { "alias": "Lucida Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Alias": { "alias": "Asana Math", "prefer": [], "accept": [], "default": [ "math" ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "math" } } } } ], "edits": [ { "mode": "Prepend", "binding": "Weak", "value": { "Lang": { "Simple": { "String": "und-zmth" } } } } ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Lang": { "Simple": { "String": "und-zmth" } } } }, { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Family": { "Simple": { "String": "math" } } } } ], "edits": [ { "mode": "Append", "binding": "Strong", "value": { "Family": { "Simple": { "String": "math" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/45-latin.conf000064400000000000000000000156171046102023000205520ustar 00000000000000 Set substitutions for Latin fonts Bitstream Vera Serif serif Cambria serif Constantia serif DejaVu Serif serif Elephant serif Garamond serif Georgia serif Liberation Serif serif Luxi Serif serif MS Serif serif Nimbus Roman No9 L serif Nimbus Roman serif Palatino Linotype serif Thorndale AMT serif Thorndale serif Times New Roman serif Times serif Albany AMT sans-serif Albany sans-serif Arial Unicode MS sans-serif Arial sans-serif Bitstream Vera Sans sans-serif Britannic sans-serif Calibri sans-serif Candara sans-serif Century Gothic sans-serif Corbel sans-serif DejaVu Sans sans-serif Helvetica sans-serif Haettenschweiler sans-serif Liberation Sans sans-serif MS Sans Serif sans-serif Nimbus Sans L sans-serif Nimbus Sans sans-serif Luxi Sans sans-serif Tahoma sans-serif Trebuchet MS sans-serif Twentieth Century sans-serif Verdana sans-serif Andale Mono monospace Bitstream Vera Sans Mono monospace Consolas monospace Courier New monospace Courier monospace Courier Std monospace Cumberland AMT monospace Cumberland monospace DejaVu Sans Mono monospace Fixedsys monospace Inconsolata monospace Liberation Mono monospace Luxi Mono monospace Nimbus Mono L monospace Nimbus Mono monospace Nimbus Mono PS monospace Terminal monospace Bauhaus Std fantasy Cooper Std fantasy Copperplate Gothic Std fantasy Impact fantasy Comic Sans MS cursive ITC Zapf Chancery Std cursive Zapfino cursive Cantarell system-ui Noto Sans UI system-ui Segoe UI system-ui Segoe UI Historic system-ui Segoe UI Symbol system-ui fontconfig-parser-0.5.7/test-conf/conf.d/45-latin.conf.json000064400000000000000000000234701046102023000215160ustar 00000000000000[ { "Description": "Set substitutions for Latin fonts" }, { "Alias": { "alias": "Bitstream Vera Serif", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Cambria", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Constantia", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "DejaVu Serif", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Elephant", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Garamond", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Georgia", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Liberation Serif", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Luxi Serif", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "MS Serif", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Nimbus Roman No9 L", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Nimbus Roman", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Palatino Linotype", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Thorndale AMT", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Thorndale", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Times New Roman", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Times", "prefer": [], "accept": [], "default": [ "serif" ] } }, { "Alias": { "alias": "Albany AMT", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Albany", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Arial Unicode MS", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Arial", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Bitstream Vera Sans", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Britannic", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Calibri", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Candara", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Century Gothic", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Corbel", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "DejaVu Sans", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Helvetica", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Haettenschweiler", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Liberation Sans", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "MS Sans Serif", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Nimbus Sans L", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Nimbus Sans", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Luxi Sans", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Tahoma", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Trebuchet MS", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Twentieth Century", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Verdana", "prefer": [], "accept": [], "default": [ "sans-serif" ] } }, { "Alias": { "alias": "Andale Mono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Bitstream Vera Sans Mono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Consolas", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Courier New", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Courier", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Courier Std", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Cumberland AMT", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Cumberland", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "DejaVu Sans Mono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Fixedsys", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Inconsolata", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Liberation Mono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Luxi Mono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Nimbus Mono L", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Nimbus Mono", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Nimbus Mono PS", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Terminal", "prefer": [], "accept": [], "default": [ "monospace" ] } }, { "Alias": { "alias": "Bauhaus Std", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Cooper Std", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Copperplate Gothic Std", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Impact", "prefer": [], "accept": [], "default": [ "fantasy" ] } }, { "Alias": { "alias": "Comic Sans MS", "prefer": [], "accept": [], "default": [ "cursive" ] } }, { "Alias": { "alias": "ITC Zapf Chancery Std", "prefer": [], "accept": [], "default": [ "cursive" ] } }, { "Alias": { "alias": "Zapfino", "prefer": [], "accept": [], "default": [ "cursive" ] } }, { "Alias": { "alias": "Cantarell", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Noto Sans UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Segoe UI", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Segoe UI Historic", "prefer": [], "accept": [], "default": [ "system-ui" ] } }, { "Alias": { "alias": "Segoe UI Symbol", "prefer": [], "accept": [], "default": [ "system-ui" ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/49-sansserif.conf000064400000000000000000000011771046102023000214400ustar 00000000000000 Add sans-serif to the family when no generic name sans-serif serif monospace sans-serif fontconfig-parser-0.5.7/test-conf/conf.d/49-sansserif.conf.json000064400000000000000000000022521046102023000224030ustar 00000000000000[ { "Description": "Add sans-serif to the family when no generic name" }, { "Match": { "target": "Pattern", "tests": [ { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Family": { "Simple": { "String": "sans-serif" } } } }, { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Family": { "Simple": { "String": "serif" } } } }, { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Family": { "Simple": { "String": "monospace" } } } } ], "edits": [ { "mode": "AppendLast", "binding": "Weak", "value": { "Family": { "Simple": { "String": "sans-serif" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/50-user.conf000064400000000000000000000006121046102023000204020ustar 00000000000000 Load per-user customization files fontconfig-parser-0.5.7/test-conf/conf.d/50-user.conf.json000064400000000000000000000001031046102023000213450ustar 00000000000000[ { "Description": "Load per-user customization files" } ] fontconfig-parser-0.5.7/test-conf/conf.d/51-local.conf000064400000000000000000000004071046102023000205210ustar 00000000000000 Load local customization file local.conf fontconfig-parser-0.5.7/test-conf/conf.d/51-local.conf.json000064400000000000000000000002631046102023000214710ustar 00000000000000[ { "Description": "Load local customization file" }, { "Include": { "prefix": "Default", "ignore_missing": true, "path": "local.conf" } } ] fontconfig-parser-0.5.7/test-conf/conf.d/52-nixos-default-fonts.conf000064400000000000000000000011471046102023000233430ustar 00000000000000 sans-serif DejaVu Sans serif DejaVu Serif monospace DejaVu Sans Mono emoji Noto Color Emoji fontconfig-parser-0.5.7/test-conf/conf.d/52-nixos-default-fonts.conf.json000064400000000000000000000011231046102023000243050ustar 00000000000000[ { "Alias": { "alias": "sans-serif", "prefer": [ "DejaVu Sans" ], "accept": [], "default": [] } }, { "Alias": { "alias": "serif", "prefer": [ "DejaVu Serif" ], "accept": [], "default": [] } }, { "Alias": { "alias": "monospace", "prefer": [ "DejaVu Sans Mono" ], "accept": [], "default": [] } }, { "Alias": { "alias": "emoji", "prefer": [ "Noto Color Emoji" ], "accept": [], "default": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/53-nixos-reject-type1.conf000064400000000000000000000004401046102023000231000ustar 00000000000000 Type 1 fontconfig-parser-0.5.7/test-conf/conf.d/53-nixos-reject-type1.conf.json000064400000000000000000000004521046102023000240530ustar 00000000000000[ { "SelectFont": { "rejects": [ { "Pattern": [ { "Fontformat": { "Simple": { "String": "Type 1" } } } ] } ], "accepts": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/53-no-bitmaps.conf000064400000000000000000000004171046102023000215030ustar 00000000000000 false fontconfig-parser-0.5.7/test-conf/conf.d/53-no-bitmaps.conf.json000064400000000000000000000005111046102023000224460ustar 00000000000000[ { "Match": { "target": "Font", "tests": [], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Embeddedbitmap": { "Simple": { "Bool": false } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/60-generic.conf000064400000000000000000000035671046102023000210550ustar 00000000000000 Set preferable fonts for emoji/math fonts und-zsye true false true emoji Noto Color Emoji Apple Color Emoji Segoe UI Emoji Twitter Color Emoji EmojiOne Mozilla Emoji Two JoyPixels Emoji One Noto Emoji Android Emoji math XITS Math STIX Two Math Cambria Math Latin Modern Math Minion Math Lucida Math Asana Math fontconfig-parser-0.5.7/test-conf/conf.d/60-generic.conf.json000064400000000000000000000034171046102023000220170ustar 00000000000000[ { "Description": "Set preferable fonts for emoji/math fonts" }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Lang": { "Simple": { "String": "und-zsye" } } } }, { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Color": { "Simple": { "Bool": true } } } }, { "qual": "All", "target": "Default", "compare": "NotEq", "value": { "Color": { "Simple": { "Bool": false } } } } ], "edits": [ { "mode": "Append", "binding": "Weak", "value": { "Color": { "Simple": { "Bool": true } } } } ] } }, { "Alias": { "alias": "emoji", "prefer": [ "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", "Twitter Color Emoji", "EmojiOne Mozilla", "Emoji Two", "JoyPixels", "Emoji One", "Noto Emoji", "Android Emoji" ], "accept": [], "default": [] } }, { "Alias": { "alias": "math", "prefer": [ "XITS Math", "STIX Two Math", "Cambria Math", "Latin Modern Math", "Minion Math", "Lucida Math", "Asana Math" ], "accept": [], "default": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/60-latin.conf000064400000000000000000000037701046102023000205440ustar 00000000000000 Set preferable fonts for Latin serif DejaVu Serif Times New Roman Thorndale AMT Luxi Serif Nimbus Roman No9 L Nimbus Roman Times sans-serif DejaVu Sans Verdana Arial Albany AMT Luxi Sans Nimbus Sans L Nimbus Sans Helvetica Lucida Sans Unicode BPG Glaho International Tahoma monospace DejaVu Sans Mono Inconsolata Andale Mono Courier New Cumberland AMT Luxi Mono Nimbus Mono L Nimbus Mono Nimbus Mono PS Courier fantasy Impact Copperplate Gothic Std Cooper Std Bauhaus Std cursive ITC Zapf Chancery Std Zapfino Comic Sans MS system-ui Cantarell Noto Sans UI Segoe UI Segoe UI Historic Segoe UI Symbol fontconfig-parser-0.5.7/test-conf/conf.d/60-latin.conf.json000064400000000000000000000033351046102023000215110ustar 00000000000000[ { "Description": "Set preferable fonts for Latin" }, { "Alias": { "alias": "serif", "prefer": [ "DejaVu Serif", "Times New Roman", "Thorndale AMT", "Luxi Serif", "Nimbus Roman No9 L", "Nimbus Roman", "Times" ], "accept": [], "default": [] } }, { "Alias": { "alias": "sans-serif", "prefer": [ "DejaVu Sans", "Verdana", "Arial", "Albany AMT", "Luxi Sans", "Nimbus Sans L", "Nimbus Sans", "Helvetica", "Lucida Sans Unicode", "BPG Glaho International", "Tahoma" ], "accept": [], "default": [] } }, { "Alias": { "alias": "monospace", "prefer": [ "DejaVu Sans Mono", "Inconsolata", "Andale Mono", "Courier New", "Cumberland AMT", "Luxi Mono", "Nimbus Mono L", "Nimbus Mono", "Nimbus Mono PS", "Courier" ], "accept": [], "default": [] } }, { "Alias": { "alias": "fantasy", "prefer": [ "Impact", "Copperplate Gothic Std", "Cooper Std", "Bauhaus Std" ], "accept": [], "default": [] } }, { "Alias": { "alias": "cursive", "prefer": [ "ITC Zapf Chancery Std", "Zapfino", "Comic Sans MS" ], "accept": [], "default": [] } }, { "Alias": { "alias": "system-ui", "prefer": [ "Cantarell", "Noto Sans UI", "Segoe UI", "Segoe UI Historic", "Segoe UI Symbol" ], "accept": [], "default": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/65-fonts-persian.conf.json000064400000000000000000000372151046102023000232030ustar 00000000000000[ { "Alias": { "alias": "Nesf", "prefer": [], "accept": [ "Nesf2" ], "default": [] } }, { "Alias": { "alias": "Nesf2", "prefer": [], "accept": [ "Persian_sansserif_default" ], "default": [] } }, { "Alias": { "alias": "Nazanin", "prefer": [], "accept": [ "Nazli" ], "default": [] } }, { "Alias": { "alias": "Lotus", "prefer": [], "accept": [ "Lotoos" ], "default": [] } }, { "Alias": { "alias": "Yaqut", "prefer": [], "accept": [ "Yaghoot" ], "default": [] } }, { "Alias": { "alias": "Yaghut", "prefer": [], "accept": [ "Yaghoot" ], "default": [] } }, { "Alias": { "alias": "Traffic", "prefer": [], "accept": [ "Terafik" ], "default": [] } }, { "Alias": { "alias": "Ferdowsi", "prefer": [], "accept": [ "Ferdosi" ], "default": [] } }, { "Alias": { "alias": "Fantezy", "prefer": [], "accept": [ "Fantezi" ], "default": [] } }, { "Alias": { "alias": "Jadid", "prefer": [], "accept": [ "Persian_title" ], "default": [] } }, { "Alias": { "alias": "Titr", "prefer": [], "accept": [ "Persian_title" ], "default": [] } }, { "Alias": { "alias": "Kamran", "prefer": [], "accept": [ "Persian_fantasy", "Homa" ], "default": [] } }, { "Alias": { "alias": "Homa", "prefer": [], "accept": [ "Persian_fantasy", "Kamran" ], "default": [] } }, { "Alias": { "alias": "Fantezi", "prefer": [], "accept": [ "Persian_fantasy" ], "default": [] } }, { "Alias": { "alias": "Tabassom", "prefer": [], "accept": [ "Persian_fantasy" ], "default": [] } }, { "Alias": { "alias": "Arshia", "prefer": [], "accept": [ "Persian_square" ], "default": [] } }, { "Alias": { "alias": "Nasim", "prefer": [], "accept": [ "Persian_square" ], "default": [] } }, { "Alias": { "alias": "Elham", "prefer": [], "accept": [ "Persian_square", "Farnaz" ], "default": [] } }, { "Alias": { "alias": "Farnaz", "prefer": [], "accept": [ "Persian_square", "Elham" ], "default": [] } }, { "Alias": { "alias": "Sina", "prefer": [], "accept": [ "Persian_square" ], "default": [] } }, { "Alias": { "alias": "Persian_title", "prefer": [], "accept": [ "Titr", "Jadid", "Persian_serif" ], "default": [] } }, { "Alias": { "alias": "Persian_fantasy", "prefer": [], "accept": [ "Homa", "Kamran", "Fantezi", "Tabassom", "Persian_square" ], "default": [] } }, { "Alias": { "alias": "Persian_square", "prefer": [], "accept": [ "Arshia", "Elham", "Farnaz", "Nasim", "Sina", "Persian_serif" ], "default": [] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Elham" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Homa" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Koodak" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Nazli" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Roya" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Terafik" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Titr" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Foundry": { "Simple": { "String": "TURNED-OFF" } } } }, { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } }, { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Slant": { "Simple": { "Constant": "Roman" } } } }, { "qual": "Any", "target": "Pattern", "compare": "NotEq", "value": { "Slant": { "Simple": { "Constant": "Roman" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Matrix": { "List": [ "Times", [ { "Simple": { "Property": [ "Default", "Matrix" ] } }, { "Matrix": [ { "Simple": { "Double": 1 } }, { "Simple": { "Double": -0.2 } }, { "Simple": { "Double": 0 } }, { "Simple": { "Double": 1 } } ] } ] ] } } }, { "mode": "Assign", "binding": "Weak", "value": { "Slant": { "Simple": { "Constant": "Oblique" } } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Foundry": { "Simple": { "String": "farsiweb" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "AutoHint": { "Simple": { "Bool": false } } } }, { "mode": "Assign", "binding": "Weak", "value": { "Hinting": { "Simple": { "Bool": false } } } }, { "mode": "Assign", "binding": "Weak", "value": { "Embeddedbitmap": { "Simple": { "Bool": false } } } } ] } }, { "Alias": { "alias": "serif", "prefer": [], "accept": [ "Nazli", "Lotoos", "Mitra", "Ferdosi", "Badr", "Zar" ], "default": [] } }, { "Alias": { "alias": "sans-serif", "prefer": [], "accept": [ "Roya", "Koodak", "Terafik" ], "default": [] } }, { "Alias": { "alias": "monospace", "prefer": [], "accept": [ "Terafik" ], "default": [] } }, { "Alias": { "alias": "fantasy", "prefer": [], "accept": [ "Homa", "Kamran", "Fantezi", "Tabassom" ], "default": [] } }, { "Alias": { "alias": "cursive", "prefer": [], "accept": [ "IranNastaliq", "Nafees Nastaleeq" ], "default": [] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "serif" } } } }, { "qual": "Any", "target": "Default", "compare": "MoreEq", "value": { "Weight": { "Simple": { "Int": 200 } } } }, { "qual": "Any", "target": "Default", "compare": "MoreEq", "value": { "Size": { "Simple": { "Double": 24 } } } } ], "edits": [ { "mode": "Prepend", "binding": "Weak", "value": { "Family": { "Simple": { "String": "Titr" } } } } ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "sans-serif" } } } }, { "qual": "Any", "target": "Default", "compare": "MoreEq", "value": { "Weight": { "Simple": { "Int": 200 } } } }, { "qual": "Any", "target": "Default", "compare": "MoreEq", "value": { "Size": { "Simple": { "Double": 24 } } } } ], "edits": [ { "mode": "Prepend", "binding": "Weak", "value": { "Family": { "Simple": { "String": "Titr" } } } } ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Persian_sansserif_default" } } } }, { "qual": "Any", "target": "Default", "compare": "MoreEq", "value": { "Weight": { "Simple": { "Int": 200 } } } }, { "qual": "Any", "target": "Default", "compare": "MoreEq", "value": { "Size": { "Simple": { "Double": 24 } } } } ], "edits": [ { "mode": "Prepend", "binding": "Same", "value": { "Family": { "Simple": { "String": "Titr" } } } } ] } }, { "Match": { "target": "Pattern", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Persian_sansserif_default" } } } } ], "edits": [ { "mode": "Assign", "binding": "Same", "value": { "Family": { "Simple": { "String": "Roya" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/65-nonlatin.conf000064400000000000000000000221131046102023000212540ustar 00000000000000 Set preferable fonts for non-Latin serif Artsounk BPG UTF8 M Kinnari Norasi Frank Ruehl Dror JG LaoTimes Saysettha Unicode Pigiarniq B Davat B Compset Kacst-Qr Urdu Nastaliq Unicode Raghindi Mukti Narrow malayalam Sampige padmaa Hapax Berbère MS Mincho SimSun PMingLiu WenQuanYi Zen Hei WenQuanYi Bitmap Song AR PL ShanHeiSun Uni AR PL New Sung ZYSong18030 HanyiSong MgOpen Canonica Sazanami Mincho IPAMonaMincho IPAMincho Kochi Mincho AR PL SungtiL GB AR PL Mingti2L Big5 AR PL Zenkai Uni MS 明朝 ZYSong18030 NanumMyeongjo UnBatang Baekmuk Batang KacstQura Frank Ruehl CLM Lohit Bengali Lohit Gujarati Lohit Hindi Lohit Marathi Lohit Maithili Lohit Kashmiri Lohit Konkani Lohit Nepali Lohit Sindhi Lohit Punjabi Lohit Tamil Rachana Lohit Malayalam Lohit Kannada Lohit Telugu Lohit Oriya LKLUG sans-serif Nachlieli Lucida Sans Unicode Yudit Unicode Kerkis ArmNet Helvetica Artsounk BPG UTF8 M Waree Loma Garuda Umpush Saysettha Unicode JG Lao Old Arial GF Zemen Unicode Pigiarniq B Davat B Compset Kacst-Qr Urdu Nastaliq Unicode Raghindi Mukti Narrow malayalam Sampige padmaa Hapax Berbère MS Gothic UmePlus P Gothic Microsoft YaHei Microsoft JhengHei WenQuanYi Zen Hei WenQuanYi Bitmap Song AR PL ShanHeiSun Uni AR PL New Sung MgOpen Modata VL Gothic IPAMonaGothic IPAGothic Sazanami Gothic Kochi Gothic AR PL KaitiM GB AR PL KaitiM Big5 AR PL ShanHeiSun Uni AR PL SungtiL GB AR PL Mingti2L Big5 MS ゴシック ZYSong18030 TSCu_Paranar NanumGothic UnDotum Baekmuk Dotum Baekmuk Gulim KacstQura Lohit Bengali Lohit Gujarati Lohit Hindi Lohit Marathi Lohit Maithili Lohit Kashmiri Lohit Konkani Lohit Nepali Lohit Sindhi Lohit Punjabi Lohit Tamil Meera Lohit Malayalam Lohit Kannada Lohit Telugu Lohit Oriya LKLUG monospace Miriam Mono VL Gothic IPAMonaGothic IPAGothic Sazanami Gothic Kochi Gothic AR PL KaitiM GB MS Gothic UmePlus Gothic NSimSun MingLiu AR PL ShanHeiSun Uni AR PL New Sung Mono HanyiSong AR PL SungtiL GB AR PL Mingti2L Big5 ZYSong18030 NanumGothicCoding NanumGothic UnDotum Baekmuk Dotum Baekmuk Gulim TlwgTypo TlwgTypist TlwgTypewriter TlwgMono Hasida GF Zemen Unicode Hapax Berbère Lohit Bengali Lohit Gujarati Lohit Hindi Lohit Marathi Lohit Maithili Lohit Kashmiri Lohit Konkani Lohit Nepali Lohit Sindhi Lohit Punjabi Lohit Tamil Meera Lohit Malayalam Lohit Kannada Lohit Telugu Lohit Oriya LKLUG system-ui Noto Sans Arabic UI Noto Sans Bengali UI Noto Sans Devanagari UI Noto Sans Gujarati UI Noto Sans Gurmukhi UI Noto Sans Kannada UI Noto Sans Khmer UI Noto Sans Lao UI Noto Sans Malayalam UI Noto Sans Myanmar UI Noto Sans Oriya UI Noto Sans Sinhala UI Noto Sans Tamil UI Noto Sans Telugu UI Noto Sans Thai UI Leelawadee UI Nirmala UI Yu Gothic UI Meiryo UI MS UI Gothic Khmer UI Lao UI Microsoft YaHei UI Microsoft JhengHei UI fontconfig-parser-0.5.7/test-conf/conf.d/65-nonlatin.conf.json000064400000000000000000000125101046102023000222240ustar 00000000000000[ { "Description": "Set preferable fonts for non-Latin" }, { "Alias": { "alias": "serif", "prefer": [ "Artsounk", "BPG UTF8 M", "Kinnari", "Norasi", "Frank Ruehl", "Dror", "JG LaoTimes", "Saysettha Unicode", "Pigiarniq", "B Davat", "B Compset", "Kacst-Qr", "Urdu Nastaliq Unicode", "Raghindi", "Mukti Narrow", "malayalam", "Sampige", "padmaa", "Hapax Berbère", "MS Mincho", "SimSun", "PMingLiu", "WenQuanYi Zen Hei", "WenQuanYi Bitmap Song", "AR PL ShanHeiSun Uni", "AR PL New Sung", "ZYSong18030", "HanyiSong", "MgOpen Canonica", "Sazanami Mincho", "IPAMonaMincho", "IPAMincho", "Kochi Mincho", "AR PL SungtiL GB", "AR PL Mingti2L Big5", "AR PL Zenkai Uni", "MS 明朝", "ZYSong18030", "NanumMyeongjo", "UnBatang", "Baekmuk Batang", "KacstQura", "Frank Ruehl CLM", "Lohit Bengali", "Lohit Gujarati", "Lohit Hindi", "Lohit Marathi", "Lohit Maithili", "Lohit Kashmiri", "Lohit Konkani", "Lohit Nepali", "Lohit Sindhi", "Lohit Punjabi", "Lohit Tamil", "Rachana", "Lohit Malayalam", "Lohit Kannada", "Lohit Telugu", "Lohit Oriya", "LKLUG" ], "accept": [], "default": [] } }, { "Alias": { "alias": "sans-serif", "prefer": [ "Nachlieli", "Lucida Sans Unicode", "Yudit Unicode", "Kerkis", "ArmNet Helvetica", "Artsounk", "BPG UTF8 M", "Waree", "Loma", "Garuda", "Umpush", "Saysettha Unicode", "JG Lao Old Arial", "GF Zemen Unicode", "Pigiarniq", "B Davat", "B Compset", "Kacst-Qr", "Urdu Nastaliq Unicode", "Raghindi", "Mukti Narrow", "malayalam", "Sampige", "padmaa", "Hapax Berbère", "MS Gothic", "UmePlus P Gothic", "Microsoft YaHei", "Microsoft JhengHei", "WenQuanYi Zen Hei", "WenQuanYi Bitmap Song", "AR PL ShanHeiSun Uni", "AR PL New Sung", "MgOpen Modata", "VL Gothic", "IPAMonaGothic", "IPAGothic", "Sazanami Gothic", "Kochi Gothic", "AR PL KaitiM GB", "AR PL KaitiM Big5", "AR PL ShanHeiSun Uni", "AR PL SungtiL GB", "AR PL Mingti2L Big5", "MS ゴシック", "ZYSong18030", "TSCu_Paranar", "NanumGothic", "UnDotum", "Baekmuk Dotum", "Baekmuk Gulim", "KacstQura", "Lohit Bengali", "Lohit Gujarati", "Lohit Hindi", "Lohit Marathi", "Lohit Maithili", "Lohit Kashmiri", "Lohit Konkani", "Lohit Nepali", "Lohit Sindhi", "Lohit Punjabi", "Lohit Tamil", "Meera", "Lohit Malayalam", "Lohit Kannada", "Lohit Telugu", "Lohit Oriya", "LKLUG" ], "accept": [], "default": [] } }, { "Alias": { "alias": "monospace", "prefer": [ "Miriam Mono", "VL Gothic", "IPAMonaGothic", "IPAGothic", "Sazanami Gothic", "Kochi Gothic", "AR PL KaitiM GB", "MS Gothic", "UmePlus Gothic", "NSimSun", "MingLiu", "AR PL ShanHeiSun Uni", "AR PL New Sung Mono", "HanyiSong", "AR PL SungtiL GB", "AR PL Mingti2L Big5", "ZYSong18030", "NanumGothicCoding", "NanumGothic", "UnDotum", "Baekmuk Dotum", "Baekmuk Gulim", "TlwgTypo", "TlwgTypist", "TlwgTypewriter", "TlwgMono", "Hasida", "GF Zemen Unicode", "Hapax Berbère", "Lohit Bengali", "Lohit Gujarati", "Lohit Hindi", "Lohit Marathi", "Lohit Maithili", "Lohit Kashmiri", "Lohit Konkani", "Lohit Nepali", "Lohit Sindhi", "Lohit Punjabi", "Lohit Tamil", "Meera", "Lohit Malayalam", "Lohit Kannada", "Lohit Telugu", "Lohit Oriya", "LKLUG" ], "accept": [], "default": [] } }, { "Alias": { "alias": "system-ui", "prefer": [ "Noto Sans Arabic UI", "Noto Sans Bengali UI", "Noto Sans Devanagari UI", "Noto Sans Gujarati UI", "Noto Sans Gurmukhi UI", "Noto Sans Kannada UI", "Noto Sans Khmer UI", "Noto Sans Lao UI", "Noto Sans Malayalam UI", "Noto Sans Myanmar UI", "Noto Sans Oriya UI", "Noto Sans Sinhala UI", "Noto Sans Tamil UI", "Noto Sans Telugu UI", "Noto Sans Thai UI", "Leelawadee UI", "Nirmala UI", "Yu Gothic UI", "Meiryo UI", "MS UI Gothic", "Khmer UI", "Lao UI", "Microsoft YaHei UI", "Microsoft JhengHei UI" ], "accept": [], "default": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/69-unifont.conf000064400000000000000000000012571046102023000211260ustar 00000000000000 serif FreeSerif Code2000 Code2001 sans-serif FreeSans Arial Unicode MS Arial Unicode Code2000 Code2001 monospace FreeMono fontconfig-parser-0.5.7/test-conf/conf.d/69-unifont.conf.json000064400000000000000000000010661046102023000220740ustar 00000000000000[ { "Alias": { "alias": "serif", "prefer": [ "FreeSerif", "Code2000", "Code2001" ], "accept": [], "default": [] } }, { "Alias": { "alias": "sans-serif", "prefer": [ "FreeSans", "Arial Unicode MS", "Arial Unicode", "Code2000", "Code2001" ], "accept": [], "default": [] } }, { "Alias": { "alias": "monospace", "prefer": [ "FreeMono" ], "accept": [], "default": [] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/80-delicious.conf000064400000000000000000000006651046102023000214170ustar 00000000000000 Delicious Heavy heavy fontconfig-parser-0.5.7/test-conf/conf.d/80-delicious.conf.json000064400000000000000000000015061046102023000223620ustar 00000000000000[ { "Match": { "target": "Scan", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Family": { "Simple": { "String": "Delicious" } } } }, { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Style": { "Simple": { "String": "Heavy" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Weight": { "Simple": { "Constant": "Heavy" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/conf.d/90-synthetic.conf000064400000000000000000000033351046102023000214470ustar 00000000000000 roman roman matrix 10.2 01 oblique false medium bold true bold fontconfig-parser-0.5.7/test-conf/conf.d/90-synthetic.conf.json000064400000000000000000000063431046102023000224210ustar 00000000000000[ { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "Eq", "value": { "Slant": { "Simple": { "Constant": "Roman" } } } }, { "qual": "Any", "target": "Pattern", "compare": "NotEq", "value": { "Slant": { "Simple": { "Constant": "Roman" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Matrix": { "List": [ "Times", [ { "Simple": { "Property": [ "Default", "Matrix" ] } }, { "Matrix": [ { "Simple": { "Double": 1 } }, { "Simple": { "Double": 0.2 } }, { "Simple": { "Double": 0 } }, { "Simple": { "Double": 1 } } ] } ] ] } } }, { "mode": "Assign", "binding": "Weak", "value": { "Slant": { "Simple": { "Constant": "Oblique" } } } }, { "mode": "Assign", "binding": "Weak", "value": { "Embeddedbitmap": { "Simple": { "Bool": false } } } } ] } }, { "Match": { "target": "Font", "tests": [ { "qual": "Any", "target": "Default", "compare": "LessEq", "value": { "Weight": { "Simple": { "Constant": "Medium" } } } }, { "qual": "Any", "target": "Pattern", "compare": "MoreEq", "value": { "Weight": { "Simple": { "Constant": "Bold" } } } } ], "edits": [ { "mode": "Assign", "binding": "Weak", "value": { "Embolden": { "Simple": { "Bool": true } } } }, { "mode": "Assign", "binding": "Weak", "value": { "Weight": { "Simple": { "Constant": "Bold" } } } } ] } } ] fontconfig-parser-0.5.7/test-conf/fonts.conf000064400000000000000000000056611046102023000171750ustar 00000000000000 Default configuration file mono monospace sans serif sans-serif sans sans-serif system ui system-ui 30 0 fontconfig/var/cache/fontconfigconf.dfonts/nix/store/n3imjg12pw7z9qm8r1wq4sq1x8d2nx0y-dejavu-fonts-minimal-2.37 ~/.nix-profile/lib/X11/fonts~/.nix-profile/share/fonts/usr/share/fonts/usr/local/share/fonts/nix/var/nix/profiles/default/lib/X11/fonts/nix/var/nix/profiles/default/share/fonts fontconfig-parser-0.5.7/test-conf/fonts.conf.json000064400000000000000000000035151046102023000201410ustar 00000000000000[{"Description":"Default configuration file"},{"Match":{"target":"Pattern","tests":[{"qual":"Any","target":"Default","compare":"Eq","value":{"Family":{"Simple":{"String":"mono"}}}}],"edits":[{"mode":"Assign","binding":"Same","value":{"Family":{"Simple":{"String":"monospace"}}}}]}},{"Match":{"target":"Pattern","tests":[{"qual":"Any","target":"Default","compare":"Eq","value":{"Family":{"Simple":{"String":"sans serif"}}}}],"edits":[{"mode":"Assign","binding":"Same","value":{"Family":{"Simple":{"String":"sans-serif"}}}}]}},{"Match":{"target":"Pattern","tests":[{"qual":"Any","target":"Default","compare":"Eq","value":{"Family":{"Simple":{"String":"sans"}}}}],"edits":[{"mode":"Assign","binding":"Same","value":{"Family":{"Simple":{"String":"sans-serif"}}}}]}},{"Match":{"target":"Pattern","tests":[{"qual":"Any","target":"Default","compare":"Eq","value":{"Family":{"Simple":{"String":"system ui"}}}}],"edits":[{"mode":"Assign","binding":"Same","value":{"Family":{"Simple":{"String":"system-ui"}}}}]}},{"Config":{"blanks":[0],"rescans":[30]}},{"CacheDir":{"prefix":"Xdg","path":"fontconfig"}},{"CacheDir":{"prefix":"Default","path":"/var/cache/fontconfig"}},{"Include":{"prefix":"Relative","ignore_missing":true,"path":"conf.d"}},{"Dir":{"prefix":"Xdg","salt":"","path":"fonts"}},{"Dir":{"prefix":"Default","salt":"","path":"/nix/store/n3imjg12pw7z9qm8r1wq4sq1x8d2nx0y-dejavu-fonts-minimal-2.37"}},{"Dir":{"prefix":"Default","salt":"","path":"~/.nix-profile/lib/X11/fonts"}},{"Dir":{"prefix":"Default","salt":"","path":"~/.nix-profile/share/fonts"}},{"Dir":{"prefix":"Default","salt":"","path":"/usr/share/fonts"}},{"Dir":{"prefix":"Default","salt":"","path":"/usr/local/share/fonts"}},{"Dir":{"prefix":"Default","salt":"","path":"/nix/var/nix/profiles/default/lib/X11/fonts"}},{"Dir":{"prefix":"Default","salt":"","path":"/nix/var/nix/profiles/default/share/fonts"}}]fontconfig-parser-0.5.7/test-conf/generate_json.sh000064400000000000000000000003761046102023000203520ustar 00000000000000#!/bin/bash # Usage: ./test-conf/generate_json.sh cargo build --all-features --release --example parse_dump_json for f in ./test-conf/**/*.conf; do echo "Processing $f file..." ./target/release/examples/parse_dump_json $f | jq > $f.json done fontconfig-parser-0.5.7/tests/merge.rs000064400000000000000000000010761046102023000160760ustar 00000000000000use fontconfig_parser::*; #[test] fn merge_full() { let mut c = FontConfig::default(); c.merge_config("./test-conf/fonts.conf").unwrap(); // 00-nixos-cache.conf assert!(c.dirs.contains(&DirData { path: "/nix/store/i1yhgnfvaihqzs079lcx4zjnrdzcvaak-noto-fonts-2020-01-23".into(), salt: "".into(), })); // 69-unifont.yaml assert!(c.aliases.contains(&Alias { alias: "serif".into(), prefer: vec!["FreeSerif".into(), "Code2000".into(), "Code2001".into(),], accept: vec![], default: vec![], })); } fontconfig-parser-0.5.7/tests/parse.rs000064400000000000000000000014241046102023000161060ustar 00000000000000#![cfg(feature = "serialize")] use std::path::PathBuf; use fontconfig_parser::*; fn test_single_conf(path: PathBuf) -> Result<()> { eprintln!("Test {}", path.display()); let json_path = path.parent().unwrap().join(format!( "{}.json", path.file_name().unwrap().to_str().unwrap() )); let parts = parse_config_parts(std::fs::read_to_string(path)?.as_str())?; let expected = std::fs::read_to_string(json_path)?; let actual = serde_json::to_string(&parts).unwrap(); k9::assert_equal!(expected, actual); Ok(()) } #[test] fn test_conf() -> Result<()> { test_single_conf("./test-conf/fonts.conf".into())?; for conf in glob::glob("./test-conf/conf.d/*.conf").unwrap() { test_single_conf(conf.unwrap())?; } Ok(()) }