Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
FontChooser
is an interface that can be implemented by widgets
displaying the list of fonts. In GTK+, the main objects
that implement this interface are FontChooserWidget
,
FontChooserDialog
and FontButton
. The GtkFontChooser interface
has been introducted in GTK+ 3.2.
- newtype FontChooser = FontChooser (ManagedPtr FontChooser)
- noFontChooser :: Maybe FontChooser
- class GObject o => IsFontChooser o
- toFontChooser :: IsFontChooser o => o -> IO FontChooser
- data FontChooserGetFontMethodInfo
- fontChooserGetFont :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m (Maybe Text)
- data FontChooserGetFontDescMethodInfo
- fontChooserGetFontDesc :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m (Maybe FontDescription)
- data FontChooserGetFontFaceMethodInfo
- fontChooserGetFontFace :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m (Maybe FontFace)
- data FontChooserGetFontFamilyMethodInfo
- fontChooserGetFontFamily :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m (Maybe FontFamily)
- data FontChooserGetFontMapMethodInfo
- fontChooserGetFontMap :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m (Maybe FontMap)
- data FontChooserGetFontSizeMethodInfo
- fontChooserGetFontSize :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m Int32
- data FontChooserGetPreviewTextMethodInfo
- fontChooserGetPreviewText :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m Text
- data FontChooserGetShowPreviewEntryMethodInfo
- fontChooserGetShowPreviewEntry :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> m Bool
- data FontChooserSetFilterFuncMethodInfo
- fontChooserSetFilterFunc :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> Maybe FontFilterFunc -> m ()
- data FontChooserSetFontMethodInfo
- fontChooserSetFont :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> Text -> m ()
- data FontChooserSetFontDescMethodInfo
- fontChooserSetFontDesc :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> FontDescription -> m ()
- data FontChooserSetFontMapMethodInfo
- fontChooserSetFontMap :: (HasCallStack, MonadIO m, IsFontChooser a, IsFontMap b) => a -> Maybe b -> m ()
- data FontChooserSetPreviewTextMethodInfo
- fontChooserSetPreviewText :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> Text -> m ()
- data FontChooserSetShowPreviewEntryMethodInfo
- fontChooserSetShowPreviewEntry :: (HasCallStack, MonadIO m, IsFontChooser a) => a -> Bool -> m ()
- data FontChooserFontPropertyInfo
- constructFontChooserFont :: IsFontChooser o => Text -> IO (GValueConstruct o)
- fontChooserFont :: AttrLabelProxy "font"
- getFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> m (Maybe Text)
- setFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> Text -> m ()
- data FontChooserFontDescPropertyInfo
- constructFontChooserFontDesc :: IsFontChooser o => FontDescription -> IO (GValueConstruct o)
- fontChooserFontDesc :: AttrLabelProxy "fontDesc"
- getFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> m (Maybe FontDescription)
- setFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> FontDescription -> m ()
- data FontChooserPreviewTextPropertyInfo
- constructFontChooserPreviewText :: IsFontChooser o => Text -> IO (GValueConstruct o)
- fontChooserPreviewText :: AttrLabelProxy "previewText"
- getFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> m (Maybe Text)
- setFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> Text -> m ()
- data FontChooserShowPreviewEntryPropertyInfo
- constructFontChooserShowPreviewEntry :: IsFontChooser o => Bool -> IO (GValueConstruct o)
- fontChooserShowPreviewEntry :: AttrLabelProxy "showPreviewEntry"
- getFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> m Bool
- setFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> Bool -> m ()
- type C_FontChooserFontActivatedCallback = Ptr () -> CString -> Ptr () -> IO ()
- type FontChooserFontActivatedCallback = Text -> IO ()
- data FontChooserFontActivatedSignalInfo
- afterFontChooserFontActivated :: (GObject a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId
- genClosure_FontChooserFontActivated :: FontChooserFontActivatedCallback -> IO Closure
- mk_FontChooserFontActivatedCallback :: C_FontChooserFontActivatedCallback -> IO (FunPtr C_FontChooserFontActivatedCallback)
- noFontChooserFontActivatedCallback :: Maybe FontChooserFontActivatedCallback
- onFontChooserFontActivated :: (GObject a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId
- wrap_FontChooserFontActivatedCallback :: FontChooserFontActivatedCallback -> Ptr () -> CString -> Ptr () -> IO ()
Exported types
newtype FontChooser Source #
GObject FontChooser Source # | |
IsObject FontChooser Source # | |
IsFontChooser FontChooser Source # | |
((~) * info (ResolveFontChooserMethod t FontChooser), MethodInfo * info FontChooser p) => IsLabel t (FontChooser -> p) Source # | |
((~) * info (ResolveFontChooserMethod t FontChooser), MethodInfo * info FontChooser p) => IsLabelProxy t (FontChooser -> p) Source # | |
HasAttributeList * FontChooser Source # | |
type AttributeList FontChooser Source # | |
type SignalList FontChooser Source # | |
class GObject o => IsFontChooser o Source #
toFontChooser :: IsFontChooser o => o -> IO FontChooser Source #
Methods
getFont
data FontChooserGetFontMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetFontMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m (Maybe Text) | Returns: A string with the name
of the current font, or |
Gets the currently-selected font name.
Note that this can be a different string than what you set with
fontChooserSetFont
, as the font chooser widget may
normalize font names and thus return a string with a different
structure. For example, “Helvetica Italic Bold 12” could be
normalized to “Helvetica Bold Italic 12”.
Use fontDescriptionEqual
if you want to compare two
font descriptions.
Since: 3.2
getFontDesc
data FontChooserGetFontDescMethodInfo Source #
((~) * signature (m (Maybe FontDescription)), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetFontDescMethodInfo a signature Source # | |
fontChooserGetFontDesc Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m (Maybe FontDescription) | Returns: A |
Gets the currently-selected font.
Note that this can be a different string than what you set with
fontChooserSetFont
, as the font chooser widget may
normalize font names and thus return a string with a different
structure. For example, “Helvetica Italic Bold 12” could be
normalized to “Helvetica Bold Italic 12”.
Use fontDescriptionEqual
if you want to compare two
font descriptions.
Since: 3.2
getFontFace
data FontChooserGetFontFaceMethodInfo Source #
((~) * signature (m (Maybe FontFace)), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetFontFaceMethodInfo a signature Source # | |
fontChooserGetFontFace Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m (Maybe FontFace) | Returns: A |
getFontFamily
data FontChooserGetFontFamilyMethodInfo Source #
((~) * signature (m (Maybe FontFamily)), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetFontFamilyMethodInfo a signature Source # | |
fontChooserGetFontFamily Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m (Maybe FontFamily) | Returns: A |
Gets the FontFamily
representing the selected font family.
Font families are a collection of font faces.
If the selected font is not installed, returns Nothing
.
Since: 3.2
getFontMap
data FontChooserGetFontMapMethodInfo Source #
((~) * signature (m (Maybe FontMap)), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetFontMapMethodInfo a signature Source # | |
fontChooserGetFontMap Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m (Maybe FontMap) |
Gets the custom font map of this font chooser widget,
or Nothing
if it does not have one.
Since: 3.18
getFontSize
data FontChooserGetFontSizeMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetFontSizeMethodInfo a signature Source # | |
fontChooserGetFontSize Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m Int32 | Returns: A n integer representing the selected font size, or -1 if no font size is selected. |
The selected font size.
Since: 3.2
getPreviewText
data FontChooserGetPreviewTextMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetPreviewTextMethodInfo a signature Source # | |
fontChooserGetPreviewText Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m Text | Returns: the text displayed in the preview area |
Gets the text displayed in the preview area.
Since: 3.2
getShowPreviewEntry
data FontChooserGetShowPreviewEntryMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserGetShowPreviewEntryMethodInfo a signature Source # | |
fontChooserGetShowPreviewEntry Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the preview entry is shown or not.
Since: 3.2
setFilterFunc
data FontChooserSetFilterFuncMethodInfo Source #
((~) * signature (Maybe FontFilterFunc -> m ()), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserSetFilterFuncMethodInfo a signature Source # | |
fontChooserSetFilterFunc Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> Maybe FontFilterFunc |
|
-> m () |
Adds a filter function that decides which fonts to display in the font chooser.
Since: 3.2
setFont
data FontChooserSetFontMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserSetFontMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the currently-selected font.
Since: 3.2
setFontDesc
data FontChooserSetFontDescMethodInfo Source #
((~) * signature (FontDescription -> m ()), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserSetFontDescMethodInfo a signature Source # | |
fontChooserSetFontDesc Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> FontDescription |
|
-> m () |
Sets the currently-selected font from fontDesc
.
Since: 3.2
setFontMap
data FontChooserSetFontMapMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsFontChooser a, IsFontMap b) => MethodInfo * FontChooserSetFontMapMethodInfo a signature Source # | |
fontChooserSetFontMap Source #
:: (HasCallStack, MonadIO m, IsFontChooser a, IsFontMap b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets a custom font map to use for this font chooser widget. A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.
C code
FcConfig *config; PangoFontMap *fontmap; config = FcInitLoadConfigAndFonts (); FcConfigAppFontAddFile (config, my_app_font_file); fontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT); pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config); gtk_font_chooser_set_font_map (font_chooser, fontmap);
Note that other GTK+ widgets will only be able to use the application-specific font if it is present in the font map they use:
context = gtk_widget_get_pango_context (label); pango_context_set_font_map (context, fontmap);
Since: 3.18
setPreviewText
data FontChooserSetPreviewTextMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserSetPreviewTextMethodInfo a signature Source # | |
fontChooserSetPreviewText Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the text displayed in the preview area.
The text
is used to show how the selected font looks.
Since: 3.2
setShowPreviewEntry
data FontChooserSetShowPreviewEntryMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsFontChooser a) => MethodInfo * FontChooserSetShowPreviewEntryMethodInfo a signature Source # | |
fontChooserSetShowPreviewEntry Source #
:: (HasCallStack, MonadIO m, IsFontChooser a) | |
=> a |
|
-> Bool |
|
-> m () |
Shows or hides the editable preview entry.
Since: 3.2
Properties
font
data FontChooserFontPropertyInfo Source #
constructFontChooserFont :: IsFontChooser o => Text -> IO (GValueConstruct o) Source #
fontChooserFont :: AttrLabelProxy "font" Source #
getFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> m (Maybe Text) Source #
setFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> Text -> m () Source #
fontDesc
data FontChooserFontDescPropertyInfo Source #
constructFontChooserFontDesc :: IsFontChooser o => FontDescription -> IO (GValueConstruct o) Source #
fontChooserFontDesc :: AttrLabelProxy "fontDesc" Source #
getFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> m (Maybe FontDescription) Source #
setFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> FontDescription -> m () Source #
previewText
data FontChooserPreviewTextPropertyInfo Source #
constructFontChooserPreviewText :: IsFontChooser o => Text -> IO (GValueConstruct o) Source #
fontChooserPreviewText :: AttrLabelProxy "previewText" Source #
getFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> m (Maybe Text) Source #
setFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> Text -> m () Source #
showPreviewEntry
data FontChooserShowPreviewEntryPropertyInfo Source #
constructFontChooserShowPreviewEntry :: IsFontChooser o => Bool -> IO (GValueConstruct o) Source #
fontChooserShowPreviewEntry :: AttrLabelProxy "showPreviewEntry" Source #
getFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> m Bool Source #
setFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> Bool -> m () Source #
Signals
fontActivated
type FontChooserFontActivatedCallback = Text -> IO () Source #
afterFontChooserFontActivated :: (GObject a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId Source #
mk_FontChooserFontActivatedCallback :: C_FontChooserFontActivatedCallback -> IO (FunPtr C_FontChooserFontActivatedCallback) Source #
onFontChooserFontActivated :: (GObject a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId Source #
wrap_FontChooserFontActivatedCallback :: FontChooserFontActivatedCallback -> Ptr () -> CString -> Ptr () -> IO () Source #