Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

1
vendor/fontdb/.cargo-checksum.json vendored Normal file
View File

@@ -0,0 +1 @@
{"files":{"CHANGELOG.md":"2ffefe91f1a80eb38d68b56bd179c781a61316fa330a0e4086d1aa12b9bbf0ed","Cargo.lock":"90c1c5ddb2db6d51f587288640af2426c07b721ca2a122201f137fcc0fab0b80","Cargo.toml":"94ca88893f760b08ef1425cbd552bbf42a3d605b0f650e37a0f8d290060c67c2","LICENSE":"59a1fdac3bd550043599bd159fd70f09a1108c2b09e3751d39b11e1ff8e51f00","README.md":"713478061cfb5352b999ec071355228eb14b2c4a80dc8fef93713291138afcb2","examples/find-system-font.rs":"01b437ba475162c0ebfcf41fb4226a3021c43f631e07044f938a908d4741c401","src/lib.rs":"217110f14bf9da85d5c98e25ae1de4d4838343ba2de1af0d63a86d2f6be7e0c5","tests/add_fonts.rs":"bff85c98b5433d3cc14813a9d21fed6416aaf11239550072d4304c227dc12d74","tests/fonts/LICENSE.txt":"b84fdd2c3da5db56385cdbb639795e90aa3e035c53bc3591135f18df3331451f","tests/fonts/Tuffy.ttf":"b97cd5005278b24aabb69b8b6ead98860955599558f6e8119483b575a5fdce98"},"package":"b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3"}

219
vendor/fontdb/CHANGELOG.md vendored Normal file
View File

