Selecting a font in GtkFontChooser in GTK 4.8

The following statement instantiates a font button

GtkWidget *btn_font = gtk_font_button_new_with_font("DejaVu Sans Bold 11");
  • In GTK 3.24, clicking this button shows the font chooser dialog with DejaVu Sans Bold selected.
  • In GTK 4.8, clicking this button shows the font chooser with no font selected.

In either case, when I select DejaVu Sans Bold in the font chooser and close, that font appears in the button. Clicking the button shows the font chooser with the font correctly selected.

  • What changed between 3.24 and 4.8 that prevents correct selection in the font chooser dialog?
  • In 4.8, how can I click a font button and have the associated font be selected in the font chooser?

(While GtkFontButton was deprecated in 4.10 in favor of GtkFontDialogButton, Debian is still delivering 4.8.)

Hi,

The migration to a new list widget.

That bug was fixed in recent Gtk versions. If you have to stay on Debian and can’t upgrade the system-provided gtk, I would recommend to try using apps from flatpak.

Acknowledged, and thank you.

woops, no, actually it’s still not fixed in the latest release… I got confused between the FileChooser (which was fixed) and FontChooser (still open)…

Seems not too complex, I’ll try to push something.

Thank you! Very much appreciated.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.