Skip to main content

BitmapData

Struct BitmapData 

Source
pub struct BitmapData<const COLOR: bool, const APPLE: bool = false> {
    pub version: f64,
    pub glyphs: Vec<BitmapGlyph>,
    pub strike_data: Vec<Option<StrikeData>>,
}
Expand description

Embedded (COLOR false) or Color (COLOR true) Bitmap Data table (table_E_B_D_T_, table_C_B_D_T_), or with APPLE, Apple’s bdat (table__b_d_a_t).

See https://learn.microsoft.com/en-us/typography/opentype/spec/ebdt and https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt.

Fields§

§version: f64

The table version.

§glyphs: Vec<BitmapGlyph>

All glyphs. Strikes refer to them by index, so that glyphs at the same location share an entry (object identity in fontTools).

§strike_data: Vec<Option<StrikeData>>

The glyphs by strike (strikeData). Only a TTX document with gaps in its strike indices leaves Nones.

Trait Implementations§

Source§

impl<const COLOR: bool, const APPLE: bool> Clone for BitmapData<COLOR, APPLE>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const COLOR: bool, const APPLE: bool> Debug for BitmapData<COLOR, APPLE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const COLOR: bool, const APPLE: bool> Default for BitmapData<COLOR, APPLE>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const COLOR: bool, const APPLE: bool> PartialEq for BitmapData<COLOR, APPLE>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<const COLOR: bool, const APPLE: bool> StructuralPartialEq for BitmapData<COLOR, APPLE>

Source§

impl<const COLOR: bool, const APPLE: bool> Table for BitmapData<COLOR, APPLE>

Source§

fn tag(&self) -> Tag

The table tag (tableTag).
Source§

fn compile(&mut self, font: &mut Font) -> Result<Vec<u8>>

Compiles the table to binary (compile).
Source§

fn clone_table(&self) -> Box<dyn Table>

A deep copy.
Source§

fn remap_glyphs(&mut self, f: &mut dyn FnMut(u32) -> Result<u32>) -> Result<()>

Maps every glyph ID in the table with f, as when the glyph order changes (fontTools refers to glyphs by name, so this happens implicitly there). f fails for glyphs that no longer exist.
Source§

fn ensure_decompiled(&mut self)

Expands whatever was left compact when reading (ensureDecompiled).
Source§

fn is_raw(&self) -> bool

Whether this is a plain DefaultTable, which TTX marks as raw.
Source§

fn decompile_error(&self) -> Option<&str>

The error message, if decompilation failed and the table was kept as raw data (ERROR).
Source§

impl<const COLOR: bool, const APPLE: bool> TableType for BitmapData<COLOR, APPLE>

Source§

const TAG: Tag

The tag of this table type.
Source§

fn decompile(data: &[u8], font: &mut Font) -> Result<Self>

Parses the table (decompile).
Source§

const COMPANION: Option<Tag> = None

The tag of the beyond-64k companion that this type also implements, as GLYF for glyf. Font::get prefers it, as fontTools does with its "GLYF" if "GLYF" in font else "glyf".
Source§

fn decompile_as(tag: Tag, data: &[u8], font: &mut Font) -> Result<Self>

Parses the table under one of its tags.
Source§

fn new_as(tag: Tag) -> Self
where Self: Default,

An empty table with one of its tags (newTable).
Source§

impl<const COLOR: bool, const APPLE: bool> TableXml for BitmapData<COLOR, APPLE>

Source§

fn to_xml(&self, writer: &mut XmlWriter, font: &mut Font) -> Result<()>

Writes the table’s TTX content, without the enclosing table element (toXML).
Source§

fn from_xml(&mut self, element: &Element, font: &mut Font) -> Result<()>

Reads one child element of the table’s TTX element (fromXML).

Auto Trait Implementations§

§

impl<const COLOR: bool, const APPLE: bool> Forget for BitmapData<COLOR, APPLE>

§

impl<const COLOR: bool, const APPLE: bool> Freeze for BitmapData<COLOR, APPLE>

§

impl<const COLOR: bool, const APPLE: bool> Move for BitmapData<COLOR, APPLE>

§

impl<const COLOR: bool, const APPLE: bool> RefUnwindSafe for BitmapData<COLOR, APPLE>

§

impl<const COLOR: bool, const APPLE: bool> Send for BitmapData<COLOR, APPLE>
where RawVecInner: Send, RawTable<(u32, usize)>: Send,

§

impl<const COLOR: bool, const APPLE: bool> Sync for BitmapData<COLOR, APPLE>
where RawVecInner: Sync, RawTable<(u32, usize)>: Sync,

§

impl<const COLOR: bool, const APPLE: bool> Unpin for BitmapData<COLOR, APPLE>
where *const u8 is !null: Unpin,

§

impl<const COLOR: bool, const APPLE: bool> UnsafeUnpin for BitmapData<COLOR, APPLE>

§

impl<const COLOR: bool, const APPLE: bool> UnwindSafe for BitmapData<COLOR, APPLE>
where RawVecInner: UnwindSafe, HashMap<u32, usize>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

self as &dyn Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

self as &mut dyn Any.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.