--- rxvt-unicode/src/rxvtfont.C 2021/08/26 03:58:29 1.221 +++ rxvt-unicode/src/rxvtfont.C 2024/01/04 19:52:37 1.224 @@ -154,10 +154,11 @@ // these characters are used to guess the font height and width // pango uses a similar algorithm and doesn't trust the font either. -static uint16_t extent_test_chars[] = { +static uint32_t extent_test_chars[] = { '0', '1', '8', 'a', 'd', 'x', 'm', 'y', 'g', 'W', 'X', '\'', '_', 0x00cd, 0x00d5, 0x0114, 0x0177, 0x0643, // ÍÕĔŷﻙ 0x304c, 0x672c, // が本 + 0x1f600, // 😀 }; #define dTermDisplay Display *disp = term->dpy @@ -519,7 +520,8 @@ bool load (const rxvt_fontprop &prop, bool force_prop) { width = 1; height = 1; - ascent = 1; descent = 0; + ascent = 1; + descent = (*fs)[2]->descent; set_name (strdup ("built-in rendition overflow font")); @@ -937,7 +939,7 @@ width = 1; - for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++) + for (uint32_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++) { if (FROM_UNICODE (cs, *t) == NOCHAR) continue; @@ -1266,7 +1268,7 @@ FT_Face face = XftLockFace (f); // fuck me plenty: XftLockFace can actually return 0. try not to crash. - // we also assume blindly that if the first lock succeeeds, then subsequent + // we also assume blindly that if the first lock succeeds, then subsequent // locks will also succeed. if (!face) { @@ -1286,9 +1288,9 @@ int glheight = height; - for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++) + for (uint32_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++) { - FcChar16 ch = *t; + FcChar32 ch = *t; if (cs != CS_UNICODE && ch > 0x100 @@ -1301,7 +1303,7 @@ continue; XGlyphInfo g; - XftTextExtents16 (disp, f, &ch, 1, &g); + XftTextExtents32 (disp, f, &ch, 1, &g); g.width -= g.x;