use std::{io, num::ParseIntError};
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Data too short: {context}")]
DataTooShort { context: &'static str },
#[error("Only TrueType fonts (TTF) are supported; OTF/CFF fonts are not supported")]
UnsupportedFormat,
#[error("Table extends beyond data")]
TableOutOfBounds,
#[error("Invalid glyph: {0}")]
InvalidGlyph(&'static str),
#[error("Brotli compression failed: {0}")]
Compression(String),
#[error("Failed to parse integer")]
ParseInt(#[from] ParseIntError),
#[error(transparent)]
Io(#[from] io::Error),
}