This post is about using Avalonia’s FontManager class.
I wasn’t able to find a sample showing how to create a simple font picker with the fonts installed on the system.
This is quite simple as it is using a standard ComboBox control which lists all the installed system fonts.
Items collection is of type
Avalonia.Media.FontFamily and the
FontManager class from the same namespace provides convenient access to all the installed system fonts.
The view is also quite simple. The item template of the ComboBox simply contains a TextBlock control which displays the name in the corresponding font.
If you only want to show the font names without rendering them in the corresponding font, simply remove line 6.
I tested this on Windows and Linux using Avalonia 11.0.6.