Converting FontChooser font style to CSS font style

My application lets a user choose their font style for certain widgets. This style is (of course set in CSS syntax: “22px Sans”). However, the GtkFontChooser only works with GTK’s old syntax: “Sans 22”.

I can’t find a conversion function from the one to the other. Can someone point me in the right direction?
Or should this be perceived as a bug within GTK?

There’s no bug here. The API for fonts used in GTK is PangoFontDescription.

CSS is the theming API.

If you choose to use it at runtime, the translation from pango to css is your job.

Thank you for the answer!
It would be nice to have a mapping function for the future, though.

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