diff options
Diffstat (limited to 'crates/fparkan-font/src/lib.rs')
| -rw-r--r-- | crates/fparkan-font/src/lib.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/fparkan-font/src/lib.rs b/crates/fparkan-font/src/lib.rs index 770ebb0d..3fdcb554 100644 --- a/crates/fparkan-font/src/lib.rs +++ b/crates/fparkan-font/src/lib.rs @@ -4,31 +4,34 @@ use fparkan_texm::{TexmDocument, TexmError}; use std::sync::Arc; +mod bitmap; +pub use bitmap::BitmapFont; + const PREFIX_LEN: usize = 0x14; const GLYPH_TABLE_END: usize = 0x1014; const GLYPH_COUNT: usize = 256; -/// Confirmed Tfnt metrics and the preserved opaque word at offset `0x0c`. +/// Tfnt metrics for text measurement and placement in the atlas. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct TfntHeader { /// Lower bound used by the native fixed-width drawing path. pub fixed_width_floor: i32, /// Vertical extent used by native clipping and drawing. pub vertical_extent: i32, - /// Raw bits copied from offset `0x0c`; its semantic name is unknown. + /// Raw bits of the vertical UV span shared by all glyphs. pub word_0c_bits: u32, /// Per-input-byte spacing used by native text measurement. pub character_spacing: i32, } -/// One 16-byte glyph record; the first three words remain opaque. +/// One 16-byte glyph record. #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct TfntGlyph { - /// First opaque DWORD. + /// Raw bits of the left U coordinate. pub word0: u32, - /// Second opaque DWORD. + /// Raw bits of the right U coordinate. pub word1: u32, - /// Third opaque DWORD. + /// Raw bits of the top V coordinate. pub word2: u32, /// Signed advance at record offset `0x0c`. pub advance: i32, |
