diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-11-12 21:38:14 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-11-12 21:38:14 -0700 |
| commit | 9f61e842d01f910349458466c3749d92561f5cde (patch) | |
| tree | 595153f4d77646dfe2f6841292a084b78a844d39 /src/x/font.rs | |
| parent | 7138ace1c1f97f85509278e50b72eb62ed0fd315 (diff) | |
move XftDraw pointers into a new wrapper FontGraphicContext
impl Drop :) Force-Push: yes Change-Id: I2a2a488819c9f03205aade5dd5d119c02dd8a3c2
Diffstat (limited to 'src/x/font.rs')
| -rw-r--r-- | src/x/font.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/x/font.rs b/src/x/font.rs index 20ae7e4..d12cbe8 100644 --- a/src/x/font.rs +++ b/src/x/font.rs @@ -30,13 +30,14 @@ impl Font { Ok(Font { display, font_state }) } - pub fn draw(&self, xft_context: *mut XftDraw, xft_color: &XftColor, + pub fn draw(&self, context: &FontGraphicContext, xft_color: &XftColor, x: i32, y: i32, text: &str) -> xcb::Result<()> { + let xft_draw = context.get_xft_draw(); let text = CString::new(text).unwrap(); unsafe { - XftDrawStringUtf8(xft_context, xft_color, self.font_state, x, y, + XftDrawStringUtf8(xft_draw, xft_color, self.font_state, x, y, text.as_ptr().cast(), text.count_bytes() as i32) }; |