diff options
author | Joe Wilm <joe@jwilm.com> | 2017-06-28 20:36:01 -0700 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-10-08 22:20:58 -0700 |
commit | 6c74c51ceff3ec1af0b3973e373aba6e315beffa (patch) | |
tree | ae4d738d6896790b5fa0eb7cdc32204afcd02ee4 /font/src/lib.rs | |
parent | 65065e06d19216ed5de9b1db952db76a5457492e (diff) | |
download | alacritty-6c74c51ceff3ec1af0b3973e373aba6e315beffa.tar.gz alacritty-6c74c51ceff3ec1af0b3973e373aba6e315beffa.zip |
Extend and improve FcPattern bindings
The fontconfig `FcPattern` type is wrapped as `fc::Pattern` and
`fc::Pattern` ref. All methods for accessing data on the pattern now
return an `Iterator`. This API turns out to be much more ergonomic than
providing an integer index. We also override the default `nth`
implementation of `Iterator` on these accessors to allow random
(incremental only) access.
For instance, accessing `family` attributes from a pattern:
let families = pattern.family();
let second = pattern.nth(1);
Or printing available styles
for style in pattern.style() {
println!("style={}", style);
}
Diffstat (limited to 'font/src/lib.rs')
-rw-r--r-- | font/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/font/src/lib.rs b/font/src/lib.rs index 401a29c0..f02df436 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -48,7 +48,7 @@ use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; // If target isn't macos, reexport everything from ft #[cfg(not(target_os = "macos"))] -mod ft; +pub mod ft; #[cfg(not(target_os = "macos"))] pub use ft::{FreeTypeRasterizer as Rasterizer, Error}; |