… | |
… | |
915 | { |
915 | { |
916 | while (len) |
916 | while (len) |
917 | { |
917 | { |
918 | if (*text != NOCHAR && *text != ' ') |
918 | if (*text != NOCHAR && *text != ' ') |
919 | { |
919 | { |
|
|
920 | int fwidth = r->TermWin.fwidth; |
|
|
921 | if (len >= 2 && text[1] == NOCHAR) |
|
|
922 | fwidth *= 2; |
|
|
923 | |
920 | XGlyphInfo extents; |
924 | XGlyphInfo extents; |
921 | if (sizeof (text_t) == sizeof (FcChar16)) |
925 | if (sizeof (text_t) == sizeof (FcChar16)) |
922 | { |
926 | { |
923 | XftTextExtents16 (DISPLAY, f, (const FcChar16 *)text, 1, &extents); |
927 | XftTextExtents16 (DISPLAY, f, (const FcChar16 *)text, 1, &extents); |
924 | XftDrawString16 (d, &r->PixColors[fg].c, f, x + extents.x + (r->TermWin.fwidth - extents.width) / 2, |
928 | XftDrawString16 (d, &r->PixColors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2, |
925 | y + r->TermWin.fbase, (const FcChar16 *)text, 1); |
929 | y + r->TermWin.fbase, (const FcChar16 *)text, 1); |
926 | } |
930 | } |
927 | else |
931 | else |
928 | { |
932 | { |
929 | XGlyphInfo extents; |
933 | XGlyphInfo extents; |
930 | XftTextExtents32 (DISPLAY, f, (const FcChar32 *)text, 1, &extents); |
934 | XftTextExtents32 (DISPLAY, f, (const FcChar32 *)text, 1, &extents); |
931 | XftDrawString32 (d, &r->PixColors[fg].c, f, x + extents.x + (r->TermWin.fwidth - extents.width) / 2, |
935 | XftDrawString32 (d, &r->PixColors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2, |
932 | y + r->TermWin.fbase, (const FcChar32 *)text, 1); |
936 | y + r->TermWin.fbase, (const FcChar32 *)text, 1); |
933 | } |
937 | } |
934 | } |
938 | } |
935 | |
939 | |
936 | x += r->TermWin.fwidth; |
940 | x += r->TermWin.fwidth; |
… | |
… | |
1086 | base_id = 1; |
1090 | base_id = 1; |
1087 | |
1091 | |
1088 | // we currently need a base-font, no matter what |
1092 | // we currently need a base-font, no matter what |
1089 | if (fonts.size () <= base_id || !realize_font (base_id)) |
1093 | if (fonts.size () <= base_id || !realize_font (base_id)) |
1090 | { |
1094 | { |
|
|
1095 | puts ("unable to load specified font(s), falling back to 'fixed'\n"); |
1091 | add_fonts ("fixed"); |
1096 | add_fonts ("fixed"); |
1092 | base_id = fonts.size () - 1; |
1097 | base_id = fonts.size () - 1; |
1093 | } |
1098 | } |
1094 | |
1099 | |
1095 | if (fonts.size () <= base_id || !realize_font (base_id)) |
1100 | if (fonts.size () <= base_id || !realize_font (base_id)) |