Interface FontChooser
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
FontButton
,FontChooser.FontChooserImpl
,FontChooserDialog
,FontChooserWidget
GtkFontChooser
is an interface that can be implemented by widgets
for choosing fonts.
In GTK, the main objects that implement this interface are
FontChooserWidget
, FontChooserDialog
and
FontButton
.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
FontChooser.Builder<B extends Builder<B>>
Deprecated.static interface
Deprecated.static class
Deprecated.static class
Deprecated.The FontChooserImpl type represents a native instance of the FontChooser interface. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
emitFontActivated
(String fontname) Deprecated.default String
getFont()
Deprecated.default FontDescription
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault FontFace
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault FontFamily
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault String
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault FontMap
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault int
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault String
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault Set
<FontChooserLevel> getLevel()
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault String
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault boolean
Deprecated.UseFontDialog
andFontDialogButton
insteadstatic Type
getType()
Deprecated.Get the GType of the FontChooser classDeprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setFilterFunc
(@Nullable FontFilterFunc filter) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setFontDesc
(FontDescription fontDesc) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setFontMap
(@Nullable FontMap fontmap) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setLanguage
(String language) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setLevel
(Set<FontChooserLevel> level) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setLevel
(FontChooserLevel... level) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setPreviewText
(String text) Deprecated.UseFontDialog
andFontDialogButton
insteaddefault void
setShowPreviewEntry
(boolean showPreviewEntry) Deprecated.UseFontDialog
andFontDialogButton
instead
-
Method Details
-
getType
-
getFont
Deprecated.UseFontDialog
andFontDialogButton
insteadGets the currently-selected font name.Note that this can be a different string than what you set with
setFont(java.lang.String)
, 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
FontDescription.equal(org.gnome.pango.FontDescription)
if you want to compare two font descriptions.- Returns:
- A string with the name of the current font
-
getFontDesc
Deprecated.UseFontDialog
andFontDialogButton
insteadGets the currently-selected font.Note that this can be a different string than what you set with
setFont(java.lang.String)
, 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
FontDescription.equal(org.gnome.pango.FontDescription)
if you want to compare two font descriptions.- Returns:
- A
PangoFontDescription
for the current font
-
getFontFace
Deprecated.UseFontDialog
andFontDialogButton
insteadGets thePangoFontFace
representing the selected font group details (i.e. family, slant, weight, width, etc).If the selected font is not installed, returns
null
.- Returns:
- A
PangoFontFace
representing the selected font group details
-
getFontFamily
Deprecated.UseFontDialog
andFontDialogButton
insteadGets thePangoFontFamily
representing the selected font family.Font families are a collection of font faces.
If the selected font is not installed, returns
null
.- Returns:
- A
PangoFontFamily
representing the selected font family
-
getFontFeatures
Deprecated.UseFontDialog
andFontDialogButton
insteadGets the currently-selected font features.The format of the returned string is compatible with the CSS font-feature-settings property. It can be passed to
AttrFontFeatures.new_(java.lang.String)
.- Returns:
- the currently selected font features
-
getFontMap
Deprecated.UseFontDialog
andFontDialogButton
insteadGets the custom font map of this font chooser widget, ornull
if it does not have one.- Returns:
- a
PangoFontMap
-
getFontSize
Deprecated.UseFontDialog
andFontDialogButton
insteadThe selected font size.- Returns:
- A n integer representing the selected font size, or -1 if no font size is selected.
-
getLanguage
Deprecated.UseFontDialog
andFontDialogButton
insteadGets the language that is used for font features.- Returns:
- the currently selected language
-
getLevel
Deprecated.UseFontDialog
andFontDialogButton
insteadReturns the current level of granularity for selecting fonts.- Returns:
- the current granularity level
-
getPreviewText
Deprecated.UseFontDialog
andFontDialogButton
insteadGets the text displayed in the preview area.- Returns:
- the text displayed in the preview area
-
getShowPreviewEntry
Deprecated.UseFontDialog
andFontDialogButton
insteadReturns whether the preview entry is shown or not.- Returns:
true
if the preview entry is shown orfalse
if it is hidden.
-
setFilterFunc
Deprecated.UseFontDialog
andFontDialogButton
insteadAdds a filter function that decides which fonts to display in the font chooser.- Parameters:
filter
- aGtkFontFilterFunc
-
setFont
Deprecated.UseFontDialog
andFontDialogButton
insteadSets the currently-selected font.- Parameters:
fontname
- a font name like “Helvetica 12” or “Times Bold 18”
-
setFontDesc
Deprecated.UseFontDialog
andFontDialogButton
insteadSets the currently-selected font fromfontDesc
.- Parameters:
fontDesc
- aPangoFontDescription
-
setFontMap
Deprecated.UseFontDialog
andFontDialogButton
insteadSets 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.
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);
- Parameters:
fontmap
- aPangoFontMap
-
setLanguage
Deprecated.UseFontDialog
andFontDialogButton
insteadSets the language to use for font features.- Parameters:
language
- a language
-
setLevel
Deprecated.UseFontDialog
andFontDialogButton
insteadSets the desired level of granularity for selecting fonts.- Parameters:
level
- the desired level of granularity
-
setLevel
Deprecated.UseFontDialog
andFontDialogButton
insteadSets the desired level of granularity for selecting fonts.- Parameters:
level
- the desired level of granularity
-
setPreviewText
Deprecated.UseFontDialog
andFontDialogButton
insteadSets the text displayed in the preview area.The
text
is used to show how the selected font looks.- Parameters:
text
- the text to display in the preview area
-
setShowPreviewEntry
Deprecated.UseFontDialog
andFontDialogButton
insteadShows or hides the editable preview entry.- Parameters:
showPreviewEntry
- whether to show the editable preview entry or not
-
onFontActivated
@Deprecated default SignalConnection<FontChooser.FontActivatedCallback> onFontActivated(FontChooser.FontActivatedCallback handler) Deprecated.UseFontDialog
andFontDialogButton
insteadEmitted when a font is activated.This usually happens when the user double clicks an item, or an item is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitFontActivated
Deprecated.Emits the "font-activated" signal. SeeonFontActivated(org.gnome.gtk.FontChooser.FontActivatedCallback)
.
-
FontDialog
andFontDialogButton
instead