<html> <head><title>Gtk-- Reference: Gtk::FontSelectionDialog</title></head> <body bgcolor="#F0F0F0" text="#000000" link="#0000FF" vlink="#000077" alink="#FF0000"> <table align=center border=0 cellspacing=10> <tr> <td><a href="class_index.html">Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="name_index.html">Namespace Index</a></td> </table> <h1 align=center>Class Gtk::FontSelectionDialog</h1><p> <b> A dialog box for selecting fonts.</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3AWindow.html">Gtk::Window</a> <br> Derived by: <i>none</i> <p> #include <gtk--/fontselection.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=right><tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1550"><tt><font color=blue><b>FontSelectionDialog</b></font></tt></a></td><td><tt>(<tt>const</tt> <a href="Gtk%3A%3Anstring.html"><tt><font color=navy><b>nstring</b></font></tt></a>& <tt><font color=blue>title</font></tt>=(<tt><font color=purple>char</font></tt>*)<tt><font color=navy>0</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AButton.html"><tt><font color=navy><b>Button</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1559"><tt><font color=blue><b>get_apply_button</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AButton.html"><tt><font color=navy><b>Button</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1560"><tt><font color=blue><b>get_cancel_button</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>Gdk_Font</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1553"><tt><font color=blue><b>get_font</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3Anstring.html"><tt><font color=navy><b>nstring</b></font></tt></a></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1552"><tt><font color=blue><b>get_font_name</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AFontSelection.html"><tt><font color=navy><b>FontSelection</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1557"><tt><font color=blue><b>get_font_selection</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AButton.html"><tt><font color=navy><b>Button</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1558"><tt><font color=blue><b>get_ok_button</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>string</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1554"><tt><font color=blue><b>get_preview_text</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkFontSelectionDialog</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1546"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <tt><font color=navy>GtkFontSelectionDialog</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1547"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1548"><tt><font color=blue><b>isA</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1556"><tt><font color=blue><b>set_filter</b></font></tt></a></td><td><tt>(<tt><font color=navy>GtkFontFilterType</font></tt> <tt><font color=blue>filter_type</font></tt>, <tt><font color=navy>GtkFontType</font></tt> <tt><font color=blue>font_type</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>foundries</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>weights</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>slants</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>setwidths</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>spacings</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>charsets</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1551"><tt><font color=blue><b>set_font_name</b></font></tt></a></td><td><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>fontname</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1555"><tt><font color=blue><b>set_preview_text</b></font></tt></a></td><td><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>fontname</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3AFontSelectionDialog.html#1549"><tt><font color=blue><b>~FontSelectionDialog</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> The <tt><font color=navy><b>Gtk::FontSelectionDialog</b></font></tt> widget is a dialog box for selecting a font. <P> To set the font which is initially selected, use <a href="Gtk%3A%3AFontSelectionDialog.html#1551"><tt><font color=blue><b>set_font_name</b></font></tt></a>. <P> To get the selected font use <a href="Gtk%3A%3AFontSelectionDialog.html#1553"><tt><font color=blue><b>get_font</b></font></tt></a> or <a href="Gtk%3A%3AFontSelectionDialog.html#1552"><tt><font color=blue><b>get_font_name</b></font></tt></a>. <P> To change the text which is shown in the preview area, use <a href="Gtk%3A%3AFontSelectionDialog.html#1555"><tt><font color=blue><b>set_preview_text</b></font></tt></a>. <P> Filters can be used to limit the fonts shown. There are 2 filters in the <tt><font color=navy><b>Gtk::FontSelectionDialog</b></font></tt> - 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.<br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="1553"><font size=+1><b>Gtk::FontSelectionDialog::get_font</b></font></a> - Gets the currently-selected font.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>Gdk_Font</font></tt></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1553"><tt><font color=blue><b>get_font</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> Returns: The currently-selected font, or NULL if no font is selected.</blockquote> <br><br> <a name="1552"><font size=+1><b>Gtk::FontSelectionDialog::get_font_name</b></font></a> - Gets the currently-selected font name.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><a href="Gtk%3A%3Anstring.html"><tt><font color=navy><b>nstring</b></font></tt></a></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1552"><tt><font color=blue><b>get_font_name</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> Returns: The currently-selected font name, or NULL if no font is selected.</blockquote> <br><br> <a name="1554"><font size=+1><b>Gtk::FontSelectionDialog::get_preview_text</b></font></a> - Gets the text displayed in the preview area.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>string</font></tt></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1554"><tt><font color=blue><b>get_preview_text</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> Returns: The text displayed in the preview area.</blockquote> <br><br> <a name="1546"><font size=+1><b>Gtk::FontSelectionDialog::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkFontSelectionDialog</font></tt>*</tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1546"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="1548"><font size=+1><b>Gtk::FontSelectionDialog::isA</b></font></a> - Returns true if object is this type.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1548"><tt><font color=blue><b>isA</b></font></tt></a><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;<br><br> <a name="1556"><font size=+1><b>Gtk::FontSelectionDialog::set_filter</b></font></a> - Sets one of the two font filters, to limit the fonts shown.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1556"><tt><font color=blue><b>set_filter</b></font></tt></a><tt>(<tt><font color=navy>GtkFontFilterType</font></tt> <tt><font color=blue>filter_type</font></tt>, <tt><font color=navy>GtkFontType</font></tt> <tt><font color=blue>font_type</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>foundries</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>weights</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>slants</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>setwidths</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>spacings</font></tt>, <tt>const</tt> <a href="Gtk%3A%3ASArray.html"><tt><font color=navy><b>SArray</b></font></tt></a>& <tt><font color=blue>charsets</font></tt>)</tt>;<br><blockquote> filter_type: Which of the two font filters to set, either <tt><font color=green>GTK_FONT_FILTER_BASE</font></tt> or <tt><font color=green>GTK_FONT_FILTER_USER</font></tt>. The user filter can be changed by the user, but the base filter is permanent. <P> font_type: The types of font to be shown. This is a bitwise combination of <tt><font color=green>GTK_FONT_BITMAP</font></tt>, <tt><font color=green>GTK_FONT_SCALABLE</font></tt> and <tt><font color=green>GTK_FONT_SCALABLE_BITMAP</font></tt>, or <tt><font color=green>GTK_FONT_ALL</font></tt> to show all three font types. <P> foundries: A NULL-terminated array of strings containing foundry names which will be shown, or NULL to show all foundries. <P> weights: A NULL-terminated array of strings containing weight names which will be shown, or NULL to show all weights. <P> slants: A NULL-terminated array of strings containing slant names which will be shown, or NULL to show all slants. <P> setwidths: A NULL-terminated array of strings containing setwidth names which will be shown, or NULL to show all setwidths. <P> 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.</blockquote> <br><br> <a name="1551"><font size=+1><b>Gtk::FontSelectionDialog::set_font_name</b></font></a> - Sets the currently-selected font.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1551"><tt><font color=blue><b>set_font_name</b></font></tt></a><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>fontname</font></tt>)</tt>;<br><blockquote> fontname: A fontname. <P> Returns: TRUE if the font was found.</blockquote> <br><br> <a name="1555"><font size=+1><b>Gtk::FontSelectionDialog::set_preview_text</b></font></a> - Sets the text displayed in the preview area.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AFontSelectionDialog.html#1555"><tt><font color=blue><b>set_preview_text</b></font></tt></a><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>fontname</font></tt>)</tt>;<br><blockquote> text: The text to display in the preview area.</blockquote> <br><br> <hr noshade> </html>