Interface FontChooser
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
FontButton,FontChooser.FontChooser$Impl,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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFontChooser.Builder<B extends Builder<B>>Deprecated.static interfaceDeprecated.static classDeprecated.The FontChooser$Impl type represents a native instance of the FontChooser interface.static classDeprecated. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidemitFontActivated(String fontname) Deprecated.default @Nullable StringgetFont()Deprecated.UseFontDialogandFontDialogButtoninsteaddefault @Nullable FontDescriptionDeprecated.UseFontDialogandFontDialogButtoninsteaddefault @Nullable FontFaceDeprecated.UseFontDialogandFontDialogButtoninsteaddefault @Nullable FontFamilyDeprecated.UseFontDialogandFontDialogButtoninsteaddefault StringDeprecated.UseFontDialogandFontDialogButtoninsteaddefault @Nullable FontMapDeprecated.UseFontDialogandFontDialogButtoninsteaddefault intDeprecated.UseFontDialogandFontDialogButtoninsteaddefault StringDeprecated.UseFontDialogandFontDialogButtoninsteaddefault Set<FontChooserLevel> getLevel()Deprecated.UseFontDialogandFontDialogButtoninsteaddefault StringDeprecated.UseFontDialogandFontDialogButtoninsteaddefault booleanDeprecated.UseFontDialogandFontDialogButtoninsteadstatic @Nullable TypegetType()Deprecated.Get the GType of the FontChooser classDeprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetFilterFunc(@Nullable FontFilterFunc filter) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidDeprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetFontDesc(FontDescription fontDesc) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetFontMap(@Nullable FontMap fontmap) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetLanguage(String language) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetLevel(Set<FontChooserLevel> level) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetLevel(FontChooserLevel... level) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetPreviewText(String text) Deprecated.UseFontDialogandFontDialogButtoninsteaddefault voidsetShowPreviewEntry(boolean showPreviewEntry) Deprecated.UseFontDialogandFontDialogButtoninstead
-
Method Details
-
getType
Deprecated.Get the GType of the FontChooser class- Returns:
- the GType
-
getFont
Deprecated.UseFontDialogandFontDialogButtoninsteadGets 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.UseFontDialogandFontDialogButtoninsteadGets 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
PangoFontDescriptionfor the current font
-
getFontFace
Deprecated.UseFontDialogandFontDialogButtoninsteadGets thePangoFontFacerepresenting the selected font group details (i.e. family, slant, weight, width, etc).If the selected font is not installed, returns
null.- Returns:
- A
PangoFontFacerepresenting the selected font group details
-
getFontFamily
Deprecated.UseFontDialogandFontDialogButtoninsteadGets thePangoFontFamilyrepresenting the selected font family.Font families are a collection of font faces.
If the selected font is not installed, returns
null.- Returns:
- A
PangoFontFamilyrepresenting the selected font family
-
getFontFeatures
Deprecated.UseFontDialogandFontDialogButtoninsteadGets 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.UseFontDialogandFontDialogButtoninsteadGets the custom font map of this font chooser widget, ornullif it does not have one.- Returns:
- a
PangoFontMap
-
getFontSize
Deprecated.UseFontDialogandFontDialogButtoninsteadThe selected font size.- Returns:
- A n integer representing the selected font size, or -1 if no font size is selected.
-
getLanguage
Deprecated.UseFontDialogandFontDialogButtoninsteadGets the language that is used for font features.- Returns:
- the currently selected language
-
getLevel
Deprecated.UseFontDialogandFontDialogButtoninsteadReturns the current level of granularity for selecting fonts.- Returns:
- the current granularity level
-
getPreviewText
Deprecated.UseFontDialogandFontDialogButtoninsteadGets the text displayed in the preview area.- Returns:
- the text displayed in the preview area
-
getShowPreviewEntry
Deprecated.UseFontDialogandFontDialogButtoninsteadReturns whether the preview entry is shown or not.- Returns:
trueif the preview entry is shown orfalseif it is hidden.
-
setFilterFunc
Deprecated.UseFontDialogandFontDialogButtoninsteadAdds a filter function that decides which fonts to display in the font chooser.- Parameters:
filter- aGtkFontFilterFunc
-
setFont
Deprecated.UseFontDialogandFontDialogButtoninsteadSets the currently-selected font.- Parameters:
fontname- a font name like “Helvetica 12” or “Times Bold 18”
-
setFontDesc
Deprecated.UseFontDialogandFontDialogButtoninsteadSets the currently-selected font fromfontDesc.- Parameters:
fontDesc- aPangoFontDescription
-
setFontMap
Deprecated.UseFontDialogandFontDialogButtoninsteadSets 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.UseFontDialogandFontDialogButtoninsteadSets the language to use for font features.- Parameters:
language- a language
-
setLevel
Deprecated.UseFontDialogandFontDialogButtoninsteadSets the desired level of granularity for selecting fonts.- Parameters:
level- the desired level of granularity
-
setLevel
Deprecated.UseFontDialogandFontDialogButtoninsteadSets the desired level of granularity for selecting fonts.- Parameters:
level- the desired level of granularity
-
setPreviewText
Deprecated.UseFontDialogandFontDialogButtoninsteadSets the text displayed in the preview area.The
textis used to show how the selected font looks.- Parameters:
text- the text to display in the preview area
-
setShowPreviewEntry
Deprecated.UseFontDialogandFontDialogButtoninsteadShows 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.UseFontDialogandFontDialogButtoninsteadEmitted 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).
-
FontDialogandFontDialogButtoninstead