aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/cursor.rs
diff options
context:
space:
mode:
authorKirill Chibisov <wchibisovkirill@gmail.com>2019-12-10 01:12:44 +0300
committerChristian Duerr <contact@christianduerr.com>2019-12-09 23:12:44 +0100
commit79b19176eeb57fbd6b137160afd6bc9f5518ad33 (patch)
treea3f76e83973e1bba2090afe39fbaa688d48efbf6 /alacritty/src/cursor.rs
parent88b4dbfc5a890569fcfac3fe400fe0ad0ea234cc (diff)
downloadr-alacritty-79b19176eeb57fbd6b137160afd6bc9f5518ad33.tar.gz
r-alacritty-79b19176eeb57fbd6b137160afd6bc9f5518ad33.tar.bz2
r-alacritty-79b19176eeb57fbd6b137160afd6bc9f5518ad33.zip
Add support for colored emojis on Linux/BSD
Fixes #153.
Diffstat (limited to 'alacritty/src/cursor.rs')
-rw-r--r--alacritty/src/cursor.rs24
1 files changed, 19 insertions, 5 deletions
diff --git a/alacritty/src/cursor.rs b/alacritty/src/cursor.rs
index e671bf4b..a3e6a2ca 100644
--- a/alacritty/src/cursor.rs
+++ b/alacritty/src/cursor.rs
@@ -18,7 +18,7 @@ use std::cmp;
use alacritty_terminal::ansi::CursorStyle;
-use font::{Metrics, RasterizedGlyph};
+use font::{BitmapBuffer, Metrics, RasterizedGlyph};
/// Width/Height of the cursor relative to the font width
pub const CURSOR_WIDTH_PERCENTAGE: i32 = 15;
@@ -55,7 +55,14 @@ pub fn get_underline_cursor_glyph(width: i32, line_width: i32) -> RasterizedGlyp
let buf = vec![255u8; (width * line_width * 3) as usize];
// Create a custom glyph with the rectangle data attached to it
- RasterizedGlyph { c: ' ', top: line_width, left: 0, height: line_width, width, buf }
+ RasterizedGlyph {
+ c: ' ',
+ top: line_width,
+ left: 0,
+ height: line_width,
+ width,
+ buf: BitmapBuffer::RGB(buf),
+ }
}
// Returns a custom beam cursor character
@@ -64,7 +71,14 @@ pub fn get_beam_cursor_glyph(height: i32, line_width: i32) -> RasterizedGlyph {
let buf = vec![255u8; (line_width * height * 3) as usize];
// Create a custom glyph with the rectangle data attached to it
- RasterizedGlyph { c: ' ', top: height, left: 0, height, width: line_width, buf }
+ RasterizedGlyph {
+ c: ' ',
+ top: height,
+ left: 0,
+ height,
+ width: line_width,
+ buf: BitmapBuffer::RGB(buf),
+ }
}
// Returns a custom box cursor character
@@ -86,7 +100,7 @@ pub fn get_box_cursor_glyph(height: i32, width: i32, line_width: i32) -> Rasteri
}
// Create a custom glyph with the rectangle data attached to it
- RasterizedGlyph { c: ' ', top: height, left: 0, height, width, buf }
+ RasterizedGlyph { c: ' ', top: height, left: 0, height, width, buf: BitmapBuffer::RGB(buf) }
}
// Returns a custom block cursor character
@@ -95,5 +109,5 @@ pub fn get_block_cursor_glyph(height: i32, width: i32) -> RasterizedGlyph {
let buf = vec![255u8; (width * height * 3) as usize];
// Create a custom glyph with the rectangle data attached to it
- RasterizedGlyph { c: ' ', top: height, left: 0, height, width, buf }
+ RasterizedGlyph { c: ' ', top: height, left: 0, height, width, buf: BitmapBuffer::RGB(buf) }
}