pub(crate) struct DocEncoding {
pub differences: Vec<(u8, &'static str)>,
pub byte_for_char: HashMap<char, u8>,
pub to_unicode_entries: Vec<(u8, char)>,
}Expand description
Per-font planning output. The PDF emit path consumes this once per document.
Fields§
§differences: Vec<(u8, &'static str)>Slots remapped on top of WinAnsiEncoding. Sorted ascending
by slot so the emitted /Differences array is stable.
byte_for_char: HashMap<char, u8>Direct char → byte for the content-stream encoder. Covers
both WinAnsi natives (mapping to their canonical byte) and
extended chars (mapping to a remapped slot).
to_unicode_entries: Vec<(u8, char)>Byte → original Unicode codepoint for the /ToUnicode CMap.
Ascending by byte for stable output.
Implementations§
Source§impl DocEncoding
impl DocEncoding
Sourcepub(crate) fn has_differences(&self) -> bool
pub(crate) fn has_differences(&self) -> bool
true if this face needs a custom /Encoding dict (one or
more remapped slots). When false, callers should emit the
existing /Encoding /WinAnsiEncoding shortcut and skip
/ToUnicode.
Trait Implementations§
Source§impl Clone for DocEncoding
impl Clone for DocEncoding
Source§fn clone(&self) -> DocEncoding
fn clone(&self) -> DocEncoding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocEncoding
impl Debug for DocEncoding
Source§impl Default for DocEncoding
impl Default for DocEncoding
Source§fn default() -> DocEncoding
fn default() -> DocEncoding
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DocEncoding
impl RefUnwindSafe for DocEncoding
impl Send for DocEncoding
impl Sync for DocEncoding
impl Unpin for DocEncoding
impl UnsafeUnpin for DocEncoding
impl UnwindSafe for DocEncoding
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.