pub struct EmbeddedPdfFontSubset {
pub font_program: Vec<u8>,
pub widths: Vec<PdfCidWidth>,
pub to_unicode: Vec<(u32, String)>,
pub glyph_count: u16,
}Expand description
Result of subset_for_pdf: everything pdf_compose.rs (lane C1) needs to emit §7.4’s
Type0/CIDFontType2/FontFile2/ToUnicode object graph for one embedded font subset.
This implementation assigns CIDs to equal the subset font’s own new (post-subsetting) glyph
ids — i.e. /CIDToGIDMap /Identity is always correct for a subset this function produced,
so callers never need a separate CIDToGIDMap stream. /Encoding /Identity-H (§7.4) then maps
each 2-byte code directly to that CID/GID.
Fields§
§font_program: Vec<u8>Subset TrueType font program bytes for the FontFile2 stream.
widths: Vec<PdfCidWidth>/W array entries, one per CID actually used by text. Order matches first-appearance
order in text, not sorted — pdf_compose.rs is free to sort/compact before emitting.
to_unicode: Vec<(u32, String)>(cid, unicode) pairs for the generated ToUnicode CMap — see build_to_unicode_cmap.
glyph_count: u16Number of glyphs in font_program (subset maxp.numGlyphs), for callers that want to
sanity-check /CIDToGIDMap /Identity bounds before composing. Not yet read by any caller
in this crate — part of the struct’s documented API surface for a future consumer.
Trait Implementations§
Source§impl Clone for EmbeddedPdfFontSubset
impl Clone for EmbeddedPdfFontSubset
Auto Trait Implementations§
impl Freeze for EmbeddedPdfFontSubset
impl RefUnwindSafe for EmbeddedPdfFontSubset
impl Send for EmbeddedPdfFontSubset
impl Sync for EmbeddedPdfFontSubset
impl Unpin for EmbeddedPdfFontSubset
impl UnsafeUnpin for EmbeddedPdfFontSubset
impl UnwindSafe for EmbeddedPdfFontSubset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.