mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-26 19:19:10 -06:00
chore(a11y, fonts): satisfy clippy in the CID width ranges and a test helper
This commit is contained in:
@@ -1033,7 +1033,7 @@ fn mark_reads(f: impl FnOnce()) -> usize {
|
||||
/// Page content nesting `depth` unmarked `BMC` blocks around a marked one, with `ops` operators inside.
|
||||
fn deeply_nested_page(doc: &mut Document, depth: usize, ops: usize) -> pdfcraft_cos::Dict {
|
||||
use pdfcraft_cos::{Dict, Stream};
|
||||
let mut data = "/Figure << /MCID 0 >> BDC ".repeat(1);
|
||||
let mut data = "/Figure << /MCID 0 >> BDC ".to_string();
|
||||
data.push_str(&"/X BMC ".repeat(depth));
|
||||
data.push_str(&"0 0 1 1 re f ".repeat(ops));
|
||||
data.push_str(&"EMC ".repeat(depth + 1));
|
||||
|
||||
@@ -714,10 +714,10 @@ impl Metrics {
|
||||
i += 2;
|
||||
}
|
||||
Some(c1) => {
|
||||
if let (Some(c1), Some(v)) = (c1.as_f64(), w.get(i + 2).and_then(|x| doc.resolve(x).as_f64())) {
|
||||
if ranges.len() < MAX_CMAP_ENTRIES {
|
||||
ranges.push((c0, c1 as u32, v));
|
||||
}
|
||||
if let (Some(c1), Some(v)) = (c1.as_f64(), w.get(i + 2).and_then(|x| doc.resolve(x).as_f64()))
|
||||
&& ranges.len() < MAX_CMAP_ENTRIES
|
||||
{
|
||||
ranges.push((c0, c1 as u32, v));
|
||||
}
|
||||
i += 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user