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: f64The 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§
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>
impl<const COLOR: bool, const APPLE: bool> Table for BitmapData<COLOR, APPLE>
Source§fn compile(&mut self, font: &mut Font) -> Result<Vec<u8>>
fn compile(&mut self, font: &mut Font) -> Result<Vec<u8>>
Compiles the table to binary (
compile).Source§fn clone_table(&self) -> Box<dyn Table>
fn clone_table(&self) -> Box<dyn Table>
A deep copy.
Source§fn remap_glyphs(&mut self, f: &mut dyn FnMut(u32) -> Result<u32>) -> Result<()>
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)
fn ensure_decompiled(&mut self)
Expands whatever was left compact when reading (
ensureDecompiled).Source§fn is_raw(&self) -> bool
fn is_raw(&self) -> bool
Whether this is a plain
DefaultTable, which TTX marks as raw.Source§fn decompile_error(&self) -> Option<&str>
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>
impl<const COLOR: bool, const APPLE: bool> TableType for BitmapData<COLOR, APPLE>
Source§const COMPANION: Option<Tag> = None
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".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>where
*const u8 is !null: Freeze,
PhantomData<BitmapGlyph>: Freeze,
PhantomData<Option<StrikeData>>: Freeze,
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>
impl<const COLOR: bool, const APPLE: bool> Sync for BitmapData<COLOR, APPLE>
impl<const COLOR: bool, const APPLE: bool> Unpin for BitmapData<COLOR, APPLE>
impl<const COLOR: bool, const APPLE: bool> UnsafeUnpin for BitmapData<COLOR, APPLE>where
*const u8 is !null: UnsafeUnpin,
PhantomData<BitmapGlyph>: UnsafeUnpin,
PhantomData<Option<StrikeData>>: UnsafeUnpin,
impl<const COLOR: bool, const APPLE: bool> UnwindSafe for BitmapData<COLOR, APPLE>
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