pub struct GlyphAtlas {
pub cell_w: u32,
pub cell_h: u32,
/* private fields */
}Expand description
Alpha masks for every glyph at one cell size.
Fields§
§cell_w: u32§cell_h: u32Implementations§
Source§impl GlyphAtlas
impl GlyphAtlas
Sourcepub fn for_graph(graph: &SceneGraph) -> Self
pub fn for_graph(graph: &SceneGraph) -> Self
The atlas a scene’s glyphs are drawn with: in its letter set.
Sourcepub fn for_letters(spec: &GridSpec, letters: &str) -> Self
pub fn for_letters(spec: &GridSpec, letters: &str) -> Self
Atlas for a grid in a letter set (clairlune_scene::glyphs::LETTERS):
the bundled font’s characters, katakana from the kana font, narrowed
to the cell, and braille drawn as dots.
Sourcepub fn for_char_set(
chars: &[char],
cell_w: u32,
cell_h: u32,
font_px: f64,
) -> Self
pub fn for_char_set( chars: &[char], cell_w: u32, cell_h: u32, font_px: f64, ) -> Self
Atlas for an arbitrary character list: rasterizes the bundled monospace
font, narrows katakana from the kana font, and draws braille patterns
(U+2801..=U+28FF) as crisp supersampled dots.
Sourcepub fn with_font(
font: &[u8],
cell_w: u32,
cell_h: u32,
font_px: f64,
) -> Result<Self, AtlasError>
pub fn with_font( font: &[u8], cell_w: u32, cell_h: u32, font_px: f64, ) -> Result<Self, AtlasError>
Atlas from arbitrary font bytes.
Sourcepub fn with_chars(
font: &[u8],
chars: &[char],
cell_w: u32,
cell_h: u32,
font_px: f64,
) -> Result<Self, AtlasError>
pub fn with_chars( font: &[u8], chars: &[char], cell_w: u32, cell_h: u32, font_px: f64, ) -> Result<Self, AtlasError>
An atlas of these characters (mask i is chars[i]’s), for text
beyond the scene’s glyphs, such as a signature.
Trait Implementations§
Source§impl Clone for GlyphAtlas
impl Clone for GlyphAtlas
Source§impl Debug for GlyphAtlas
impl Debug for GlyphAtlas
Source§impl<'de> Deserialize<'de> for GlyphAtlas
impl<'de> Deserialize<'de> for GlyphAtlas
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GlyphAtlas
Source§impl PartialEq for GlyphAtlas
impl PartialEq for GlyphAtlas
Source§impl Serialize for GlyphAtlas
impl Serialize for GlyphAtlas
impl StructuralPartialEq for GlyphAtlas
Auto Trait Implementations§
impl Forget for GlyphAtlas
impl Freeze for GlyphAtlas
impl Move for GlyphAtlas
impl RefUnwindSafe for GlyphAtlas
impl Send for GlyphAtlas
impl Sync for GlyphAtlas
impl Unpin for GlyphAtlas
impl UnsafeUnpin for GlyphAtlas
impl UnwindSafe for GlyphAtlas
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