@@ -0,0 +1,219 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
## [0.16.2] - 2024-02-19
### Fixed
- System fonts loading on Windows when the system drive is not `C:\\`.
[@tronical](https://github.com/@tronical)
## [0.16.1] - 2024-02-09
### Fixed
- Treat fonts with non-zero italic angle as italic.
## [0.16.0] - 2023-10-31
### Changed
- `ttf-parser` and `memmap2` dependencies update.
## [0.15.0] - 2023-10-01
### Changed
- Enable the `fontconfig` feature by default. Linux-only.
- MSRV bumped to 1.60 due to `log`.
### Fixed
- Fix fontconfig alias matching order.
[@declantsien](https://github.com/@declantsien)
## [0.14.1] - 2023-05-10
### Fixed
- Return valid IDs from `Database::load_font_source()`.
[@notgull](https://github.com/notgull)
## [0.14.0] - 2023-05-09
### Changed
- `Database::load_font_source()` returns a list of loaded face IDs now.
[@notgull](https://github.com/notgull)
- `ttf-parser` and `memmap2` dependencies update.
## [0.13.1] - 2023-04-23
### Added
- Load system fonts on RedoxOS. [@FloVanGH](https://github.com/FloVanGH)
### Fixed
- Improve missing `XDG_CONFIG_HOME` environment variable handling. Linux only.
[@7sDream](https://github.com/7sDream)
- Improve downloadable fonts detection on macOS. [@messense](https://github.com/messense)
## [0.13.0] - 2023-02-21
### Added
- `Database::default()`. [@7sDream](https://github.com/7sDream)
### Changed
- Database uses `slotmap::SlotMap` instead of `Vec` as an internal storage now.
This allows us to have O(1) indexing by `ID` by sacrificing faces iteration speed a bit.
[@7sDream](https://github.com/7sDream)
- `Database::remove_face` no longer returns `bool`.
- `Database::faces` returns an Iterator and not a slice now.
- MSRV bumped to 1.49
## [0.12.0] - 2023-02-05
### Fixed
- Face weight matching.
## [0.11.2] - 2023-01-10
### Added
- Implement `Display` trait for `ID`. [@7sDream](https://github.com/7sDream)
## [0.11.1] - 2022-12-26
### Fixed
- Always prefer _Typographic Family_ to _Family Name_ when available.
[@CryZe](https://github.com/CryZe)
- Prevent duplicated family names.
## [0.11.0] - 2022-12-25
### Added
- Support localized family names.
- Improve fontconfig support. [@declantsien](https://github.com/declantsien)
### Changed
- `FaceInfo::family` was replaced with `FaceInfo::families` and contains a list of family
names now.
### Fixed
- Improve family name detection in variable fonts.
## [0.10.0] - 2022-11-08
### Added
- `no_std` support. [@jackpot51](https://github.com/jackpot51)
## [0.9.3] - 2022-10-26
### Added
- `Database::family_name` is public now.
## [0.9.2] - 2022-10-22
### Added
- `Database::push_face_info`
- `ID::dummy`
### Fixed
- Expand home path `~` prefix during fontconfig paths resolving.
[@snoyer](https://github.com/snoyer)
## [0.9.1] - 2022-02-21
### Changed
- Reduce binary size by 10% using less generic code.
- Simplify Database::query implementation.
## [0.9.0] - 2022-02-20
### Added
- Way faster fonts scanning by using a more low-level `ttf-parser` API
which allows us to parse only required TrueType tables.
On my hardware, `load_system_fonts()` loaded 898 fonts in 9ms instead of 11ms in the release mode
and in 35ms instead of 52ms in debug.
Currently, we're parsing only `name`, `OS/2` and `post` tables.
## [0.8.0] - 2022-02-12
### Added
- Load user fonts on Windows.
- `fontconfig` feature to allow retrieving font dirs from the fontconfig config file
instead of using hardcoded paths. Linux-only. [@Riey](https://github.com/Riey)
## [0.7.0] - 2021-10-04
### Changed
- The `Source` enum has a new variant `SharedFile`, used for unsafe persistent
memory mappings.
- `FaceInfo` stores `Source` directly now, not anymore in an `Arc`. Instead `Source::Binary`
now stores an `Arc` of the data.
## [0.6.2] - 2021-09-04
### Fixed
- Fix compilation without the `fs` feature.
## [0.6.1] - 2021-09-04
### Changed
- Split the `fs` build feature into `fs` and `memmap`. [@neinseg](https://github.com/neinseg)
## [0.6.0] - 2021-08-21
### Added
- Search in `$HOME/.fonts` on Linux. [@Linus789](https://github.com/Linus789)
### Changed
- Generic font families are preset by default instead of being set to `None`.
## [0.5.4] - 2021-05-25
### Added
- Implement `Eq`, `Hash` for `Query`, `Family`, `Weight` and `Style`.
[@dhardy](https://github.com/dhardy)
### Changed
- Update `ttf-parser`
## [0.5.3] - 2021-05-19
### Changed
- Update `ttf-parser`
## [0.5.2] - 2021-05-19
### Changed
- Update `memmap2`
- Add additional search dir for macOS.
## [0.5.1] - 2020-12-20
### Fixed
- Compilation on Windows.
## [0.5.0] - 2020-12-20
### Added
- `FaceInfo::post_script_name`
- `FaceInfo::monospaced`
- `Database::load_system_fonts`
## [0.4.0] - 2020-12-06
### Changed
- Use a simple `u32` for ID instead of UUID.
## [0.3.0] - 2020-12-05
### Changed
- `ttf-parser` updated.
## [0.2.0] - 2020-07-21
### Changed
- `ttf-parser` updated.
### Fixed
- Stretch processing. `ttf-parser` was incorrectly parsing this property.
[Unreleased]: https://github.com/RazrFalcon/fontdb/compare/v0.16.2...HEAD
[0.16.2]: https://github.com/RazrFalcon/fontdb/compare/v0.16.1...v0.16.2
[0.16.1]: https://github.com/RazrFalcon/fontdb/compare/v0.16.0...v0.16.1
[0.16.0]: https://github.com/RazrFalcon/fontdb/compare/v0.15.0...v0.16.0
[0.15.0]: https://github.com/RazrFalcon/fontdb/compare/v0.14.1...v0.15.0
[0.14.1]: https://github.com/RazrFalcon/fontdb/compare/v0.14.0...v0.14.1
[0.14.0]: https://github.com/RazrFalcon/fontdb/compare/v0.13.1...v0.14.0
[0.13.1]: https://github.com/RazrFalcon/fontdb/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/RazrFalcon/fontdb/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/RazrFalcon/fontdb/compare/v0.11.2...v0.12.0
[0.11.2]: https://github.com/RazrFalcon/fontdb/compare/v0.11.1...v0.11.2
[0.11.1]: https://github.com/RazrFalcon/fontdb/compare/v0.11.0...v0.11.1
[0.11.0]: https://github.com/RazrFalcon/fontdb/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/RazrFalcon/fontdb/compare/v0.9.3...v0.10.0
[0.9.3]: https://github.com/RazrFalcon/fontdb/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/RazrFalcon/fontdb/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/RazrFalcon/fontdb/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/RazrFalcon/fontdb/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/RazrFalcon/fontdb/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/RazrFalcon/fontdb/compare/v0.6.2...v0.7.0
[0.6.2]: https://github.com/RazrFalcon/fontdb/compare/v0.6.1...v0.6.2
[0.6.1]: https://github.com/RazrFalcon/fontdb/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/RazrFalcon/fontdb/compare/v0.5.4...v0.6.0
[0.5.4]: https://github.com/RazrFalcon/fontdb/compare/v0.5.3...v0.5.4
[0.5.3]: https://github.com/RazrFalcon/fontdb/compare/v0.5.2...v0.5.3
[0.5.2]: https://github.com/RazrFalcon/fontdb/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/RazrFalcon/fontdb/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/RazrFalcon/fontdb/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/RazrFalcon/fontdb/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/RazrFalcon/fontdb/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/RazrFalcon/fontdb/compare/v0.1.0...v0.2.0

97
vendor/fontdb/Cargo.lock generated vendored Normal file
View File

@@ -0,0 +1,97 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "env_logger"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
dependencies = [
"log",
]
[[package]]
name = "fontconfig-parser"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a595cb550439a117696039dfc69830492058211b771a2a165379f2a1a53d84d"
dependencies = [
"roxmltree",
]
[[package]]
name = "fontdb"
version = "0.16.2"
dependencies = [
"env_logger",
"fontconfig-parser",
"log",
"memmap2",
"slotmap",
"tinyvec",
"ttf-parser",
]
[[package]]
name = "libc"
version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "log"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
name = "memmap2"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
dependencies = [
"libc",
]
[[package]]
name = "roxmltree"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f"
[[package]]
name = "slotmap"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a"
dependencies = [
"version_check",
]
[[package]]
name = "tinyvec"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
dependencies = [
"tinyvec_macros",
]
[[package]]
name = "tinyvec_macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "ttf-parser"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4"
[[package]]
name = "version_check"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

82
vendor/fontdb/Cargo.toml vendored Normal file
View File

@@ -0,0 +1,82 @@
# 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"
rust-version = "1.60"
name = "fontdb"
version = "0.16.2"
authors = ["Yevhenii Reizner <razrfalcon@gmail.com>"]
description = "A simple, in-memory font database with CSS-like queries."
documentation = "https://docs.rs/fontdb/"
readme = "README.md"
keywords = [
"font",
"db",
"css",
"truetype",
"ttf",
]
categories = ["text-processing"]
license = "MIT"
repository = "https://github.com/RazrFalcon/fontdb"
[dependencies.log]
version = "0.4"
[dependencies.memmap2]
version = "0.9"
optional = true
[dependencies.slotmap]
version = "1.0.6"
default-features = false
[dependencies.tinyvec]
version = "1.6.0"
features = ["alloc"]
[dependencies.ttf-parser]
version = "0.20"
features = [
"opentype-layout",
"apple-layout",
"variable-fonts",
"glyph-names",
]
default-features = false
[dev-dependencies.env_logger]
version = "0.10"
default-features = false
[features]
default = [
"std",
"fs",
"memmap",
"fontconfig",
]
fontconfig = [
"fontconfig-parser",
"fs",
]
fs = ["std"]
memmap = [
"fs",
"memmap2",
]
std = ["ttf-parser/std"]
[target."cfg(all(unix, not(any(target_os = \"macos\", target_os = \"android\"))))".dependencies.fontconfig-parser]
version = "0.5"
optional = true
default-features = false

21
vendor/fontdb/LICENSE vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Yevhenii Reizner
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.

61
vendor/fontdb/README.md vendored Normal file
View File

@@ -0,0 +1,61 @@
# fontdb
![Build Status](https://github.com/RazrFalcon/fontdb/workflows/Rust/badge.svg)
[![Crates.io](https://img.shields.io/crates/v/fontdb.svg)](https://crates.io/crates/fontdb)
[![Documentation](https://docs.rs/fontdb/badge.svg)](https://docs.rs/fontdb)
[![Rust 1.60+](https://img.shields.io/badge/rust-1.60+-orange.svg)](https://www.rust-lang.org)
`fontdb` is a simple, in-memory font database with CSS-like queries.
## Features
- The database can load fonts from files, directories and raw data (`Vec<u8>`).
- The database can match a font using CSS-like queries. See `Database::query`.
- The database can try to load system fonts.
Currently, this is implemented by scanning predefined directories.
The library does not interact with the system API.
- Provides a unique ID for each font face.
## Non-goals
- Advanced font properties querying.<br>
The database provides only storage and matching capabilities.
For font properties querying you can use [ttf-parser].
- A font fallback mechanism.<br>
This library can be used to implement a font fallback mechanism, but it doesn't implement one.
- Application's global database.<br>
The database doesn't use `static`, therefore it's up to the caller where it should be stored.
- Font types support other than TrueType.
## Font vs Face
A font is a collection of font faces. Therefore, a font face is a subset of a font.
A simple font (\*.ttf/\*.otf) usually contains a single font face,
but a font collection (\*.ttc) can contain multiple font faces.
`fontdb` stores and matches font faces, not fonts.
Therefore, after loading a font collection with 5 faces (for example), the database will be
populated with 5 `FaceInfo` objects, all of which will be pointing to the same file or binary data.
## Performance
The database performance is largely limited by the storage itself.
We are using [ttf-parser], so the parsing should not be a bottleneck.
For example, on Mac Book Pro 14 with M1 Pro, it takes just ~24ms to load 1361 font faces.
## Safety
The library relies on memory-mapped files, which is inherently unsafe.
But since we do not keep the files open it should be perfectly safe.
If you would like to use a persistent memory mapping of the font files,
then you can use the unsafe `Database::make_shared_face_data` function.
## License
MIT
[ttf-parser]: https://github.com/RazrFalcon/ttf-parser

View File

@@ -0,0 +1,43 @@
fn main() {
std::env::set_var("RUST_LOG", "fontdb=trace");
env_logger::init();
let mut db = fontdb::Database::new();
let now = std::time::Instant::now();
db.load_system_fonts();
db.set_serif_family("Times New Roman");
db.set_sans_serif_family("Arial");
db.set_cursive_family("Comic Sans MS");
db.set_fantasy_family("Impact");
db.set_monospace_family("Courier New");
println!(
"Loaded {} font faces in {}ms.",
db.len(),
now.elapsed().as_millis()
);
const FAMILY_NAME: &str = "Times New Roman";
let query = fontdb::Query {
families: &[fontdb::Family::Name(FAMILY_NAME), fontdb::Family::SansSerif],
weight: fontdb::Weight::BOLD,
..fontdb::Query::default()
};
let now = std::time::Instant::now();
match db.query(&query) {
Some(id) => {
let (src, index) = db.face_source(id).unwrap();
if let fontdb::Source::File(ref path) = &src {
println!(
"Font '{}':{} found in {}ms.",
path.display(),
index,
now.elapsed().as_micros() as f64 / 1000.0
);
}
}
None => {
println!("Error: '{}' not found.", FAMILY_NAME);
}
}
}

1295
vendor/fontdb/src/lib.rs vendored Normal file

File diff suppressed because it is too large Load Diff

15
vendor/fontdb/tests/add_fonts.rs vendored Normal file
View File

@@ -0,0 +1,15 @@
const DEMO_TTF: &[u8] = include_bytes!("./fonts/Tuffy.ttf");
use std::sync::Arc;
#[test]
fn add_fonts_and_get_ids_back() {
env_logger::init();
let mut font_db = fontdb::Database::new();
let ids = font_db.load_font_source(fontdb::Source::Binary(Arc::new(DEMO_TTF)));
assert_eq!(ids.len(), 1);
let id = ids[0];
let font = font_db.face(id).unwrap();
assert!(font.families.iter().any(|(name, _)| name == "Tuffy"));
}

11
vendor/fontdb/tests/fonts/LICENSE.txt vendored Executable file
View File

@@ -0,0 +1,11 @@
We, the copyright holders of this work, hereby release it into the
public domain. This applies worldwide.
In case this is not legally possible,
We grant any entity the right to use this work for any purpose, without
any conditions, unless such conditions are required by law.
Thatcher Ulrich <tu@tulrich.com> http://tulrich.com
Karoly Barta bartakarcsi@gmail.com
Michael Evans http://www.evertype.com

BIN
vendor/fontdb/tests/fonts/Tuffy.ttf vendored Executable file

Binary file not shown.