X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkfont.h;h=1ed202bfc134c91d1af829f88ddefff704f31829;hb=3e22c99c9a3c28e042f2dc3a50fadf95e7c277e7;hp=5c36fee5395b5ea423eb6b089b1421f66f8d0906;hpb=debbee0fe4f5f62823673f59dc82afccf33dc08f;p=PuTTY.git diff --git a/unix/gtkfont.h b/unix/gtkfont.h index 5c36fee5..1ed202bf 100644 --- a/unix/gtkfont.h +++ b/unix/gtkfont.h @@ -21,26 +21,61 @@ typedef struct unifont { /* * public_charset is the charset used when the user asks for * `Use font encoding'. - * - * real_charset is the charset used when translating text into - * a form suitable for sending to unifont_draw_text(). - * - * They can differ. For example, public_charset might be - * CS_ISO8859_1 while real_charset is CS_ISO8859_1_X11. */ - int public_charset, real_charset; + int public_charset; /* * Font dimensions needed by clients. */ int width, height, ascent, descent; + + /* + * Indicates whether this font is capable of handling all glyphs + * (Pango fonts can do this because Pango automatically supplies + * missing glyphs from other fonts), or whether it would like a + * fallback font to cope with missing glyphs. + */ + int want_fallback; } unifont; -unifont *unifont_create(GtkWidget *widget, char *name, int wide, int bold, +unifont *unifont_create(GtkWidget *widget, const char *name, + int wide, int bold, int shadowoffset, int shadowalways); void unifont_destroy(unifont *font); void unifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font, - int x, int y, const char *string, int len, + int x, int y, const wchar_t *string, int len, int wide, int bold, int cellwidth); +/* + * This function behaves exactly like the low-level unifont_create, + * except that as well as the requested font it also allocates (if + * necessary) a fallback font for filling in replacement glyphs. + * + * Return value is usable with unifont_destroy and unifont_draw_text + * as if it were an ordinary unifont. + */ +unifont *multifont_create(GtkWidget *widget, const char *name, + int wide, int bold, + int shadowoffset, int shadowalways); + +/* + * Unified font selector dialog. I can't be bothered to do a + * proper GTK subclassing today, so this will just be an ordinary + * data structure with some useful members. + * + * (Of course, these aren't the only members; this structure is + * contained within a bigger one which holds data visible only to + * the implementation.) + */ +typedef struct unifontsel { + void *user_data; /* settable by the user */ + GtkWindow *window; + GtkWidget *ok_button, *cancel_button; +} unifontsel; + +unifontsel *unifontsel_new(const char *wintitle); +void unifontsel_destroy(unifontsel *fontsel); +void unifontsel_set_name(unifontsel *fontsel, const char *fontname); +char *unifontsel_get_name(unifontsel *fontsel); + #endif /* PUTTY_GTKFONT_H */