Skip to content

Commit

Permalink
fix emojis by actually setting utf8codepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ntBre committed Dec 7, 2024
1 parent b273519 commit a76be00
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/drw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub unsafe fn text(
let mut utf8charlen: c_int;
let render: c_int = (x != 0 || y != 0 || w != 0 || h != 0) as c_int;

let utf8codepoint: c_long = 0;
let mut utf8codepoint: c_long = 0;

let mut utf8str: *const c_char;

Expand Down Expand Up @@ -381,9 +381,9 @@ pub unsafe fn text(
// `while(*text)` to `while !text.is_null()`, but we actually need
// to check if we're at the null byte at the end of the string, NOT
// if text is a null pointer
for utf8codepoint in text.chars() {
dbg!(&utf8codepoint);
utf8charlen = utf8codepoint.len_utf8() as i32;
for c in text.chars() {
utf8codepoint = c as i64;
utf8charlen = c.len_utf8() as i32;
for (font_idx, curfont) in drw.fonts.iter().enumerate() {
charexists = charexists
|| xft::XftCharExists(
Expand Down Expand Up @@ -450,8 +450,8 @@ pub unsafe fn text(
drw.fonts[usedfont].xfont,
x,
ty,
dbg!(utf8str) as *const c_uchar,
dbg!(utf8strlen),
utf8str as *const c_uchar,
utf8strlen,
);
log::trace!("text: XftDrawStringUtf8 finished");
}
Expand Down

0 comments on commit a76be00

Please sign in to comment.