commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
ed941ada6ef187054ea54a7172e9be76e58d005b | Alex Butler | 2025-08-13T12:36:34 | Fix 1.89 lints | diff --git a/src/lib.rs b/src/lib.rs
index 6201ade..e278843 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -477,7 +477,7 @@ where
/// assert!(set.is_empty());
/// ```
#[inline]
- pub fn drain(&mut self) -> Drain<T> {
+ pub fn drain(&mut self) -> Drain<'_, T> {
Drain {
iter: self.... | 1 | 1 | 1 |
a24b7a5ac9c26269eae013fb3e3f15c29f4275f9 | Alex Butler | 2020-07-21T22:29:26 | Release 0.1.4 | diff --git a/Cargo.toml b/Cargo.toml
index 9d809f5..cba6fc7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "linked_hash_set"
-version = "0.1.3"
+version = "0.1.4"
authors = ["Alex Butler <alexheretic@gmail.com>"]
edition = "2018"
description = "HashSet with insertion ordering" | 1 | 1 | 1 |
27ff3b6486e6e8c5348663169c666999d4c7c950 | Dylan DPC | 2020-07-21T22:25:49 | Update Cargo.toml (#6) | diff --git a/Cargo.toml b/Cargo.toml
index c6aa341..9d809f5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ license = "Apache-2.0"
readme="README.md"
[dependencies]
-linked-hash-map = "0.5"
+linked-hash-map = "0.5.3"
serde = { version = "1", optional = true }
[dev-dependencies] | 1 | 1 | 1 |
d7a008660eb125f8d8af78b927120dc8961fa86b | Alex Butler | 2018-12-06T19:31:35 | edition 2018 | diff --git a/Cargo.toml b/Cargo.toml
index 4918893..c6aa341 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,7 @@
name = "linked_hash_set"
version = "0.1.3"
authors = ["Alex Butler <alexheretic@gmail.com>"]
+edition = "2018"
description = "HashSet with insertion ordering"
repository = "https://github.com/alexhe... | 3 | 17 | 22 |
8d480cc42cad9eb970c28fc8afdd20571ce1b517 | Alex Butler | 2018-12-06T15:55:30 | cargo fmt | diff --git a/src/lib.rs b/src/lib.rs
index e42b190..0a9eaba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -96,10 +96,22 @@ use std::ops::{BitAnd, BitOr, BitXor, Sub};
///
/// let mut vikings = LinkedHashSet::new();
///
-/// vikings.insert(Viking { name: "Einar", power: 9 });
-/// vikings.insert(Viking { name: "Einar",... | 2 | 96 | 48 |
c270eba5d2ae410602ec43277264097e19266673 | Alex Butler | 2018-06-05T10:18:11 | Add DoubleEndedIterator support for iter() & into_iter() | diff --git a/src/lib.rs b/src/lib.rs
index 7ef36cc..e42b190 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1122,6 +1122,11 @@ impl<'a, K> ExactSizeIterator for Iter<'a, K> {
self.iter.len()
}
}
+impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
+ fn next_back(&mut self) -> Option<&'a T> {
+ self.... | 1 | 37 | 0 |
7bef01fce8775ccd0bfca83dbb1b4c2e2a2a1408 | Alex Butler | 2018-02-24T07:37:37 | Release 0.1.2 | diff --git a/Cargo.toml b/Cargo.toml
index e0ff5e2..a90f54f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "linked_hash_set"
-version = "0.1.1"
+version = "0.1.2"
authors = ["Alex Butler <alexheretic@gmail.com>"]
description = "HashSet with insertion ordering"
repository = "https://githu... | 1 | 1 | 1 |
3346d11dbaccd78ddfbc719f542b2d890d902fee | Alex Butler | 2018-02-24T07:37:09 | Impl Hash
format code | diff --git a/src/lib.rs b/src/lib.rs
index 3036e2e..7ef36cc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,14 +23,14 @@ extern crate linked_hash_map;
#[cfg(feature = "serde")]
pub mod serde;
+use linked_hash_map as map;
+use linked_hash_map::{Keys, LinkedHashMap};
use std::borrow::Borrow;
+use std::collections::h... | 1 | 97 | 59 |
edcef0d8870abcedcdfba0f7e7e376b07cf7757c | Alex Butler | 2017-12-04T10:09:07 | Release version 0.1.1 | diff --git a/Cargo.toml b/Cargo.toml
index 4dc034a..e0ff5e2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "linked_hash_set"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Alex Butler <alexheretic@gmail.com>"]
description = "HashSet with insertion ordering"
repository = "https://githu... | 1 | 1 | 1 |
795564b71463dd79894ae6ae81032afb5eb75664 | Alex Butler | 2017-12-04T10:04:51 | Clarify docs add `insert_if_absent`, `refresh` (#3)
Add insert_if_absent method allowing insertion of already contained value to not call map::insert
Add refresh similar to map::get_refresh
Add notes to docs clarifying ordering behaviour on insert & removal. | diff --git a/src/lib.rs b/src/lib.rs
index 08d518d..d8b5298 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -501,6 +501,32 @@ impl<T, S> LinkedHashSet<T, S>
self.map.contains_key(value)
}
+ /// If already present, moves a value to the end of the ordering.
+ ///
+ /// If the set did have this value ... | 1 | 59 | 0 |
4759b5593fea31480b760240ca8a718106235a43 | Georg Semmler | 2025-07-24T08:06:27 | Exclude test data and tools from published packages (#18)
* Exclude test data and tools from published packages
During our dependency reviews we discovered that the owned-ttf-parser crate as uploaded to crates.io includes test data and additional tools that are not used by the rust code. This increases the package si... | diff --git a/Cargo.toml b/Cargo.toml
index 335be38..afbdcc2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,8 @@ repository = "https://github.com/alexheretic/owned-ttf-parser"
keywords = ["ttf", "truetype", "otf", "opentype"]
license = "Apache-2.0"
readme = "README.md"
+# exclude fonts & tests to reduce publishe... | 1 | 2 | 0 |
0587ce348310a6bda03b0fa8d426ad7a9ebda0fb | Alex Butler | 2023-01-31T20:12:44 | Release 0.18.1 | diff --git a/Cargo.toml b/Cargo.toml
index 4f9561d..5f819ab 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "owned_ttf_parser"
# Version should be inline with ttf-parser
-version = "0.18.0"
+version = "0.18.1"
authors = ["Alex Butler <alexheretic@gmail.com>"]
edition = "2021"
description... | 1 | 1 | 1 |
f8d27634532c69d8140e2f56784c5cab9516c0cd | Alex Butler | 2022-11-03T18:42:05 | rustfmt docs | diff --git a/src/lib.rs b/src/lib.rs
index afa2fee..0ce1578 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5,7 +5,7 @@
//!
//! # Example
//! ```
-//! use owned_ttf_parser::{AsFaceRef, OwnedFace, Face};
+//! use owned_ttf_parser::{AsFaceRef, Face, OwnedFace};
//!
//! # let owned_font_data = include_bytes!("../fonts/f... | 1 | 1 | 1 |
11a7055e12c5f1171a334c53e486ec9878ea9907 | Evgeniy Reizner | 2020-05-18T10:36:44 | Update ttf-parser (#1) | diff --git a/Cargo.toml b/Cargo.toml
index a82f027..6a440c1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "owned_ttf_parser"
# Version should be inline with ttf-parser
-version = "0.5.1"
+version = "0.6.0"
authors = ["Alex Butler <alexheretic@gmail.com>"]
edition = "2018"
description =... | 1 | 2 | 2 |
e4705b8174aaf83eec53fdd4aeab7940e3fed1e5 | Alex Butler | 2025-11-30T16:43:45 | Update dev-dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 04e5493..6651f95 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -9,7 +9,7 @@ publish = false
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.25", default-features = false, features = ["png"] }
-criterion ... | 1 | 1 | 1 |
c476792ab677c7b99e9563b8db511645028c0285 | Alex Butler | 2025-08-07T22:43:48 | Fix 1.89 clippy lints | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index ef76b46..19d731c 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -204,7 +204,7 @@ pub trait Font {
since = "0.2.22",
note = "Deprecated in favor of `glyph_raster_image2`"
)]
- fn glyph_raster_image(&self, id: GlyphId, pixel_siz... | 3 | 9 | 9 |
727737fbe93e0670e28ed031f3936778ddf0155d | Alex Butler | 2025-07-26T11:08:13 | Update dev-dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index a522661..04e5493 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -9,7 +9,7 @@ publish = false
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.25", default-features = false, features = ["png"] }
-criterion ... | 1 | 1 | 1 |
e85f951ea939891ba7f6b3b77bf2e5b5f9260928 | Lenny Critchley | 2025-06-29T09:05:32 | Add support for reading the italic angle (#114)
* Add support for reading the italic angle
* Code review
Co-authored-by: Alex Butler <alexheretic@gmail.com> | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 96f45eb..ef76b46 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -100,6 +100,28 @@ pub trait Font {
/// Scaling can be done with [`as_scaled`](Self::as_scaled).
fn line_gap_unscaled(&self) -> f32;
+ /// The slant angle of the font.
+ /... | 3 | 37 | 0 |
aebec121f015aabef53ae1ecaf513691fba1754e | Alex Butler | 2025-06-27T20:28:10 | Update 1.88 lints | diff --git a/dev/examples/ascii.rs b/dev/examples/ascii.rs
index d2faa74..ee729e4 100644
--- a/dev/examples/ascii.rs
+++ b/dev/examples/ascii.rs
@@ -9,7 +9,7 @@ fn main() {
let font_path = std::env::current_dir().unwrap().join(font_path);
let data = std::fs::read(&font_path).unwrap();
let fon... | 3 | 3 | 2 |
9fccd7289a3685b22baf3e341a299ef5fbabe47e | Alex Butler | 2025-05-18T17:55:09 | Update dev-dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 393ace1..a522661 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -9,7 +9,7 @@ publish = false
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.25", default-features = false, features = ["png"] }
-criterion ... | 1 | 1 | 1 |
195deb218c6dad30af5dc0b9a0c090d0e41b1a0e | Bruce Mitchener | 2025-02-11T18:50:23 | Fix `clippy::needless_lifetimes` lint (#113) | diff --git a/glyph/src/codepoint_ids.rs b/glyph/src/codepoint_ids.rs
index cd93555..f31a1a2 100644
--- a/glyph/src/codepoint_ids.rs
+++ b/glyph/src/codepoint_ids.rs
@@ -6,7 +6,7 @@ pub struct CodepointIdIter<'a> {
pub(crate) inner: Box<dyn Iterator<Item = (GlyphId, char)> + 'a>,
}
-impl<'a> Iterator for Codepoi... | 1 | 1 | 1 |
ff76a7eb616e32d5890a1ff60181b6a4e3e24465 | Bruce Mitchener | 2025-02-11T18:50:06 | Fix typos (#112) | diff --git a/glyph/src/outlined.rs b/glyph/src/outlined.rs
index 1820624..a96afd6 100644
--- a/glyph/src/outlined.rs
+++ b/glyph/src/outlined.rs
@@ -20,7 +20,7 @@ impl Outline {
pub fn px_bounds(&self, scale_factor: PxScaleFactor, position: Point) -> Rect {
let Rect { min, max } = self.bounds;
- ... | 1 | 2 | 2 |
1a02ae87f6e8cc66039a3814ffb1be763f2883fb | Alex Butler | 2024-08-26T09:35:54 | Add bench lto | diff --git a/Cargo.toml b/Cargo.toml
index 9e0acb7..04a37b1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,3 +1,6 @@
[workspace]
members = ["rasterizer", "glyph", "dev"]
resolver = "2"
+
+[profile.bench]
+lto = "thin" | 1 | 3 | 0 |
fd023f3ff1958dcf835c9babcb3ccb65694305e7 | Alex Butler | 2024-07-03T08:31:35 | Rework image example to draw into an exact minimally sized image
Correctly uses px_bounds to size the pixel image and discusses the necessary conversions | diff --git a/dev/examples/image.rs b/dev/examples/image.rs
index ccb5b6c..242adb8 100644
--- a/dev/examples/image.rs
+++ b/dev/examples/image.rs
@@ -1,7 +1,7 @@
//! Draws text into `image_example.png`.
//!
//! Use a custom font file: `cargo run --example image /path/to/font.otf`
-use ab_glyph::{point, Font, FontRef,... | 2 | 54 | 29 |
c154cf38b698878ee11b064f8862cf59569a8b8c | Alex Butler | 2024-06-25T12:27:56 | Clarify Glyph::position docs describe a point relative to the glyph | diff --git a/glyph/src/glyph.rs b/glyph/src/glyph.rs
index c40d5a0..f4107d5 100644
--- a/glyph/src/glyph.rs
+++ b/glyph/src/glyph.rs
@@ -59,8 +59,8 @@ pub struct Glyph {
pub scale: PxScale,
/// Position of this glyph.
///
- /// Horizontally this is to the left of the glyph before applying
- /// `h_... | 1 | 2 | 2 |
75d10aeae1b9118df1739ec5042536754c7bf49c | Bruce Mitchener | 2024-05-14T18:24:10 | Use intra-doc link syntax and fix 2 broken links. (#104) | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 5f489fd..3025c65 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -5,8 +5,8 @@ use crate::{
/// Functionality required from font data.
///
-/// See also [`FontArc`](struct.FontArc.html), [`FontRef`](struct.FontRef.html)
-/// and [`FontVec`](struct.Fo... | 4 | 29 | 29 |
21cd5f4f81a805c0008289ca01ad515363f3a4c7 | Bruce Mitchener | 2024-05-14T18:23:56 | Replace usages of legacy numeric constants. (#103)
The associated constants on the types are preferred as the legacy
items may be deprecated in the future.
See https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
for more details. | diff --git a/rasterizer/src/geometry.rs b/rasterizer/src/geometry.rs
index 2f4bb74..d943423 100644
--- a/rasterizer/src/geometry.rs
+++ b/rasterizer/src/geometry.rs
@@ -54,8 +54,8 @@ impl core::ops::Sub for Point {
/// # use ab_glyph_rasterizer::*;
/// let p1 = point(1.0, 2.0) - point(2.0, 1.5);
///
- ... | 2 | 10 | 10 |
83eafaf47c7083fead7833cd3b21be7798a0e889 | Abdul Rahman Sibahi | 2024-04-12T16:43:36 | add GlyphSvg (#100)
* add GlyphSvg
* `return None` as default impl
* non-exhaustive
Co-authored-by: Alex Butler <alexheretic@gmail.com>
* fix typo
---------
Co-authored-by: Alex Butler <alexheretic@gmail.com> | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 19d4e85..a626944 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -1,5 +1,6 @@
use crate::{
- point, v2, Glyph, GlyphId, Outline, OutlinedGlyph, PxScale, PxScaleFont, Rect, ScaleFont,
+ point, v2, Glyph, GlyphId, GlyphSvg, Outline, OutlinedGlyph, ... | 4 | 45 | 2 |
675ed3e0127bafb40e6c34c5d43bbd668ad6fcca | Alexander Parlett | 2024-04-03T14:08:59 | Expose slice and vec of raw data (#98)
* Expose slice and vec of raw data
* Fix formatting
* Restore methods directly on FontVec
* Format
* Remove methods from Font, add a new trait and just use as_slice
* Fix merged trait usage
* Use a default and implement per type data impls
* Fix docs
* Res... | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 9b219d7..19d4e85 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -243,6 +243,23 @@ pub trait Font {
scale: scale.into(),
}
}
+
+ /// Extracts a slice containing the data passed into e.g. [`FontArc::try_from_slice`].
+ //... | 3 | 33 | 0 |
a255264943c9ad7fb1c9377c27147b89a89e03c5 | Alex Butler | 2024-03-11T21:14:07 | Update dev dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index b6ccd2e..393ace1 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -8,7 +8,7 @@ publish = false
[dependencies]
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
-image = { version = "0.24", default-features = false, features = ["png... | 1 | 1 | 1 |
27ff93e3106e015ead89157382e449b956ba95a1 | Kian-Meng Ang | 2023-10-31T11:03:10 | Fix typos (#92)
Found via `typos --hidden --format brief` | diff --git a/glyph/src/outlined.rs b/glyph/src/outlined.rs
index 31ab35b..99b86e4 100644
--- a/glyph/src/outlined.rs
+++ b/glyph/src/outlined.rs
@@ -88,7 +88,7 @@ impl OutlinedGlyph {
/// with a coverage value indicating how much the glyph covered that pixel.
///
/// A coverage value of `0.0` means the p... | 2 | 5 | 5 |
abbe81f3addecfc9af3f20494d1e6a8996f2afba | Alex Butler | 2023-05-23T23:27:47 | Update criterion | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 284a89a..b6bd329 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -9,7 +9,7 @@ publish = false
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.24", default-features = false, features = ["png"] }
-criterion ... | 1 | 1 | 1 |
24376c08291588009de72aac29368e787f6501c1 | Alex Butler | 2023-04-21T18:04:10 | Fix clippy lints | diff --git a/dev/examples/ascii.rs b/dev/examples/ascii.rs
index 701d777..d2faa74 100644
--- a/dev/examples/ascii.rs
+++ b/dev/examples/ascii.rs
@@ -55,7 +55,7 @@ fn draw_ascii<F: Font>(font: F) {
// There's still a possibility that the glyph clips the boundaries of the bitmap
if x >= ... | 2 | 2 | 2 |
f8aeebb14b1c070edc23429f064e823c79503be8 | Zsolt Bölöny | 2023-04-15T09:31:57 | Return 0.0 for missing horizontal/vertical advance/side bearing values (#78)
Hmtx and vmtx tables, where these values are extracted from, are only
defined for horizontal and vertical fonts, respectively. It's much more
harmless to return 0.0 if these tables are missing, than to panick. | diff --git a/glyph/src/ttfp.rs b/glyph/src/ttfp.rs
index cb01783..4e1c646 100644
--- a/glyph/src/ttfp.rs
+++ b/glyph/src/ttfp.rs
@@ -250,7 +250,7 @@ macro_rules! impl_font {
self.0
.as_face_ref()
.glyph_hor_advance(id.into())
- .expect("Inval... | 1 | 4 | 4 |
24947d209826738da7c667f5999835d3183d087d | Alex Butler | 2023-01-27T00:47:05 | Fix clippies | diff --git a/dev/examples/ascii.rs b/dev/examples/ascii.rs
index 4adc034..701d777 100644
--- a/dev/examples/ascii.rs
+++ b/dev/examples/ascii.rs
@@ -42,7 +42,7 @@ fn draw_ascii<F: Font>(font: F) {
.unwrap_or(0.0)
.ceil() as usize;
- println!("width: {}, height: {}", px_width, px_height);
+ pri... | 2 | 2 | 2 |
63cb3702b3d41ffe8c40a65ae635180ec24a9efd | Alex Butler | 2022-10-24T00:01:20 | rustfmt doc comments | diff --git a/glyph/src/glyph.rs b/glyph/src/glyph.rs
index d0f6b7a..4a1988c 100644
--- a/glyph/src/glyph.rs
+++ b/glyph/src/glyph.rs
@@ -8,7 +8,7 @@ pub use ab_glyph_rasterizer::point;
///
/// # Example
/// ```
-/// use ab_glyph::{FontRef, Font, GlyphId};
+/// use ab_glyph::{Font, FontRef, GlyphId};
/// # fn main()... | 3 | 9 | 4 |
87af73a779a33eb02a1f50aea661167b0da3b67d | Alex Butler | 2022-09-12T14:21:45 | Update criterion to 0.4 | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 6e58ed0..284a89a 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -9,7 +9,7 @@ publish = false
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.24", default-features = false, features = ["png"] }
-criterion ... | 1 | 1 | 1 |
c1eb82b8c59736e4fb319f846de160d5ed4dfe82 | Alex Butler | 2022-01-31T23:46:00 | Update dev dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 40dfb88..6e58ed0 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -8,7 +8,7 @@ publish = false
[dependencies]
ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
-image = { version = "0.23", default-features = false, features = ["png... | 3 | 3 | 3 |
18a3c4b4a65e53d5724a6ee2b5fab381d06321f6 | Alex Butler | 2021-12-09T13:37:15 | Update dev-dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 2809214..40dfb88 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -10,7 +10,7 @@ ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.23", default-features = false, features = ["png"] }
criterion = "0.3"
-blake2... | 2 | 7 | 7 |
76ab9cd9d1b2f9a9cc3723e956342b439551357b | Alex Butler | 2021-11-06T13:23:00 | Add font_method benches | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 6af2067..2809214 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -24,3 +24,7 @@ harness = false
[[bench]]
name = "layout_draw"
harness = false
+
+[[bench]]
+name = "font_method"
+harness = false
diff --git a/dev/benches/font_method.rs b/dev/benches/font_method.r... | 2 | 55 | 0 |
db27dc703ca7f1cedcef3b7c0d77433171116593 | Alex Butler | 2021-08-21T11:31:35 | Tweak docs/comments | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index a491d15..8908b6b 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -105,7 +105,7 @@ impl Rasterizer {
};
let dxdy = (p1.x - p0.x) / (p1.y - p0.y);
let mut x = p0.x;
- let y0 = p0.y as usize; //... | 1 | 2 | 3 |
000857127565aba1bb401e992051f4140f8bb6ee | Alex Butler | 2021-06-29T20:32:06 | Use shorter `.into()` style in some places | diff --git a/glyph/src/ttfp.rs b/glyph/src/ttfp.rs
index 9d1b8a7..ba5177d 100644
--- a/glyph/src/ttfp.rs
+++ b/glyph/src/ttfp.rs
@@ -190,17 +190,17 @@ macro_rules! impl_font {
#[inline]
fn ascent_unscaled(&self) -> f32 {
- f32::from(self.0.as_face_ref().ascender())
+ ... | 1 | 15 | 19 |
eb7c4c4a183963138e5b8f92e0d13408f2584b8c | Rémi Lauzier | 2021-06-26T16:48:41 | fix a clippy warning (#40) | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index c3f5ef1..dc44d3d 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -189,7 +189,7 @@ pub trait Font {
Self: Sized,
{
PxScaleFont {
- font: &self,
+ font: self,
scale: scale.into(),
}
} | 1 | 1 | 1 |
e02be088101388439fa0912a0f0e0f45a7fce466 | Alex Butler | 2021-06-02T23:05:16 | Update dev-dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 0f25108..6af2067 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -11,7 +11,7 @@ ab_glyph = { path = "../glyph" }
image = { version = "0.23", default-features = false, features = ["png"] }
criterion = "0.3"
blake2 = "0.9"
-approx = "0.4"
+approx = "0.5"
[[benc... | 1 | 1 | 1 |
f86dcc1ad6d44957d07ada5cd5b44b2384648412 | Alex Butler | 2021-05-20T13:07:36 | Update tests account for CARGO_TARGET_DIR | diff --git a/dev/tests/render_reference.rs b/dev/tests/render_reference.rs
index c20c340..9f6d13a 100644
--- a/dev/tests/render_reference.rs
+++ b/dev/tests/render_reference.rs
@@ -1,7 +1,7 @@
use ab_glyph::{Font, FontRef, ScaleFont};
use ab_glyph_rasterizer::Rasterizer;
use image::{DynamicImage, LumaA};
-use std::i... | 1 | 30 | 11 |
f23be8dbd7d67b2ad4a78f37cb2901d8c5508a52 | Alex Butler | 2021-04-15T22:08:55 | Fix some example lints | diff --git a/dev/examples/ascii.rs b/dev/examples/ascii.rs
index c70621c..087129a 100644
--- a/dev/examples/ascii.rs
+++ b/dev/examples/ascii.rs
@@ -9,10 +9,7 @@ fn main() {
let font_path = std::env::current_dir().unwrap().join(font_path);
let data = std::fs::read(&font_path).unwrap();
let fo... | 2 | 2 | 8 |
e0e06d1c778601dfa7050f9d3f725b6571d3d6cb | Alex Butler | 2020-12-10T18:23:35 | Fix image deprecated usage in tests & examples | diff --git a/dev/examples/image.rs b/dev/examples/image.rs
index 5baa2eb..105fa8a 100644
--- a/dev/examples/image.rs
+++ b/dev/examples/image.rs
@@ -43,7 +43,7 @@ fn draw_image<F: Font>(font: F) {
};
// Create a new rgba image with some padding
- let mut image = DynamicImage::new_rgba8(glyphs_width + 40,... | 2 | 4 | 4 |
7773978666647a3ffeecdde63185a2a1e2a5d22e | Alex Butler | 2020-10-26T09:42:06 | Update dev dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 82b62d4..0f25108 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -11,7 +11,7 @@ ab_glyph = { path = "../glyph" }
image = { version = "0.23", default-features = false, features = ["png"] }
criterion = "0.3"
blake2 = "0.9"
-approx = "0.3.2"
+approx = "0.4"
[[be... | 1 | 1 | 1 |
e356e95cea42bcf541a85bdf9df0a7c0bbc3a75d | Rémi Lespinet | 2020-10-08T07:31:53 | Add methods to reset the Rasterizer without reallocating (#22) | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index 599b15d..a491d15 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -45,6 +45,37 @@ impl Rasterizer {
}
}
+ /// Resets the rasterizer to an empty `width` x `height` alpha grid. This method behaves as if
+ /... | 1 | 31 | 0 |
ddbf47fd390d4d562833ded8d16e604c2d857138 | Alex Butler | 2020-09-05T10:21:32 | Reproduce and fix rusttype_156 panic (#21) | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index 305f19a..599b15d 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -90,20 +90,28 @@ impl Rasterizer {
let x1i = x1ceil as i32;
if x1i <= x0i + 1 {
let xmf = 0.5 * (x + xnext) - x0floor... | 2 | 23 | 5 |
e830cc2457f0f44b21d3b8c1d4eaebeb3d2ac0d1 | Alex Butler | 2020-09-05T08:55:49 | Clarify OutlinedGlyph::draw docs (#19) | diff --git a/glyph/src/outlined.rs b/glyph/src/outlined.rs
index 054302a..f9667b8 100644
--- a/glyph/src/outlined.rs
+++ b/glyph/src/outlined.rs
@@ -84,8 +84,9 @@ impl OutlinedGlyph {
/// Draw this glyph outline using a pixel & coverage handling function.
///
- /// The callback will be called for each `(... | 1 | 3 | 2 |
7a6a5cd1b876550158e53fb8231b3115e305a0e5 | Diggory Hardy | 2020-07-19T11:11:25 | Add Font::units_per_em and unit-conversion documentation (#11) | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index d459bd2..4f6b766 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -2,9 +2,49 @@ use crate::{point, Glyph, GlyphId, Outline, OutlinedGlyph, PxScale, PxScaleFont,
/// Functionality required from font data.
///
-/// See [`FontArc`](struct.FontArc.html),... | 4 | 66 | 2 |
fcb1ab9f28d16b57b691b04742cf31ffe056eb0b | Alex Butler | 2020-06-15T07:09:40 | Add font-rs copyright to raster.rs | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index 8257d90..305f19a 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -1,4 +1,20 @@
// Forked/repurposed from `font-rs` code: https://github.com/raphlinus/font-rs
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licens... | 1 | 16 | 0 |
a5d789f3707db912ef1591be2ce8face2777fb0b | Alex Butler | 2020-06-11T09:40:40 | Update dev-dependencies | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 92a88a8..82b62d4 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -10,7 +10,7 @@ ab_glyph_rasterizer = { path = "../rasterizer" }
ab_glyph = { path = "../glyph" }
image = { version = "0.23", default-features = false, features = ["png"] }
criterion = "0.3"
-blake2... | 2 | 6 | 6 |
a605974c8fbdd8d22f6e952a9f98800e158832b8 | Alex Butler | 2020-05-28T17:39:18 | Fix some lints | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 2c25826..5e64afc 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -78,7 +78,6 @@ pub trait Font {
where
Self: Sized,
{
- use crate::ScaleFont;
let outline = self.outline(glyph.id)?;
let scale_factor = self.as_s... | 2 | 1 | 2 |
aa3896eebb3ed0e4339836784de3f17e3269714b | Alex Butler | 2020-05-20T08:09:41 | Use find_map instead of filter_map.next | diff --git a/glyph/src/ttfp.rs b/glyph/src/ttfp.rs
index 7acb474..4faad0d 100644
--- a/glyph/src/ttfp.rs
+++ b/glyph/src/ttfp.rs
@@ -192,8 +192,7 @@ macro_rules! impl_font {
.as_font()
.kerning_subtables()
.filter(|st| st.is_horizontal() && !st.is_variable(... | 1 | 1 | 2 |
48b356c45e591ca854ad733a62143adb5ed5bb63 | Alex Butler | 2020-05-13T18:09:09 | Add `_unscaled` to methods returning f32 unscaled metrics (#3)
* Add `_unscaled` to methods returning f32 unscaled metrics
* Add some missing docs | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 5ce52fa..7f77c0f 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -6,31 +6,47 @@ use crate::{Glyph, GlyphId, Outline, OutlinedGlyph, PxScale, PxScaleFont};
/// [`FontVec`](struct.FontVec.html).
pub trait Font {
/// Unscaled glyph ascent.
- fn a... | 5 | 65 | 49 |
52a04a3e6f80aa858d1f09c9597ded48300dc2af | Alex Butler | 2020-05-08T15:58:54 | Release ab_glyph 0.1 | diff --git a/glyph/Cargo.toml b/glyph/Cargo.toml
index b4fcfe1..ccc1754 100644
--- a/glyph/Cargo.toml
+++ b/glyph/Cargo.toml
@@ -5,13 +5,13 @@ authors = ["Alex Butler <alexheretic@gmail.com>"]
edition = "2018"
description = "API for loading, scaling, positioning and rasterizing OpenType font glyphs."
repository = "h... | 1 | 2 | 2 |
a9cc2b2bb879dfde5698e5626a55673b66007b56 | Alex Butler | 2020-05-08T14:13:04 | Expand wildcard imports | diff --git a/glyph/src/font_arc.rs b/glyph/src/font_arc.rs
index baa20ae..5c789df 100644
--- a/glyph/src/font_arc.rs
+++ b/glyph/src/font_arc.rs
@@ -1,4 +1,4 @@
-use crate::*;
+use crate::{Font, FontRef, FontVec, GlyphId, InvalidFont, Outline};
use alloc::sync::Arc;
use core::fmt;
diff --git a/glyph/src/ttfp.rs b/g... | 2 | 2 | 2 |
900137bce491ed1e3f0aa1a7325b9a6281bf7bae | Alex Butler | 2020-05-08T12:29:11 | Update docs | diff --git a/glyph/src/font.rs b/glyph/src/font.rs
index 993556b..5ce52fa 100644
--- a/glyph/src/font.rs
+++ b/glyph/src/font.rs
@@ -2,7 +2,8 @@ use crate::{Glyph, GlyphId, Outline, OutlinedGlyph, PxScale, PxScaleFont};
/// Functionality required from font data.
///
-/// See [`FontRef`](struct.FontRef.html) & [`Fon... | 3 | 16 | 8 |
1bf2ec763566808f93ffafeeb01202ed584577d7 | Alex Butler | 2020-05-06T17:27:01 | Require a useful font in FontArc | diff --git a/glyph/src/font_arc.rs b/glyph/src/font_arc.rs
index ed382aa..cb64fac 100644
--- a/glyph/src/font_arc.rs
+++ b/glyph/src/font_arc.rs
@@ -19,11 +19,11 @@ use core::fmt;
/// # Ok(()) }
/// ```
#[derive(Clone)]
-pub struct FontArc(Arc<dyn Font>);
+pub struct FontArc(Arc<dyn Font + Send + Sync + 'static>);
... | 1 | 4 | 4 |
553428e7365a2aba23e03889f7cdb23cd5b0daf8 | Alex Butler | 2020-05-04T19:46:21 | Add FontArc | diff --git a/dev/benches/layout.rs b/dev/benches/layout.rs
index 5b87fd1..767d2da 100644
--- a/dev/benches/layout.rs
+++ b/dev/benches/layout.rs
@@ -47,8 +47,10 @@ fn bench_layout_a_sentence(c: &mut Criterion) {
"e3ae01bfc47bcbfe9a2a060ef651cf466798410c60652540d467d5332a8fe028"
);
});
+}
- ... | 5 | 200 | 3 |
5acfe112337bbb0b629488e4fed9f6a07de38a76 | Alex Butler | 2020-05-04T19:33:32 | Fix assert fail on benches when not running them | diff --git a/dev/benches/rasterize.rs b/dev/benches/rasterize.rs
index 25cc744..c6bf7ea 100644
--- a/dev/benches/rasterize.rs
+++ b/dev/benches/rasterize.rs
@@ -18,14 +18,13 @@ macro_rules! bench_draw {
// call outline functions
let rasterizer = $raster_fn();
// draw i... | 1 | 9 | 16 |
37c1606b6839f8007299401ea9a49683271dfbc3 | Alex Butler | 2020-05-04T00:49:19 | Add more derives To Glyph, GlyphId, Rect | diff --git a/glyph/src/glyph.rs b/glyph/src/glyph.rs
index bc4e565..d0f6b7a 100644
--- a/glyph/src/glyph.rs
+++ b/glyph/src/glyph.rs
@@ -15,7 +15,7 @@ pub use ab_glyph_rasterizer::point;
/// let q_id: GlyphId = font.glyph_id('q');
/// # Ok(()) }
/// ```
-#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOr... | 2 | 3 | 3 |
38dffd9bef69366238f4c8c33ea5dd51783c9252 | Alex Butler | 2020-04-24T19:37:39 | Add Font::outline(id), outline_glyph, glyph_count | diff --git a/dev/benches/layout_draw.rs b/dev/benches/layout_draw.rs
index da5418e..ff0a375 100644
--- a/dev/benches/layout_draw.rs
+++ b/dev/benches/layout_draw.rs
@@ -29,7 +29,7 @@ fn bench_layout_and_draw(c: &mut Criterion) {
glyphs
.drain(..)
- .filter_map(|g| font.out... | 9 | 165 | 116 |
1d5e2301a9c6bb58a533a6e47d33af0c796e7057 | Alex Butler | 2020-04-24T09:16:07 | Add layout & draw benchmarks | diff --git a/dev/Cargo.toml b/dev/Cargo.toml
index 37a18e2..92a88a8 100644
--- a/dev/Cargo.toml
+++ b/dev/Cargo.toml
@@ -11,6 +11,7 @@ ab_glyph = { path = "../glyph" }
image = { version = "0.23", default-features = false, features = ["png"] }
criterion = "0.3"
blake2 = "0.8"
+approx = "0.3.2"
[[bench]]
name = "r... | 3 | 84 | 8 |
1039da747b63c9b9a3b043ee283cc1a19fad1006 | Alex Butler | 2020-04-22T00:23:43 | Add docs & improve trait flexibility
* impl Font for &Font
* impl ScaleFont for &ScaleFont
* Have a single `PxScaleFont` struct that implements Copy in the ref
case. | diff --git a/dev/benches/layout.rs b/dev/benches/layout.rs
index 58cfd67..95536c5 100644
--- a/dev/benches/layout.rs
+++ b/dev/benches/layout.rs
@@ -1,4 +1,4 @@
-use ab_glyph::{point, ttf_parser, Font, PxScale};
+use ab_glyph::*;
use blake2::{Blake2s, Digest};
use criterion::{criterion_group, criterion_main, Criterio... | 12 | 217 | 88 |
296ef09b07a1bc689f9e733150760815365641e4 | Alex Butler | 2020-04-20T19:23:42 | Blend ascii example coverage | diff --git a/dev/examples/ascii.rs b/dev/examples/ascii.rs
index 92191ca..84d98a6 100644
--- a/dev/examples/ascii.rs
+++ b/dev/examples/ascii.rs
@@ -48,35 +48,37 @@ fn draw_ascii<F: Font>(font: F) {
println!("width: {}, height: {}", px_width, px_height);
- // Rasterise directly into ASCII art.
- let mut ... | 1 | 15 | 13 |
c51a50364d8d423949878bbf59f433a9e3893d90 | Alex Butler | 2020-04-20T17:51:33 | Inject some ab_glyph personality into ascii example | diff --git a/dev/examples/ascii.rs b/dev/examples/ascii.rs
index 192d04f..e987567 100644
--- a/dev/examples/ascii.rs
+++ b/dev/examples/ascii.rs
@@ -2,7 +2,7 @@
use ab_glyph::*;
use std::io::Write;
-const TEXT: &str = "RustType";
+const TEXT: &str = "ab_glyph";
fn main() {
if let Some(font_path) = std::env:... | 1 | 16 | 13 |
c081567bc7f4ad36bcbce9668e1067b8c71ceced | Alex Butler | 2020-04-13T13:58:26 | Use `<= EPSILON`
This seems to be the more common use. | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index ab9dd3b..fe5ea51 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -48,7 +48,7 @@ impl Rasterizer {
/// rasterizer.draw_line(point(0.0, 0.48), point(1.22, 0.48));
/// ```
pub fn draw_line(&mut self, p0: Point, p1... | 1 | 1 | 1 |
d6294d46ee14fb09cd5d302f306318d34d38bac7 | Alex Butler | 2020-04-10T12:02:42 | Update manifests | diff --git a/glyph/Cargo.toml b/glyph/Cargo.toml
index 9940580..e056622 100644
--- a/glyph/Cargo.toml
+++ b/glyph/Cargo.toml
@@ -3,6 +3,11 @@ name = "ab_glyph"
version = "0.0.0"
authors = ["Alex Butler <alexheretic@gmail.com>"]
edition = "2018"
+description = "Glyph stuff"
+repository = "https://github.com/alexheret... | 2 | 6 | 1 |
c18796b04c0b55387400d029abbadb58b0faa401 | Alex Butler | 2020-04-10T10:05:27 | impl Debug for Rasterizer | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index 5853d1e..83bbde5 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -160,3 +160,12 @@ impl Rasterizer {
self.for_each_pixel(|idx, alpha| px_fn(idx as u32 % width32, idx as u32 / width32, alpha));
}
}
+
+impl core:... | 1 | 9 | 0 |
93c35fd09794755a2e4b3cd0228e136e8d4ab03e | Alex Butler | 2020-04-10T09:59:46 | Derive default for Point but don't bother with eq & ord. | diff --git a/rasterizer/src/geometry.rs b/rasterizer/src/geometry.rs
index e1f8763..ea8b36a 100644
--- a/rasterizer/src/geometry.rs
+++ b/rasterizer/src/geometry.rs
@@ -1,4 +1,4 @@
-#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)]
+#[derive(Clone, Copy, Debug, Default)]
pub struct Point {
pub x: f32,
pub... | 1 | 1 | 1 |
f67360862a10bb3554eddb4ed3f8579062b014dc | Alex Butler | 2020-04-10T09:39:02 | Tweak benchmark settings | diff --git a/dev/benches/draw.rs b/dev/benches/draw.rs
index 87e62fa..d34fd21 100644
--- a/dev/benches/draw.rs
+++ b/dev/benches/draw.rs
@@ -1,4 +1,5 @@
use criterion::{criterion_group, criterion_main, Criterion};
+use std::time::Duration;
/// Runs a single rasterization function benchmark.
/// Calls draw_* outlin... | 1 | 15 | 9 |
ba8e1cd1d2c22ca7ada596191c3a68f329afa4da | Alex Butler | 2020-04-09T17:23:27 | Simplify tesselate_cubic logic | diff --git a/rasterizer/src/raster.rs b/rasterizer/src/raster.rs
index f21922e..5853d1e 100644
--- a/rasterizer/src/raster.rs
+++ b/rasterizer/src/raster.rs
@@ -128,23 +128,17 @@ impl Rasterizer {
let flatness_squared = longlen * longlen - shortlen * shortlen;
if n < MAX_RECURSION_DEPTH && flatness_... | 1 | 8 | 14 |
1ac798ae4ea365d44a4126043c9b23153662d50a | Alex Butler | 2020-04-09T17:23:18 | Add additional benchmarks separating drawing outlines & accumulation | diff --git a/dev/benches/draw.rs b/dev/benches/draw.rs
index eb7fb3b..87e62fa 100644
--- a/dev/benches/draw.rs
+++ b/dev/benches/draw.rs
@@ -1,6 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
/// Runs a single rasterization function benchmark.
+/// Calls draw_* outline function then `for_each_... | 1 | 70 | 2 |
2349b494827807791473f3c6ca9b2fc5ef274cdb | Valentin Isipchuk | 2025-12-25T08:46:07 | Add support of absolute paths
Fix failed on windows test
Add test to verify unpacking of archive with absolute path
Remove allow_absolute parameter from public Builder methods
Fix semver; Add methods to header to set absolute path | diff --git a/src/builder.rs b/src/builder.rs
index 88164c8..959e344 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -23,6 +23,7 @@ pub struct Builder<W: Write> {
#[derive(Clone, Copy)]
struct BuilderOptions {
mode: HeaderMode,
+ preserve_absolute: bool,
follow: bool,
sparse: bool,
}
@@ -35,6 +3... | 4 | 212 | 39 |
17b1fd84e632071cb8eef9d3709bf347bd266446 | Alex Crichton | 2026-03-19T21:58:05 | archive: Prevent symlink-directory collision chmod attack (#442)
When unpacking a tarball containing a symlink followed by a directory
entry with the same path, unpack_dir previously used fs::metadata()
which follows symlinks. This allowed an attacker to modify permissions
on arbitrary directories outside the extracti... | diff --git a/src/archive.rs b/src/archive.rs
index 226639d..a3ae6f0 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -93,9 +93,21 @@ impl<R: Read> Archive<R> {
/// extracting each file in turn to the location specified by the entry's
/// path name.
///
- /// This operation is relatively sensitive i... | 3 | 75 | 6 |
de1a5870e603758f430073688691165f21a33946 | Alex Crichton | 2026-03-19T21:56:51 | archive: Unconditionally honor PAX size (#441)
This synchronizes our behavior with most other tar parsers
(including astral-tokio-tar and Go archive/tar) ensuring
that we don't parse things differently.
The problem with parsing size in particular differently is
it's easy to craft a tar archive that appears completely... | diff --git a/Cargo.toml b/Cargo.toml
index 5188cc0..852590f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,8 +23,11 @@ contents are never required to be entirely resident in memory all at once.
filetime = "0.2.8"
[dev-dependencies]
+astral-tokio-tar = "0.5"
rand = { version = "0.8", features = ["small_rng"] }
te... | 3 | 159 | 4 |
ad1fde9edfb9657d17666bbec2933119ce527359 | Colin Walters | 2026-03-10T12:41:32 | build-sys: Promote unused_code to an error | diff --git a/Cargo.toml b/Cargo.toml
index 36afe4c..5188cc0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,3 +32,7 @@ libc = "0.2"
[features]
default = ["xattr"]
+
+[lints.rust]
+# Feel free to comment this one out locally during development of a patch.
+dead_code = "deny" | 1 | 4 | 0 |
c8cb250e8bc3f28bd69406b396bb8a92b40012c1 | Colin Walters | 2026-03-10T12:39:28 | tests: Squash a warning
Sorry I missed this one, some refactoring led to code duplication. | diff --git a/tests/all.rs b/tests/all.rs
index 1e9147b..c268574 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -55,14 +55,7 @@ impl<R: Read> Read for RandomReader<R> {
/// The RNG is seeded from a hash of the data, so different archives
/// exercise different read-size sequences while remaining deterministic.
fn ra... | 1 | 1 | 8 |
32a9bbb26468cbdecbf73fe8eb249284d4a718ed | Colin Walters | 2026-03-03T19:58:51 | tests: Add RandomReader to exercise partial-read resilience (#436)
Wrap in-memory archive readers in tests with a RandomReader that
returns 1..=N bytes per read() call using a deterministic seeded
RNG. This ensures the tar parser correctly handles partial reads
rather than assuming read() fills the entire buffer.
Ins... | diff --git a/Cargo.toml b/Cargo.toml
index 987bda3..36afe4c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,6 +23,7 @@ contents are never required to be entirely resident in memory all at once.
filetime = "0.2.8"
[dev-dependencies]
+rand = { version = "0.8", features = ["small_rng"] }
tempfile = "3"
[target."cf... | 2 | 85 | 32 |
9c5df0bfd70d1b063516b90fca2cf2e0dbe8b758 | MichelOS | 2026-02-27T15:47:45 | Fix GNU long-name extension stream corruption on validation error (#434)
In prepare_header_path, the GNU long-name extension entry was written to
the stream before validating the truncated path via
set_truncated_path_for_gnu_header. If validation failed (e.g., the
truncated path contained '..'), the extension entry wa... | diff --git a/src/builder.rs b/src/builder.rs
index f2d2946..88164c8 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -756,21 +756,25 @@ fn prepare_header_path(dst: &mut dyn Write, header: &mut Header, path: &Path) ->
if data.len() < max {
return Err(e);
}
- let header2 = prepare... | 2 | 48 | 5 |
88b1e3b0da65b0c5b9750d1a75516145488f4793 | Andrew Scheller | 2026-02-23T21:22:46 | Fix docs typo in header.rs (#431) | diff --git a/src/header.rs b/src/header.rs
index 428d250..8413d10 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -123,7 +123,7 @@ pub struct GnuHeader {
pub pad: [u8; 17],
}
-/// Description of the header of a spare entry.
+/// Description of the header of a sparse entry.
///
/// Specifies the offset/numbe... | 1 | 1 | 1 |
20a650970793e56238b58ac2f51773d343b02117 | Weihang Lo | 2025-11-23T18:08:25 | fix: expose DETERMINISTIC_TIMESTAMP (#420) | diff --git a/src/header.rs b/src/header.rs
index fd4a1de..428d250 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -21,7 +21,7 @@ use crate::EntryType;
/// This value, chosen after careful deliberation, corresponds to _Jul 23, 2006_,
/// which is the date of the first commit for what would become Rust.
#[cfg(all(an... | 2 | 3 | 1 |
d0261f1f6cc959ba0758e7236b3fd81e90dd1dc6 | Taylor Cramer | 2025-10-07T20:03:54 | OSS-Fuzz: Use derive via Arbitrary feature flag (#416)
Before this change, the fuzzing target uses the arbitrary crate without its
derive feature flag, and instead imports both the Arbitrary type from the
arbitrary crate and the Arbitrary derive macro from the derive_arbitrary
crate.
When building in an environment t... | diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 7eaff13..1dc1dff 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -8,9 +8,8 @@ edition = "2018"
cargo-fuzz = true
[dependencies]
-arbitrary = "1.3.2"
+arbitrary = { version = "1.3.2", features = ["derive"] }
cap-std = "3.4.0"
-derive_arbitrary = "1.3.2"
li... | 2 | 1 | 3 |
6ab0da5ff4fac6a7dd2c7e0995fe12521622ef2b | Colin Walters | 2025-10-01T01:45:32 | Fix lints (#414)
* Fix new elided lifetimes lint from Rust 1.89
https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#mismatched-lifetime-syntaxes-lint
Signed-off-by: Colin Walters <walters@verbum.org>
* Fix clippy lints and tweak doc comemnt for EntryType
Clippy warned about a blank line in `EntryType` but the doc
c... | diff --git a/Cargo.toml b/Cargo.toml
index 99220d7..987bda3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ license = "MIT OR Apache-2.0"
keywords = ["tar", "tarfile", "encoding"]
readme = "README.md"
edition = "2021"
+rust-version = "1.63"
exclude = ["tests/archives/*"]
description = """
diff --git a/s... | 6 | 30 | 33 |
a1c3036af48fa02437909112239f0632e4cfcfae | Khải | 2025-06-05T20:58:47 | Fix some spellings (#402) | diff --git a/src/archive.rs b/src/archive.rs
index 4bc95dc..c1ee8f2 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -228,7 +228,7 @@ impl Archive<dyn Read + '_> {
let dst = &dst.canonicalize().unwrap_or(dst.to_path_buf());
// Delay any directory entries until the end (they will be created if nee... | 3 | 5 | 5 |
c7c54799f926a1bd3a2ed641fc994ebebce7d7dd | Khải | 2025-06-05T20:07:32 | refactor: implement recommendations from clippy (#401)
* refactor: implement recommendations from clippy
* fix: fmt
* refactor: shorten code | diff --git a/examples/extract_file.rs b/examples/extract_file.rs
index 425e9a3..6a415a6 100644
--- a/examples/extract_file.rs
+++ b/examples/extract_file.rs
@@ -13,7 +13,7 @@ use std::path::Path;
use tar::Archive;
fn main() {
- let first_arg = args_os().skip(1).next().unwrap();
+ let first_arg = args_os().nth... | 8 | 56 | 63 |
0671e117756b3daf9d6e5951b22c39a516e5fd53 | Alex Crichton | 2025-02-22T00:58:58 | Bump to 0.4.44 (#399) | diff --git a/Cargo.toml b/Cargo.toml
index 9334685..99220d7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "tar"
-version = "0.4.43"
+version = "0.4.44"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
bcc77b4e4e219b2d9c3cee4ee33255b16cc88bc1 | Neil Mitchell | 2025-02-12T07:47:35 | Make it compile with wasm32-unknown-emscripten (#397)
Summary:
Test Plan: | diff --git a/src/entry.rs b/src/entry.rs
index b6b48b4..843719f 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -603,7 +603,7 @@ impl<'a> EntryFields<'a> {
::std::os::windows::fs::symlink_file(src, dst)
}
- #[cfg(unix)]
+ #[cfg(all(unix, not(target_arch = "wasm32"))... | 2 | 8 | 8 |
b6c50246286a17623d1be828137e20fdc2b09e2e | xzfc | 2024-12-09T22:26:39 | Replace hard-coded 512 with BLOCK_SIZE (#394)
Co-authored-by: ncihnegn <ncihnegn@users.noreply.github.com> | diff --git a/src/archive.rs b/src/archive.rs
index 3cf72c4..4d569c6 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -9,6 +9,7 @@ use std::path::Path;
use crate::entry::{EntryFields, EntryIo};
use crate::error::TarError;
+use crate::header::BLOCK_SIZE;
use crate::other;
use crate::pax::*;
use crate::{Entry, G... | 3 | 34 | 23 |
3fd55a122f4320d5a3acbaf4df077303d594965e | Andrew Dunbar | 2024-12-09T14:19:54 | minor English grammar (#393)
If the ... list ... are returned -> If the ... list ... is returned | diff --git a/src/archive.rs b/src/archive.rs
index 924e54a..3cf72c4 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -258,7 +258,7 @@ impl Archive<dyn Read + '_> {
impl<'a, R: Read> Entries<'a, R> {
/// Indicates whether this iterator will return raw entries or not.
///
- /// If the raw list of entries... | 1 | 1 | 1 |
f71915a3d047dce2841bd18f4ca9194367bf2b32 | Mateusz Kwapich | 2024-12-05T14:03:44 | fix for archiving long paths that have path components starting with ".." crossing the 100-character mark (#390)
* test showing problem with long paths that have a component starting with .. at 100-character mark
his test checks very particular scenario where path component starting with
".." of a long path gets s... | diff --git a/src/builder.rs b/src/builder.rs
index 82e7354..569b14e 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -768,7 +768,7 @@ fn prepare_header_path(dst: &mut dyn Write, header: &mut Header, path: &Path) ->
Ok(s) => s,
Err(e) => str::from_utf8(&data[..e.valid_up_to()]).unwrap(),
... | 3 | 88 | 15 |
2064e86eb331966e916ceb31244758187b58b038 | Fabian-Gruenbichler | 2024-11-10T17:36:57 | sparse test: fix for 64k page size (#387)
this test failed on Debian's CI on ppc64el, because the page size is
64k there, which means the block size on tmpfs is as well, so attempting
to create 32k big holes cannot work.
Signed-off-by: Fabian Grünbichler <git@fabian.gruenbichler.email>
Co-authored-by: Fabian Grü... | diff --git a/src/builder.rs b/src/builder.rs
index b9baaed..82e7354 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -1114,8 +1114,9 @@ impl<W: Write> Drop for Builder<W> {
mod tests {
use super::*;
- /// Should be multiple of 4KiB on ext4, multiple of 32KiB on FreeBSD/UFS.
- const SPARSE_BLOCK_SIZE: u... | 1 | 3 | 2 |
2b1d3741f9b1f6f9787721ced7bbf10b611feda4 | Colin Walters | 2024-11-01T20:00:08 | Release 0.4.43 (#386)
The main feature in this release is a new API to write PAX
extensions. | diff --git a/Cargo.toml b/Cargo.toml
index 979cb77..9334685 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "tar"
-version = "0.4.42"
+version = "0.4.43"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
adbbc29d94566607206e49160ae830911aaf70d6 | gwitrand-ovh | 2024-10-24T17:32:52 | Very basic Pax header writer (#382)
* Implementation of a PAX header writer
This crate currently supports reading the PAX headers. This adds a way to write
some PAX headers in a Builder.
Also implemented tests to showcase usage
* Pax header handler, switch to not owned data types
Since we can keep the owner... | diff --git a/src/pax.rs b/src/pax.rs
index 6e83edc..d149428 100644
--- a/src/pax.rs
+++ b/src/pax.rs
@@ -1,5 +1,6 @@
#![allow(dead_code)]
use std::io;
+use std::io::Write;
use std::slice;
use std::str;
@@ -145,3 +146,50 @@ impl<'entry> PaxExtension<'entry> {
self.value
}
}
+
+/// Extension trait fo... | 3 | 86 | 3 |
e0e69f6315e3f754358484d44b791227793d6082 | Colin Walters | 2024-10-24T15:57:44 | tests: Just use `unwrap()` (#384)
I don't think this unique-to-us `t!` macro is gaining anything
really over just calling `unwrap()` directly which is *way*
more widely used and idiomatic.
I only converted a few testing functions to start momentum
and hopefully new code can avoid `t!`.
Signed-off-by: Colin Wa... | diff --git a/tests/all.rs b/tests/all.rs
index eff0e4d..0d1b79d 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -232,7 +232,7 @@ fn reading_entries() {
fn reading_entries_with_seek() {
let rdr = Cursor::new(tar!("reading_files.tar"));
let mut ar = Archive::new(rdr);
- reading_entries_common(t!(ar.entries_... | 1 | 3 | 3 |
9bd13727327822292a0f9712596a0b3845de9cfe | Colin Walters | 2024-10-24T15:56:24 | entry: Use our const for xattrs (#383)
General code cleanup but the specific rationale here is I was
trying to find the places this was used in the code and
was surprising cross-referencing didn't turn up the unpacking code.
Signed-off-by: Colin Walters <walters@verbum.org> | diff --git a/src/entry.rs b/src/entry.rs
index cd26e6b..b6b48b4 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -869,7 +869,7 @@ impl<'a> EntryFields<'a> {
.filter_map(|e| e.ok())
.filter_map(|e| {
let key = e.key_bytes();
- let prefix = b"SCHILY... | 1 | 1 | 1 |
a1fd01107b8e23a6b12d0c16badcb96ebc88aab6 | Colin Walters | 2024-09-26T09:08:46 | EntryWriter: Add comments for why ManuallyDrop is OK (#380)
* EntryWriter: Add comments for why ManuallyDrop is OK
This wasn't immediately obvious to me at least.
xref: https://github.com/alexcrichton/tar-rs/pull/376#discussion_r1774321907
Signed-off-by: Colin Walters <walters@verbum.org>
Co-authored-by: xzfc ... | diff --git a/src/builder.rs b/src/builder.rs
index 3c94359..b9baaed 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -502,6 +502,8 @@ impl<T: Write + Seek> SeekWrite for T {
/// After writing all data to the entry, it must be finalized either by
/// explicitly calling [`EntryWriter::finish`] or by letting it drop.... | 1 | 11 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.