Struct write_fonts::TableWriter
source · pub struct TableWriter { /* private fields */ }
Expand description
An object that manages a collection of serialized tables.
This handles deduplicating objects and tracking offsets.
Implementations§
source§impl TableWriter
impl TableWriter
sourcepub fn write_slice(&mut self, bytes: &[u8])
pub fn write_slice(&mut self, bytes: &[u8])
Write raw bytes into this table.
The caller is responsible for ensuring bytes are in big-endian order.
sourcepub fn write_offset(&mut self, obj: &dyn FontWrite, width: usize)
pub fn write_offset(&mut self, obj: &dyn FontWrite, width: usize)
Create an offset to another table.
The width
argument is the size in bytes of the offset, e.g. 2 for
an Offset16
, and 4 for an Offset32
.
The provided table will be serialized immediately, and the position of the offset within the current table will be recorded. Offsets are resolved when the root table object is serialized, at which point we overwrite each recorded offset position with the final offset of the appropriate table.
Trait Implementations§
source§impl Debug for TableWriter
impl Debug for TableWriter
Auto Trait Implementations§
impl RefUnwindSafe for TableWriter
impl Send for TableWriter
impl Sync for TableWriter
impl Unpin for TableWriter
impl UnwindSafe for TableWriter
Blanket Implementations§
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
Convert this type into
T
, using the provided data to resolve any offsets.