klyff 0.1.3

Text rendering library for games with MSDF support
Documentation
bitflags::bitflags! {
    /// Text renderer feature flags.
    ///
    /// # Remarks
    /// This struct determines what features to enable. Each feature require a separate draw call
    /// per frame.
    ///
    /// All styles specified in [`crate::TextStyle`] that are not enabled in the feature flags is
    /// ignored.
    #[derive(Debug, Clone, Copy, PartialEq, Eq)]
    pub struct Features: u32 {
        /// Enable outer stroke drawing step.
        const STROKE_OUT = 1 << 0;
        /// Enable inner stroke drawing step.
        const STROKE_IN = 1 << 1;
        /// Enable outer glow drawing step.
        const GLOW_OUT = 1 << 2;
        /// Enable inner glow drawing step.
        const GLOW_IN = 1 << 3;
        /// Enable shadow drawing step.
        const SHADOW = 1 << 4;
    }
}

impl Features {
    /// Whether any outer-effect feature is enabled (stroke_out, glow_out, or shadow).
    pub fn has_outer_effects(&self) -> bool {
        self.intersects(Features::STROKE_OUT | Features::GLOW_OUT | Features::SHADOW)
    }
}