Skip to content

Draft: Allow the font chooser to optionally sort fonts by name

Manu Cornet requested to merge lmanul/gtk:font-chooser-sort into main

[Note that it's my first time contributing to GTK in several decades, so I need to ask for your guidance and patience with me :-D ]

The original motivation for this change comes from the conversion of gnome-terminal to GTK-4 (sorting fonts is mentioned in there).

This change adds a new property to allow the caller to have fonts be sorted by name. This is false by default, so that no existing behavior is changed, except in demos/gtk-demo/pickers.c.

The class diagram for this widget is a little confusing and includes at least one deprecated class (in gtk/deprecated/gtkfontchooser) but I couldn't see a way to make this work without affecting those. Please let me know if there are simpler ways!

Again, I may need a little guidance and patience when iterating on this. Thanks a lot in advance :-)

Not sorted (default) Sorted
fonts-not-sorted fonts-sorted

Merge request reports