Interface FontChooser

All Superinterfaces:
Proxy
All Known Implementing Classes:
FontButton, FontChooser.FontChooser$Impl, FontChooserDialog, FontChooserWidget

@Generated("org.javagi.JavaGI") @Deprecated public interface FontChooser extends Proxy
Deprecated.

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.

  • Method Details

    • getType

      static @Nullable Type getType()
      Deprecated.
      Get the GType of the FontChooser class.
      Returns:
      the GType
    • getFont

      @Deprecated default @Nullable String getFont()
      Deprecated.

      Gets the currently-selected font name.

      Note that this can be a different string than what you set with setFont(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 if you want to compare two font descriptions.

      Returns:
      A string with the name of the current font
    • getFontDesc

      @Deprecated default @Nullable FontDescription getFontDesc()
      Deprecated.

      Gets the currently-selected font.

      Note that this can be a different string than what you set with setFont(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 if you want to compare two font descriptions.

      Returns:
      A PangoFontDescription for the current font
    • getFontFace

      @Deprecated default @Nullable FontFace getFontFace()
      Deprecated.

      Gets the PangoFontFace 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 default @Nullable FontFamily getFontFamily()
      Deprecated.

      Gets the PangoFontFamily 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 default String getFontFeatures()
      Deprecated.

      Gets 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_.

      Returns:
      the currently selected font features
    • getFontMap

      @Deprecated default @Nullable FontMap getFontMap()
      Deprecated.
      Gets the custom font map of this font chooser widget, or null if it does not have one.
      Returns:
      a PangoFontMap
    • getFontSize

      @Deprecated default int getFontSize()
      Deprecated.
      The selected font size.
      Returns:
      A n integer representing the selected font size, or -1 if no font size is selected.
    • getLanguage

      @Deprecated default String getLanguage()
      Deprecated.
      Gets the language that is used for font features.
      Returns:
      the currently selected language
    • getLevel

      @Deprecated default Set<FontChooserLevel> getLevel()
      Deprecated.
      Returns the current level of granularity for selecting fonts.
      Returns:
      the current granularity level
    • getPreviewText

      @Deprecated default String getPreviewText()
      Deprecated.
      Gets the text displayed in the preview area.
      Returns:
      the text displayed in the preview area
    • getShowPreviewEntry

      @Deprecated default boolean getShowPreviewEntry()
      Deprecated.
      Returns whether the preview entry is shown or not.
      Returns:
      true if the preview entry is shown or false if it is hidden.
    • setFilterFunc

      @Deprecated default void setFilterFunc(@Nullable FontFilterFunc filter)
      Deprecated.
      Adds a filter function that decides which fonts to display in the font chooser.
      Parameters:
      filter - a GtkFontFilterFunc
    • setFont

      @Deprecated default void setFont(String fontname)
      Deprecated.
      Sets the currently-selected font.
      Parameters:
      fontname - a font name like “Helvetica 12” or “Times Bold 18”
    • setFontDesc

      @Deprecated default void setFontDesc(FontDescription fontDesc)
      Deprecated.
      Sets the currently-selected font from fontDesc.
      Parameters:
      fontDesc - a PangoFontDescription
    • setFontMap

      @Deprecated default void setFontMap(@Nullable FontMap fontmap)
      Deprecated.

      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.

      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 - a PangoFontMap
    • setLanguage

      @Deprecated default void setLanguage(String language)
      Deprecated.
      Sets the language to use for font features.
      Parameters:
      language - a language
    • setLevel

      @Deprecated default void setLevel(Set<FontChooserLevel> level)
      Deprecated.
      Sets the desired level of granularity for selecting fonts.
      Parameters:
      level - the desired level of granularity
    • setLevel

      @Deprecated default void setLevel(FontChooserLevel... level)
      Deprecated.
      Sets the desired level of granularity for selecting fonts.
      Parameters:
      level - the desired level of granularity
    • setPreviewText

      @Deprecated default void setPreviewText(String text)
      Deprecated.

      Sets 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 default void setShowPreviewEntry(boolean showPreviewEntry)
      Deprecated.
      Shows or hides the editable preview entry.
      Parameters:
      showPreviewEntry - whether to show the editable preview entry or not
    • onFontActivated

      Deprecated.

      Emitted 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 default void emitFontActivated(String fontname)
      Deprecated.
      Emits the "font-activated" signal. See onFontActivated(FontChooser.FontActivatedCallback).