Use pango to parse font configuration early, and reject the command as
invalid if the value is invalid for pango. Since we're already parsing
the font into a `PangoFontDescription`, keep that instance around and
avoid re-parsing the font each time we render text.
Fixes: https://github.com/swaywm/sway/issues/6805
Use fixed titlebar heights. The default height is calculated based on
font metrics for the configured font and current locale.
Some testing with titles with emoji and CJK characters (which are
substantially higher in my setup) shows that the titlebars retain their
initial value, text does shift up or down, and all titlebars always
remain aligned.
Also drop some also now-unecessary title_height calculations.
Makes also needed to be updated, since they should be positioned with
the same rules.
Fixes#2674.
The cause of the issue was in get_pango_layout. When we call
pango_parse_markup, `text` is the escaped string, and the unescaped
string is then computed and written to `buf`. We were then passing the
unescaped string to pango_layout_set_markup, but this function needs the
escaped string. `buf` is not needed and has been removed.
The other part of this PR refactors escape_markup_text to remove the
dest_length argument and removes the -1 return value on error. It now
assumes that you've allocated dest to the correct length.
This does the following:
* Adds a baseline argument to get_text_size (the baseline is the
distance from the top of the texture to the baseline).
* Stores the baseline in the container when calculating the title
height.
* Takes the baseline into account when calculating the config's max font
height.
* When rendering, pads the textures according to the baseline so they
line up.
This starts up the event loop and wayland display and shims out the
basic top level rendering concepts. Also includes some changes to
incorporate pango into the 1.x codebase properly.