pub struct FontAtlasData {
pub font_name: CompactString,
pub font_size: f32,
pub max_halfwidth_base_glyph_id: u16,
pub texture_dimensions: (i32, i32, i32),
pub cell_size: (i32, i32),
pub underline: LineDecoration,
pub strikethrough: LineDecoration,
pub glyphs: Vec<Glyph>,
pub texture_data: Vec<u8>,
}Expand description
Font atlas data for GPU-accelerated terminal rendering.
Contains a pre-rasterized font atlas stored as a 2D texture array, where each layer holds 32 glyphs in a 1×32 grid. The atlas includes multiple font styles (normal, bold, italic, bold+italic) and full Unicode support including emoji.
Fields§
§font_name: CompactStringThe name of the font
font_size: f32The font size in points
max_halfwidth_base_glyph_id: u16The number of single-cell (halfwidth) glyphs per layer, before fullwidth glyphs begin.
Fullwidth glyphs (e.g., CJK characters) are assigned IDs starting from this value, aligned to even boundaries. This allows the renderer to distinguish halfwidth from fullwidth glyphs by comparing against this threshold.
texture_dimensions: (i32, i32, i32)Width, height and depth of the texture in pixels
cell_size: (i32, i32)Width and height of each character cell
underline: LineDecorationUnderline configuration
strikethrough: LineDecorationStrikethrough configuration
glyphs: Vec<Glyph>The glyphs in the font
texture_data: Vec<u8>The 3d texture data containing the font glyphs
Implementations§
Source§impl FontAtlasData
impl FontAtlasData
pub const PADDING: i32 = 1i32
pub const CELLS_PER_SLICE: i32 = 32i32
Sourcepub fn from_binary(
serialized: &[u8],
) -> Result<FontAtlasData, FontAtlasDeserializationError>
pub fn from_binary( serialized: &[u8], ) -> Result<FontAtlasData, FontAtlasDeserializationError>
Sourcepub fn to_binary(&self) -> Vec<u8> ⓘ
pub fn to_binary(&self) -> Vec<u8> ⓘ
Serializes the font atlas to binary format.
§Returns
A byte vector containing the serialized font atlas data