pub struct Font {
pub name: &'static str,
pub size: FontSize,
pub style: FontStyle,
pub line_height: u8,
pub baseline: u8,
/* private fields */
}Expand description
Bitmap font
Fields§
§name: &'static strFont name
size: FontSizeFont size
style: FontStyleFont style
line_height: u8Line height
baseline: u8Baseline offset
Implementations§
Source§impl Font
impl Font
Sourcepub fn measure_text(&self, text: &str) -> u32
pub fn measure_text(&self, text: &str) -> u32
Measure text width
Sourcepub fn render_text(
&self,
text: &str,
buffer: &mut [u8],
buffer_width: usize,
buffer_height: usize,
x: i32,
y: i32,
) -> Result<(), KernelError>
pub fn render_text( &self, text: &str, buffer: &mut [u8], buffer_width: usize, buffer_height: usize, x: i32, y: i32, ) -> Result<(), KernelError>
Render text to a bitmap buffer