Menu

fontsize for rendering <footnote> in PDF

2017-06-02
2017-06-02
  • Stefan Quandt

    Stefan Quandt - 2017-06-02

    Hi,
    I just noticed that in daps PDF output built from DocBook5 sources the font size used for rendering <footnote> elements increased dramatically (its now bigger than any heading).
    Fortunately I had some old .fo files around in the build/.tmp directory on my production machine and found that the <fo:footnote-body> elements in FO files for unknown reason changed from
    <fo:footnote-body font-family="'Open Sans', OpenSans, sans-serif,'FreeSerif', serif" font-size="9pt" ...
    to
    <fo:footnote-body font-family="'Open Sans', OpenSans, sans-serif,'FreeSerif', serif" font-size="21.984pt"...

    My build system runs on openSUSE Leap and it makes no difference if i have daps 2.3.0 package, daps 2.4.0 package or daps built from git sources installed.
    My /etc/daps has not been touched for a long time
    What could be the cause for this problem?

     
  • Frank Sundermeyer

    Which stylesheets are you using? (Will be visible when running DAPS with "-vv")

    I assume this is not a DAPS problem but caused by a change in the fo-stylesheets.

     
  • Stefan Quandt

    Stefan Quandt - 2017-06-02

    I use the suse-xsl stylesheets from git with several minor customizations to e.g. to
    parameters body.font, body.font.family, booktitlepage.url, company.address and changes in colors.ent regarding FO (and several parameters in the XHTML stylesheets and style.css).

    • If I revert all these customizations (and build and install the stylesheets) or
    • if I install the suse-xsl stylesheets package from openSUSE LEAP (currently 2.7.0.2)
      footnotes in generated PDF are still too big.

    Running DAPS with "-vv" yields
    STYLEROOT: /usr/share/xml/docbook/stylesheet/daps2013
    STYLEROOT_VERS: '2.0.7.2'
    FALLBACK_STYLEROOT: /usr/share/xml/docbook/stylesheet/nwalsh5/1.78.1
    FB_STYLEROOT_VERS: Not available

     
    • Thomas Schraitle

      Thanks Stefan for your report!

      Currently, the SUSE documentation doesn't use footnotes at all. As such, we haven't customize it. This is why you see these strange result.

      Nevertheless, I've found the cause of this font size problem and opened a pull request on Github, see https://github.com/openSUSE/suse-xsl/pull/313 (can add you as reviewer, if you are available on Github) :)

      If you like, you can test it with the following commands. First you need to clone the stylesheet repo:

      $ cd /tmp/$USER
      $ git clone git@github.com:openSUSE/suse-xsl.git && cd suse-xsl
      $ git checkout feature/footnotes
      $ make
      

      After that, you can

      $ cd YOUR_PROJECT_DIR
      $ daps --styleroot="/tmp/$USER/build/stylesheet/suse2013-ns/" -vv -d DC-YOUR_PROJECT pdf
      

      You will probably observe other issues, but at least, it's a start. Hope this helps. :)

       
      • Stefan Quandt

        Stefan Quandt - 2017-06-02

        If you like, you can test it with the following commands.

        I can confirm that the PDF footnote scaling issue is resolved on branch feature/footnotes.
        Thanks for this extraordinary quick resolution!

        Currently, the SUSE documentation doesn't use footnotes at all.
        As such, we haven't customize it.

        This makes me wonder about the scope of the daps project and not for the first time.
        Obviously the Docbook <footnote> element has been well supported by the suse and daps stylesheets for ages.
        But then there seems to be no test case for it.
        Other DocBook elements are not supported at all by daps.

        It would be very helpful for any user considering to use daps2, if the project page would give an overview of which DocBook5 elements are currently supported by which stylesheets and output formats and a roadmap which DocBook elements are planned for the future.

         
        • Thomas Schraitle

          Thanks for this extraordinary quick resolution!

          You're welcome! :) See my other message about the fixed issues.
          The feature/footnotes branch has been merged into develop now. If you want to test our full fix, use the develop branch.

          But then there seems to be no test case for it.

          Yes. Testing is a difficult matter. Currently we don't have a really good solution for that...

          Other DocBook elements are not supported at all by daps.

          It's a matter of the stylesheets not DAPS.

          It would be very helpful for any user considering to use daps2, if the project page would give an overview of which DocBook5 elements are currently supported by which stylesheets and output formats and a roadmap which DocBook elements are planned for the future.

          Well, currently our official SUSE documentation follows the Geekodoc schema (see https://github.com/openSUSE/geekodoc). It's a subset of the DocBook 5 schema. For example, we don't allow block elements (like example, table, ...) inside para tags. Or we disabled footnotes (as you've observed already). Or we use only some admonition elements.

          This is done mostly because of a) to reduce the complexity of DocBook, b) focus on elements which we use, and c) improve maintainability of our stylesheets.

          Everything what Geekodoc supports should also be supported by our SUSE stylesheets. I agree, this should be better documented.

          We don't have a roadmap as we consider Geekodoc "stable" for the time being. "Stable" in this context means, we don't plan to add any additional elements. Maybe we add additional elements in the future, but this is done more on a case-by-case basis, not through roadmaps.

          Hope this helps to clarify things. :-)

           
        • Stefan Knorr

          Stefan Knorr - 2017-06-02

          This makes me wonder about the scope of the daps project and not for the first time.

          Hm, so first: please differentiate between DAPS and the SUSE stylesheets. Those are separate projects, if somewhat interwoven. Most of the issues you name here seem to squarely fall into stylesheet territory.

          Anyway, both DAPS and stylesheet development is currently very much driven by internal needs. I realize that this does make it harder for you to work with them. On the other hand, it is all open-source and open for contribution (and not just in terms of patches -- design ideas, bug reports, etc. are welcome too -- though patches probably are the surefirest path to making a change happen.)

          But then there seems to be no test case for it.

          Testing the stylesheets is definitely on our horizon, but admittedly, we're not doing great in that regard right now.
          In the beginning of this year, Sven & I started on these test cases and this test runner tool. What we are trying to do here is this: get one set of "before" images, do a change to the stylesheets, get a set of "after" images, and make sure that only relevant things changed.

          The tool still has some issues with generating the right things at the right time, and the test cases are not very complete yet. Hence, I am only occasionally running those test by hand right now.

          You are very welcome to contribute to either. Especially the test cases are not hard to work on since it's all just DocBook.

          It would be very helpful for any user considering to use daps2, if the project page would give an overview of which DocBook5 elements are currently supported by which stylesheets and output formats and a roadmap which DocBook elements are planned for the future.

          For the support table, please open an issue at https://github.com/openSUSE/suse-xsl/issues/new .
          However, I don't know when we'll get to that. Then again, with some support, this might be a good beginner task, so might not be that hard to find someone who can write this up. :)

          I don't think there is going to be much in terms of a roadmap. We do know that we want support for e.g. <task/> and <stepalternatives/> but a roadmap with implementation dates is probably not going to come about any time soon. None of us is working on DAPS or the stylesheets full time.

           

          Last edit: Stefan Knorr 2017-06-02
  • Stefan Quandt

    Stefan Quandt - 2017-06-02

    I just noticed that the footnotes are not only too big, they are also lacking the number on the left (while the in-text foonote reference number is present).
    On the other hand, when generating HTML everything is fine with the footnote.

     
    • Thomas Schraitle

      This should be fixed with the latest commit in the above pull request. The other Stefan is currently reviewing it. ;-)

       
  • Stefan Quandt

    Stefan Quandt - 2017-06-02

    if I install the older version 2.0.6.3 of the suse-xsl stylesheets package from openSUSE LEAP then everything is fine.
    Interestingly, upgrading to suse-xsl-2.7.0.2 requires upgrading of package liberation-fonts to liberation2-fonts. Could this cause some font selection incompability?
    Anyhow, I'd assume that this problem will be reproducible on any openSUSE box with suse-xsl-2.7.0.2 by generating PDF from a simple DocBook5 document with a <footnote> element.

     
  • Stefan Knorr

    Stefan Knorr - 2017-06-02

    On the other hand, when generating HTML everything is fine with the footnote.

    Yeah, HTML is totally different code than FO/PDF.

    Interestingly, upgrading to suse-xsl-2.7.0.2 requires upgrading of package liberation-fonts to liberation2-fonts. Could this cause some font selection incompability?

    It should not. We mostly did this because the old liberation-fonts package was being dropped and we were one of the last packages still depending on it. I think on older (supported SLE/openSUSE) distributions we're also still using the old liberation-fonts package.

    Anyway, I did a bunch of changes to text scaliing in https://github.com/openSUSE/suse-xsl/commit/312b8d6a9234fa5574988435348eb5186336244c . The footnote thing must have slipped through...

     
  • Thomas Schraitle

    Stefan, your issue has been fixed now. \o/ :-)

    You can see the result here: https://github.com/openSUSE/suse-xsl/issues/314#issuecomment-305790204

    Let us know if it works for you.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.