pub struct Glyph {
pub name: String,
pub encoding: Encoding,
pub width_horizontal: Option<GlyphWidth>,
pub width_vertical: Option<GlyphWidth>,
pub bounding_box: BoundingBox,
pub origin_offset: Option<Coord>,
pub bitmap: Vec<u8>,
}Expand description
Glyph.
Fields§
§name: StringName.
Specified by STARTCHAR.
encoding: EncodingEncoding.
Specified by ENCODING.
width_horizontal: Option<GlyphWidth>Width for writing mode 0.
Specified by DWIDTH and SWIDTH and used for METRICSSET 0 and
METRICSSET 2.
width_vertical: Option<GlyphWidth>Width for writing mode 1.
Specified by DWIDTH1 and SWIDTH1 and used for METRICSSET 1 and
METRICSSET 2.
bounding_box: BoundingBoxBounding box.
Specified by BBX.
origin_offset: Option<Coord>Origin offset between writing mode 0 and 1.
Specified by VVECTOR.
bitmap: Vec<u8>Bitmap data.
Specified by the hex values between BITMAP and ENDCHAR.
Implementations§
Source§impl Glyph
impl Glyph
Sourcepub fn pixel(&self, x: usize, y: usize) -> Option<bool>
pub fn pixel(&self, x: usize, y: usize) -> Option<bool>
Returns a pixel from the bitmap.
This method doesn’t use the BDF coordinate system. The coordinates are relative to the top left corner of the bounding box and don’t take the offset into account. Y coordinates increase downwards.
Returns None if the coordinates are outside the bitmap.
Trait Implementations§
impl StructuralPartialEq for Glyph
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnsafeUnpin for Glyph
impl UnwindSafe for Glyph
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