gtk_widget_override_font() not working on Broadway
Steps to reproduce
- Compile the simple_label_app.c snippet
- Run on a local Broadway server
The snippet runs but no text is rendered in the GtkWindow. An assertion error is printed:
pango_font_description_set_size: assertion 'size >= 0' failed
The snippet runs without assertion errors and the text "Hello moto" is rendered in the GtkWindow.
The font being set by
gtk_widget_override_font() is fetched via
gtk_style_context_get(), and AFAICT it has a valid size before
gtk_widget_override_font() is called.
I took a look at the
pack_font_description() function in gtk/gtkcssshorthandpropertyimpl.c, where
pango_font_description_set_size() is being called. It appears some negative font sizes are being returned by
round (_gtk_css_number_value_get (v, 100) * PANGO_SCALE * 72 / dpi).
This bug prevents any meaningful SWT snippet from being run on Broadway, as no text is rendered anywhere.