[scribus-dev] Vertical extent of text

Gregory Pittman gpittman at iglou.com
Wed Nov 20 16:29:04 UTC 2019


On 11/20/19 10:24 AM, Michael J Gruber wrote:
> In short, my question is: Which library
> (harfbuzz/pango/cairo/freetype/fontconfig/...) does Scribus use to
> determine the vertical extent of text used for colouring backgrounds?
> In addition: Do I need to recompile Scribus to really try out
> different library versions, or is everything relevant picked up from
> the dynamically linked .so at run-time?
> 
> The reason for the question (and why I'm posting to dev) is that the
> same scribus version shows quite different behaviour after an upgrade
> from Fedora 30 to 31 which involved a few library upgrades, and I
> would like to track down which library change this comes from and
> whether the old or new behaviour is "right", or whether maybe Scribus
> should use different font metric sources.
> 
> As you can see in the attached png, the differences are much bigger
> than the usual variation in kerning and such. By "vertical extent" I
> mean the vertical space that is used when you set a background color
> via paragraph-style->properties. More details:
> 
> Versions:
> "old" is Scribus-1.5.5 on Fedora 30 (with older libraries - system not
> available any more), "new" is Scribus-1.5.5 or  1.5.6svn on Fedora 31
> (with newer libraries - both 1.5.5 and 1.5.6svn produce the same
> result).
> 
> Comparisons:
> For the two layouts left and right of the black bar, "old" and "new"
> are compared in split view without separation in between (PDF export
> converted to PNG and split-overlayed). As you can see, "old" uses much
> more vertical space than "new". [By "use" I mean for background
> colouring and positioning within the box - the overall line spacing is
> unchanged, see below.]
> 
> Font:
> Font is Alegreya Sans
> (https://github.com/huertatipografica/Alegreya-Sans). "old" and "new"
> use the same ttf font files. I have tried "new" with the otf versions,
> this makes no difference. (Unfortunately I can't try "old" with
> different fonts - unless I know which library to downgrade.)
> 
> Properties:
> White-on-green uses a paragraph style with automatic line spacing
> (Alegreya Sans Bold 20), the text box uses "Font Ascent" as first line
> offset. As you see, both the space above and below are smaller in
> "new", and therefore the positioning changes. The same is true for the
> large white-on-darkred on the right.
> 
> Small white-on-darkred and black-on-lightred  use a paragraph style
> which aligns to the 12pt-base line grid, which is (even with "new")
> the natural line spacing for Alegreya Sans regular 10; the text box
> uses the default "Maximum Ascent" for first line offset. Here, the
> same difference in vertical extent shows up, but aligned to the grid.
> 
> Side note 1: The "automatic line spacing" comes out the same in both
> "old" and "new" (by looking at text with very many lines and comparing
> to "manual"), so it's not the line spacing metric which causes these
> differences.
> Side note 2: Setting a background colour on the character style gives
> smaller vertical extent (and of course smaller horizontal extent -
> colour just behind the text). This differs by font, though.
> Side note 3: A workaround is a filled box at lower z, of course...
> which would be annoying for the table, and which is no explanation for
> the change.
> 
> Any hints on how to track this down are appreciated!
> Michael

Hi Michael,

I don't know if there is any "solution" to this. Over the years there have been some periodic changes in precisely how text relates to the top edge of the frame at the various settings for line spacing and ascent. I don't think one could say that things are more or less "right" before or after, it's simply how things are.

It's mostly a matter of searching for workarounds when needed, though I'm not sure how often they would actually be needed.

Greg




More information about the scribus-dev mailing list