Class Index | Cross Index | Namespace Index |
A dialog box for selecting fonts.
Contained in: Gtk
Derived from:
Window
Derived by:
none
#include <gtk--/fontselection.h>
public function member index: |
||
FontSelectionDialog | (const nstring& title=(char*)0); | |
Button* | get_apply_button | () const; |
Button* | get_cancel_button | () const; |
Gdk_Font | get_font | () const; |
nstring | get_font_name | () const; |
FontSelection* | get_font_selection | () const; |
Button* | get_ok_button | () const; |
string | get_preview_text | () const; |
GtkFontSelectionDialog* | gtkobj | (); |
const GtkFontSelectionDialog* | gtkobj | () const; |
static bool | isA | (Object* object); |
void | set_filter | (GtkFontFilterType filter_type, GtkFontType font_type, const SArray& foundries, const SArray& weights, const SArray& slants, const SArray& setwidths, const SArray& spacings, const SArray& charsets); |
bool | set_font_name | (const string& fontname); |
void | set_preview_text | (const string& fontname); |
virtual | ~FontSelectionDialog | (); |
To set the font which is initially selected, use set_font_name.
To get the selected font use get_font or get_font_name.
To change the text which is shown in the preview area, use set_preview_text.
Filters can be used to limit the fonts shown. There are 2 filters in the
Gtk::FontSelectionDialog - a base filter and a user filter. The base
filter can not be changed by the user, so this can be used when the user must
choose from the restricted set of fonts (e.g. for a terminal-type application
you may want to force the user to select a fixed-width font). The user filter can
be changed or reset by the user, by using the 'Reset Filter' button or changing the
options on the 'Filter' page of the dialog.
Returns: The currently-selected font, or NULL if no font is selected.
Returns: The currently-selected font name, or NULL if no font is selected.
Returns: The text displayed in the preview area.
filter_type: Which of the two font filters to set, either GTK_FONT_FILTER_BASE or GTK_FONT_FILTER_USER. The user filter can be changed by the user, but the base filter is permanent.font_type: The types of font to be shown. This is a bitwise combination of GTK_FONT_BITMAP, GTK_FONT_SCALABLE and GTK_FONT_SCALABLE_BITMAP, or GTK_FONT_ALL to show all three font types.
foundries: A NULL-terminated array of strings containing foundry names which will be shown, or NULL to show all foundries.
weights: A NULL-terminated array of strings containing weight names which will be shown, or NULL to show all weights.
slants: A NULL-terminated array of strings containing slant names which will be shown, or NULL to show all slants.
setwidths: A NULL-terminated array of strings containing setwidth names which will be shown, or NULL to show all setwidths.
spacings: A NULL-terminated array of strings containing spacings which will be shown, or NULL to show all spacings. charsets: A NULL-terminated array of strings containing charset names which will be shown, or NULL to show all charsets.
fontname: A fontname.Returns: TRUE if the font was found.
text: The text to display in the preview area.