font chooser: Support font variations

Add sliders for the axes on the tweak page.
This commit is contained in:
Matthias Clasen
2018-03-31 14:43:04 -04:00
parent 6271326718
commit f30ecaa22f
4 changed files with 299 additions and 12 deletions

View File

@ -49,6 +49,7 @@ typedef gboolean (*GtkFontFilterFunc) (const PangoFontFamily *family,
* @GTK_FONT_CHOOSER_LEVEL_FAMILY: Allow selecting a font family
* @GTK_FONT_CHOOSER_LEVEL_STYLE: Allow selecting a specific font face
* @GTK_FONT_CHOOSER_LEVEL_SIZE: Allow selecting a specific font size
* @GTK_FONT_CHOOSER_LEVEL_VARIATION: Allow changing OpenType font variation axes
* @GTK_FONT_CHOOSER_LEVEL_FEATURES: Allow selecting specific OpenType font features
*
* This enumeration specifies the granularity of font selection
@ -58,10 +59,11 @@ typedef gboolean (*GtkFontFilterFunc) (const PangoFontFamily *family,
* ignore unknown values.
*/
typedef enum {
GTK_FONT_CHOOSER_LEVEL_FAMILY = 0,
GTK_FONT_CHOOSER_LEVEL_STYLE = 1 << 0,
GTK_FONT_CHOOSER_LEVEL_SIZE = 1 << 1,
GTK_FONT_CHOOSER_LEVEL_FEATURES = 1 << 2
GTK_FONT_CHOOSER_LEVEL_FAMILY = 0,
GTK_FONT_CHOOSER_LEVEL_STYLE = 1 << 0,
GTK_FONT_CHOOSER_LEVEL_SIZE = 1 << 1,
GTK_FONT_CHOOSER_LEVEL_VARIATIONS = 1 << 2,
GTK_FONT_CHOOSER_LEVEL_FEATURES = 1 << 3
} GtkFontChooserLevel;
#define GTK_TYPE_FONT_CHOOSER (gtk_font_chooser_get_type ())