Improve Text and Font dialog resizing experience
Text and Font dialog has some usability deficiencies:
- if selected text has many lines, dialog can grow taller than a desktop
- if selected font doesn't support any variants dialog devotes half of its real estate to empty widget
- font family box expands by 1/3 of the dialog width even though its content is wide
This is a fix for above issues. To cap dialog height (or preview height really) I'm limiting number of lines of text in a preview (since Gtk doesn't allow max element height).
If font variants are not available its widget gets compacted.
Finally, "Font family" box grows faster than "Style" box. As you can see below both boxes get wider when resizing a dialog, but "Font family" has a priority.
Example of preview limited to 4 lines and collapsed font variants:
Font variants show up only when in use by selected text:
I hope this can be accepted as is. Thanks.

