collect_used_chars

Function collect_used_chars 

Source
pub fn collect_used_chars(text: &str) -> HashSet<char>
Expand description

Collects all unique characters from a string.

This is useful for determining which characters are actually used in a document before creating a subset.

ยงExample

use genpdfi_extended::subsetting::collect_used_chars;

let text = "Hello World! Hello again!";
let chars = collect_used_chars(text);
assert_eq!(chars.len(), 13);  // H, e, l, o, space, W, r, d, !, a, g, i, n