pub(crate) struct Glyph {
pub(crate) shape: GlyphShape,
pub(crate) name: &'static str,
pub(crate) normal: Option<char>,
pub(crate) superscript: Option<char>,
pub(crate) subscript: Option<char>,
pub(crate) advance: bool,
}
Expand description
A character which might appear in source code.
We include mappings to Unicode representation where this exists.
However, there are also cases where more than one Unicode
character (in the assembler input) might get mapped to the same
Glyph; see canonicalise_char
.
Fields§
§shape: GlyphShape
Indicates the shape of the glyph without regard to its (superscript/subscript/normal) position with respect to the character baseline.
name: &'static str
The name of the glyph as we would use it inside @...@
.
normal: Option<char>
The Unicode representation of this glyph when in normal script.
superscript: Option<char>
The Unicode representation of this glyph when in superscript.
subscript: Option<char>
The Unicode representation of this glyph when in subscript.
advance: bool
When advance is false, this glyph does not advance the Lincoln Writer’s print carriage. This appears to be true for character codes 0o12 (underbar, overbar) and 0o13 (circle, square). We should provide a reference for this, but just now I’m taking this info from the code in base/src/charset.rs which deals with these character codes.
We try to use combining characters for these.
Implementations§
Trait Implementations§
impl Eq for Glyph
impl StructuralPartialEq for Glyph
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnwindSafe for Glyph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.