1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Support for an alternative mechanism for displaying wide characters

under X: instead of having two separate fixed-width fonts one of
which is twice the width of the other, you can instead have a single
font in which some characters are twice as wide as others.

This is implemented very simply: if you specify a wide font, it will
be used for wide characters, and if you don't then the normal font
will be used for wide characters (so they'd better _be_ wide in that
font, or there'll be trouble).

I got this idea from Jed, whose latest version supports UTF-8 and
requires a font of this type. If there are going to be X fonts like
that kicking around, there will doubtless be people who want to use
them.

[originally from svn r6844]
This commit is contained in:
Simon Tatham 2006-09-03 14:31:34 +00:00
parent 33e827818a
commit 16510bf3b9

View File

@ -1998,12 +1998,18 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
wcs[i] = text[i];
}
if (inst->fonts[fontid] == NULL && (fontid & 2)) {
/*
* We've been given ATTR_WIDE, but have no wide font.
* Fall back to the non-wide font.
*/
fontid &= ~2;
}
if (inst->fonts[fontid] == NULL) {
/*
* The font for this contingency does not exist.
* Typically this means we've been given ATTR_WIDE
* character and have no wide font. So we display
* nothing at all; such is life.
* The font for this contingency does not exist. So we
* display nothing at all; such is life.
*/
} else if (inst->fontinfo[fontid].is_wide) {
/*