Use configured font for link hints

Jeremie Knuesel requested to merge knuesel/zathura:feature/links-font into develop

While investigating issue 441 it appeared that the hint font setting was not working (cairo_select_font_face cannot take a full font description). Also the hint text is clipped to the link area, so the text is truncated if the link area is too small (for example after zooming out).

This MR fixes these two issues:

  • the font description is parsed with Pango to get the font size and family, and the font size is converted to device units (the size conversion takes a bit of work).
  • the rectangle for the link hint is redrawn in addition to the rectangle for the link area

Regarding issue 441: I'm not sure there was a problem in Zathura in the first place: the link hints look normal and legible on a HiDPI screen (even without HiDPI support in Zathura). This is thanks to the factor 2 scaling applied globally to the desktop (which used to make the PDF content blurry, but the hint was fine). So I wonder if the user simply didn't have any scaling enabled on the desktop, in which case the hints were small indeed.

In any case, this MR allows the user to select the hint font size, so it should fix issue 441.

Merge request reports