pub enum CharacterFormat {
Ascii,
Ansi,
AnsiMation,
RipScript,
PCBoard,
Avatar,
Html,
Source,
TundraDraw,
Unknown(u8),
}Expand description
Character format types as specified in the SAUCE v00 specification.
Each format represents a different text or graphics encoding standard used by the BBS and retro computing community. The numeric values correspond to the FileType field in the SAUCE header.
Variants§
Ascii
Plain ASCII text (value 0)
Ansi
ANSI escape sequence art (value 1)
AnsiMation
ANSI with animation/timing (value 2)
RipScript
Remote Imaging Protocol - pixel-based graphics (value 3)
PCBoard
PCBoard BBS format (value 4)
Avatar
Avatar graphics format (value 5)
Html
Hypertext Markup Language (value 6)
Source
Generic source code (value 7)
TundraDraw
TundraDraw format (value 8)
Unknown(u8)
Unknown or unsupported format (preserves raw value)
Implementations§
Source§impl CharacterFormat
impl CharacterFormat
Sourcepub fn from_sauce(file_type: u8) -> Self
pub fn from_sauce(file_type: u8) -> Self
Parse a character format from the SAUCE FileType byte.
§Arguments
file_type- The 8-bit FileType value from the SAUCE header
§Returns
Returns the corresponding CharacterFormat, or CharacterFormat::Unknown
if the value is not recognized.
§Example
use icy_sauce::CharacterFormat;
let format = CharacterFormat::from_sauce(1);
assert_eq!(format, CharacterFormat::Ansi);Sourcepub fn supports_ansi_flags(&self) -> bool
pub fn supports_ansi_flags(&self) -> bool
Check if this format supports ANSI flags (ice colors, letter spacing, aspect ratio).
Only ASCII, ANSI, and ANSiMation formats support the extended rendering options stored in the TFlags byte of the SAUCE header.
§Example
use icy_sauce::CharacterFormat;
assert!(CharacterFormat::Ansi.supports_ansi_flags());
assert!(!CharacterFormat::Html.supports_ansi_flags());Sourcepub fn has_dimensions(&self) -> bool
pub fn has_dimensions(&self) -> bool
Check if this format stores character grid dimensions (width/height).
Most formats store character dimensions in TInfo1 (width) and TInfo2 (height), except HTML and Source which have variable dimensions.
§Example
use icy_sauce::CharacterFormat;
assert!(CharacterFormat::Ansi.has_dimensions());
assert!(!CharacterFormat::Html.has_dimensions());Sourcepub fn is_stream(&self) -> bool
pub fn is_stream(&self) -> bool
Check if this format is a streaming format with variable height.
Streaming formats can have content of any height, unlike fixed-size animations. RIPScript and HTML are not considered streaming despite being variable-height.
§Example
use icy_sauce::CharacterFormat;
assert!(CharacterFormat::Ansi.is_stream());
assert!(!CharacterFormat::AnsiMation.is_stream());Sourcepub fn is_animation(&self) -> bool
pub fn is_animation(&self) -> bool
Check if this format is an animation that requires fixed screen dimensions.
ANSiMation requires both width and height to be fixed for proper playback timing.
§Example
use icy_sauce::CharacterFormat;
assert!(CharacterFormat::AnsiMation.is_animation());
assert!(!CharacterFormat::Ansi.is_animation());Trait Implementations§
Source§impl Clone for CharacterFormat
impl Clone for CharacterFormat
Source§fn clone(&self) -> CharacterFormat
fn clone(&self) -> CharacterFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more