Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truncated long r-fit-text on pdf #3191

Merged
merged 1 commit into from
May 31, 2022

Conversation

chivongv
Copy link
Contributor

@chivongv chivongv commented Apr 10, 2022

What this PR does

This PR should fix #3120 by setting white-space to normal. White-space is being set to nowrap in css/layout.scss on line 22. Read about white-space here and compare between nowrap and normal option.

Minimal reproduce

Copy and paste the code below in index.html

<div class="reveal">
      <div class="slides">
        <section>
          <p>Add the <code>r-fit-text</code> class to auto-size text</p>
          <h1 class="r-fit-text">
            Very long first level heading text text text text text
          </h1>
          <p>Press <strong>ESC</strong> to enter the slide overview.</p>
          <p>
            Hold down the <strong>alt</strong> key (<strong>ctrl</strong> in
            Linux) and click on any element to zoom towards it using
            <a href="http://lab.hakim.se/zoom-js">zoom.js</a>. Click again to
            zoom back out.
          </p>
          <p>(NOTE: Use ctrl + click in Linux.)</p>
        </section>
      </div>
</div>

@hakimel hakimel merged commit a3f4caf into hakimel:master May 31, 2022
@hakimel
Copy link
Owner

hakimel commented May 31, 2022

Thanks for the PR.

I merged this, but as I was testing I noticed other cases where fit-text was overflowing in PDFs. I fixed those problems by invoking the fit-text script after all pages have been added to the DOM so it gets the right measurements. That fix also solved the issue in this PR so I ended up removing your change to the PDF styles.

Fitty—the library we're using to fit text—will automatically handle line wrapping in PDFs now that it works correctly.

@chivongv
Copy link
Contributor Author

Oh, I see. Fitty seems to be a better solution. Thanks for letting me know!

@chivongv chivongv deleted the fix-pdf-long-r-fit-text branch May 31, 2022 12:00
samwize pushed a commit to samwize/reveal.js that referenced this pull request Jun 9, 2022
* hakimel/master: (1422 commits)
  tweak slides mention
  fix issues with overflowing fit-text when exporting to pdf hakimel#3191 hakimel#3120
  Fix typo in plugin.js
  notes plugin only listens for same-origin postmessages to prevent xss
  new attempt at speaker view xss fix
  add support for 'data-background-gradient' hakimel#2510
  fix issue where auto-animate did not work when jumping three or more slides (i.e. longer than the view distance)
  made data-background attribute work with .webp hakimel#3200
  fix: truncated long r-fit-text on pdf
  update link
  fix issue with hakimel#3182 when slide numbers are disabled
  fix inconsistent fragment visibility in looping presentations hakimel#3123
  fix: pdf page numbering for fragment group
  always use css transforms for presentation scaling (zoom has too many quirks even if it is slightly sharper on ldpi displays)
  update lock file
  4.3.1
  notes plugin allows messsages from current/upcoming slide windows
  fix hakimel#3154
  fix vertical slide link in demo hakimel#3155
  dont run full build + tests for package task hakimel#3156
  ...
wchang22 pushed a commit to wchang22/reveal.js that referenced this pull request Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print PDF and class "r-fit-text"
2 participants