diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-02 21:17:42 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-02 21:17:42 +0200 |
| commit | cbbc46215fe0a0ad8a50e991ec442890b8eadc0a (patch) | |
| tree | 2efbac21cec46787f1efe0a859564b9614eefa98 /src/font.rs | |
| parent | d5ff97f42ed1e682a66ea8d51e5f9ed1be547b9c (diff) | |
Layout elements and pure rust rendering 🥏
Diffstat (limited to 'src/font.rs')
| -rw-r--r-- | src/font.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/font.rs b/src/font.rs index 81a63445..5d81b6fc 100644 --- a/src/font.rs +++ b/src/font.rs @@ -38,20 +38,6 @@ impl OwnedFace { pub fn data(&self) -> &[u8] { &self.data } - - /// Encode the text into glyph ids and encode these into a big-endian byte - /// buffer. - pub fn encode_text(&self, text: &str) -> Vec<u8> { - const BYTES_PER_GLYPH: usize = 2; - let mut bytes = Vec::with_capacity(BYTES_PER_GLYPH * text.len()); - for c in text.chars() { - if let Some(glyph) = self.glyph_index(c) { - bytes.push((glyph.0 >> 8) as u8); - bytes.push((glyph.0 & 0xff) as u8); - } - } - bytes - } } impl ContainsChar for OwnedFace { |
