Skip to main content

Look

Struct Look 

Source
pub struct Look {
    pub palette: [Rgb; 256],
    pub fonts: [u8; 4],
    pub bright_font: bool,
    pub bright_plain: bool,
    pub blink_font: bool,
    pub blink_steady: bool,
    pub loaded: Vec<LoadedFont>,
}
Expand description

What a BBS can change about how cells are drawn, beyond their own attributes: CTerm’s palette (OSC 4) and font slots (CSI n;m SP D).

Fields§

§palette: [Rgb; 256]

In xterm order: the 16 ANSI colors (black, red, green, …), the 6x6x6 cube and the grays.

§fonts: [u8; 4]

CTerm font IDs for the normal, bright, blink and bright-blink slots.

§bright_font: bool

CSI ?31h: bright text is drawn in font slot 1.

§bright_plain: bool

CSI ?32h: bold does not brighten the color.

§blink_font: bool

CSI ?34h: blinking text is drawn in font slot 2.

§blink_steady: bool

CSI ?35h: blink does not make text blink.

§loaded: Vec<LoadedFont>

Fonts the BBS has loaded (CTerm’s loadable fonts), by slot.

Implementations§

Source§

impl Look

Source

pub fn standard() -> &'static Look

The VGA palette and font, with no CTerm modes set.

Source

pub fn load_font(&mut self, slot: u8, data: &[u8]) -> bool

Load a font into a slot: 4096 bytes is 8x16, 3584 8x14, 2048 8x8. False if the slot is a built-in one or the size is none of those.

Source

pub fn loaded_font(&self, slot: u8) -> Option<LoadedFont>

A loaded font, by its slot (the ID CSI n ; slot SP D selects).

Source

pub fn rgb(&self, c: Color) -> Rgb

Source

pub fn font_for(&self, cell: &Cell) -> u8

The CTerm font a cell is drawn in.

Trait Implementations§

Source§

impl Clone for Look

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Look

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Look

Source§

fn default() -> Look

Returns the “default value” for a type. Read more
Source§

impl Eq for Look

Source§

impl PartialEq for Look

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Look

Auto Trait Implementations§

§

impl Freeze for Look

§

impl RefUnwindSafe for Look

§

impl Send for Look

§

impl Sync for Look

§

impl Unpin for Look

§

impl UnsafeUnpin for Look

§

impl UnwindSafe for Look

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, Ctx> BundleDefault<Ctx> for T
where T: Default,

Source§

fn default_with_context(_: Ctx) -> T

Creates a default value with the given context.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more