use std::{error::Error, fmt};
pub trait MeshTextError: fmt::Debug + fmt::Display {}
#[derive(Debug)]
pub struct GlyphOutlineError;
impl MeshTextError for GlyphOutlineError {}
impl Error for GlyphOutlineError {}
impl fmt::Display for GlyphOutlineError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"The glyph outline of this font seems to be malformed / unsupported."
)
}
}
#[derive(Debug)]
pub struct GlyphTriangulationError(pub cdt::Error);
impl MeshTextError for GlyphTriangulationError {}
impl Error for GlyphTriangulationError {}
impl fmt::Display for GlyphTriangulationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "The glyph outline could not be triangulated.")
}
}
#[derive(Debug)]
pub struct VertexError;
impl MeshTextError for VertexError {}
impl Error for VertexError {}
impl fmt::Display for VertexError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "The given vertex or vertices seem to be malformed.")
}
}