SUSE / technical-reference-documentation

SUSE Technical Reference Documentation
https://documentation.suse.com/trd-supported.html
6 stars 20 forks source link

Making company logos work for HTML and PDF #69

Closed fsundermeyer closed 1 year ago

fsundermeyer commented 1 year ago

Hi,

we finally have found a fix for the logos in SBPs and TRDs appearing as tiny images in HTML or not at all in PDFs.

Since PDF and HTML stylesheet are handling widths differently, we just need to specify separate widths for HTML (152px) and PDF (5em):

<cover role="logos">
  <mediaobject>
    <imageobject role="fo">
     <imagedata fileref="suse.svg" width="5em" align="center" valign="bottom"/>
    </imageobject>
    <imageobject role="html">
     <imagedata fileref="suse.svg" width="152px" align="center" valign="bottom"/>
    </imageobject>
  </mediaobject>
</cover>

(NOTE: valign="bottom" is currently ignored and requires a stylesheet fix. I have included it anyway, so it gets automatically "activated" once the fix is implemented)

For the SBPs this is already merged and published. For the TRDs I have created a PR, see

I made the following changes:

Please review (and merge if you approve).

As a rule of thumb, logo images should have as little whitespace/padding as possible (preferrably none). However, they get scaled to a fixed width (152px/5em) and therefore may need to be adjusted to match the ratio of other logo displayed alongside. Use the SUSE logo as a reference. If the height/width ratio of a logo is similar to the SUSE logo, no modification is needed. If the ratio differs a lot, add transparent padding to the left right or top/bottom.

(sorry for a few additional lines of diff - I have configured my editor to remove whitespace at the end of a line)