pub struct Text {
pub font: Atlas<Color3>,
pub geom: Mesh<TexCoord>,
/* private fields */
}Expand description
Text represented as texture-mapped geometry, one quad per glyph.
Fields§
§font: Atlas<Color3>§geom: Mesh<TexCoord>Implementations§
Trait Implementations§
Source§impl Write for Text
Available on crate feature std only.
impl Write for Text
Available on crate feature
std only.Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Creates geometry to represent the bytes in buf.
This method uses each byte in buf as an index to the font. Only up to
256 glyphs are thus supported. The font should have enough glyphs to
cover each byte value in buf.
Because a one-to-one mapping from bytes to glyphs is used, the result will be mojibake if the buffer contains UTF-8 encoded data beyond the ASCII range.
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Source§impl Write for Text
impl Write for Text
Source§fn write_str(&mut self, s: &str) -> Result
fn write_str(&mut self, s: &str) -> Result
Creates geometry to represent the characters in s.
This method iterates over the chars of the string, and uses the value
of each char as an index into the font. As such, the font should have
enough glyphs to cover all the characters used.
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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
Mutably borrows from an owned value. Read more