HildonFontSelectionDialog

HildonFontSelectionDialog — A widget used to allow users to select a font with certain properties

Synopsis




PangoAttrList* hildon_font_selection_dialog_get_font
                                            (HildonFontSelectionDialog *fsd);
void        hildon_font_selection_dialog_set_font
                                            (HildonFontSelectionDialog *fsd,
                                             PangoAttrList *list);
GtkWidget*  hildon_font_selection_dialog_new
                                            (GtkWindow *parent,
                                             const gchar *title);
void        hildon_font_selection_dialog_set_buffer
                                            (HildonFontSelectionDialog *fsd,
                                             GtkTextBuffer *buffer);
GtkTextTag* hildon_font_selection_dialog_get_text_tag
                                            (HildonFontSelectionDialog *fsd);
gchar*      hildon_font_selection_dialog_get_preview_text
                                            (HildonFontSelectionDialog *fsd);
void        hildon_font_selection_dialog_set_preview_text
                                            (HildonFontSelectionDialog *fsd,
                                             const gchar *text);

Description

Font selection can be made using this widget. Users can select font name, size, style, etc. Users can also preview text in the selected font.

Details

hildon_font_selection_dialog_get_font ()

PangoAttrList* hildon_font_selection_dialog_get_font
                                            (HildonFontSelectionDialog *fsd);

This is deprecated. PangoAttrList needs starting index, and end index on construction.

fsd : the font selection dialog
Returns : pointer to PangoAttrList

hildon_font_selection_dialog_set_font ()

void        hildon_font_selection_dialog_set_font
                                            (HildonFontSelectionDialog *fsd,
                                             PangoAttrList *list);

This is a deprecated.

Sets the font to the dialog.

fsd : the font selection dialog
list : the pango attribute list

hildon_font_selection_dialog_new ()

GtkWidget*  hildon_font_selection_dialog_new
                                            (GtkWindow *parent,
                                             const gchar *title);

If NULL is passed for title, then default title "Font" will be used.

parent : the parent window
title : the title of font selection dialog
Returns : a new HildonFontSelectionDialog

hildon_font_selection_dialog_set_buffer ()

void        hildon_font_selection_dialog_set_buffer
                                            (HildonFontSelectionDialog *fsd,
                                             GtkTextBuffer *buffer);

This is deprecated. GtkTextBuffer is not enough to get the attributes of currently selected text. Please inspect the attributes yourself, and set the properties of font selection dialog to reflect your inspection.

fsd : the font selection dialog
buffer : a GtkTextBuffer containing the text to which the selections will be applied. Applying is responsibility of application.

hildon_font_selection_dialog_get_text_tag ()

GtkTextTag* hildon_font_selection_dialog_get_text_tag
                                            (HildonFontSelectionDialog *fsd);

Get the GtkTextTag for selections. This function is deprecated. The best way to use the text tags is to reuse them as much as possible. The recommended way is to get the properties of the font selection dialog on GTK_RESPONSE_OK, and according to these properties use the tags that you have pre-created.

fsd : the font selection dialog
Returns : a GtkTextTag having corresponding properties set

hildon_font_selection_dialog_get_preview_text ()

gchar*      hildon_font_selection_dialog_get_preview_text
                                            (HildonFontSelectionDialog *fsd);

Gets the text in preview dialog, which does not include the reference text. The returned string must be freed by the user.

fsd : the font selection dialog
Returns : a string pointer

hildon_font_selection_dialog_set_preview_text ()

void        hildon_font_selection_dialog_set_preview_text
                                            (HildonFontSelectionDialog *fsd,
                                             const gchar *text);

The default preview text is "The quick brown fox jumped over the lazy dogs"

fsd : the font selection dialog
text : the text to be displayed in the preview dialog