[scribus-dev] Vertical extent of text

Michael J Gruber mjg at fedoraproject.org
Mon Nov 25 10:46:41 UTC 2019


Hi Greg,

sure there are changes, and I'm prepared to expect changes with
different versions of Scribus. But here we have the exact same Scribus
version with different libraries.

Meanwhile, I have created a reproducer and tracked this down to a
change in freetype, by checking each differing library one by one. The
two different PDFs are produced with the same Scribus installation on
the same Fedora 31 - the only difference is in the version of
freetype. Fedora 31 comes with freetype-2.10.0; I have rebuilt
freetype-2.9.1 for Fedora 31 to compare with.

The reproducer shows that the vertical extent even depends on the fact
whether the following paragraph style is the same or not. Let's hope
this behaviour in freetype 2.10 is not intended but to be fixed soon,
or else Scribus needs to use freetype differently than it does now.
Fedora's freetype is built without harfbuzz, in any version. The
current version freetype 2.10.1 does not fix this problem either.

If I knew which freetype-feature Scribus uses here I might be able to
post a meaningful bug report over there.

Another note: The problem depends on the font, but occurs with many
fonts - ttf as well os otf. Whether it occurs or not seems to depend
on the relation between various vertical font metrics.

Michael

Am Mi., 20. Nov. 2019 um 17:29 Uhr schrieb Gregory Pittman <gpittman at iglou.com>:
>
> 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
>
>
> _______________________________________________
> scribus-dev mailing list
> scribus-dev at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AleAutoFixed-freetype-2.9.1.pdf
Type: application/pdf
Size: 12995 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20191125/a8f07641/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AleAutoFixed.sla
Type: application/vnd.scribus
Size: 16057 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20191125/a8f07641/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AleAutoFixed-freetype-2.10.0.pdf
Type: application/pdf
Size: 13016 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20191125/a8f07641/attachment-0003.pdf>


More information about the scribus-dev mailing list