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

Different font size between "serve" and "pdf" commands #64

Open
HarryPommier opened this issue Feb 1, 2021 · 10 comments
Open

Different font size between "serve" and "pdf" commands #64

HarryPommier opened this issue Feb 1, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@HarryPommier
Copy link

The font size is different between the slides generated with "sensei serve" and the slides generated with "sensei pdf"
This may cause layout errors.

With "serve":
sensei_serve

With "pdf"
sensei_pdf

@HarryPommier HarryPommier added the bug Something isn't working label Feb 1, 2021
@zigarn
Copy link
Contributor

zigarn commented Mar 21, 2021

Wouldn't it be more an issue of font? Like depending on the build process it's using different alternatives of fonts (between CSS declared fonts, fonts available in container and fonts available on system in browser and in PDF)

@zigarn
Copy link
Contributor

zigarn commented Jul 21, 2021

When checking the font actually used through the font info of the inspect tool of Firefox:

  • Web view:
    image
  • Firefox PDF viewer:
    image
    • H2: DejaVu Sans (font-family: sans-serif;)
    • text: DejaVu Sans (font-family: sans-serif;)
    • code: DejaVu Sans Mono (font-family: monospace;)

Result in evince:
image
Result in Chrome PDF viewer:
image
Result in GIMP:
image

Rendering is coherent in PDF viewers.

If I change the font declaration in sensei to use DejaVu Sans (Mono), or remove the declaration of @font-face, the rendering becomes the same in Firefox than on PDF viewers.
Looks like CSS-declared fonts are lost during the PDF printing process...

@hgwood
Copy link
Member

hgwood commented Jul 22, 2021

All the screenshot look exactly the same to me :)

@hgwood
Copy link
Member

hgwood commented Jul 22, 2021

The original issue is about the font size being different: the word "sound" on the first bullet point is on the first line in the web view, and on the second line in the pdf. Might also not be a font size issue but a slide size issue.

@hgwood
Copy link
Member

hgwood commented Jul 22, 2021

@HarryPommier could you try reproducing the issue using the latest version of sensei?

@zigarn
Copy link
Contributor

zigarn commented Jul 22, 2021

@hgwood If you look closely, the boldness of the title is different between web view and PDF.
Also in code bloc we can see that the first line is splitted in two lines in web view but not in PDF.
So there is a difference of rendering between web and PDF.

@hgwood
Copy link
Member

hgwood commented Jul 22, 2021

Right, sorry!

@zigarn
Copy link
Contributor

zigarn commented Jul 22, 2021

When launching decktape with option --screenshot, which is doing a screenshot from pupeeter page object, the screenshot result is the same as in the PDF viewers.

@zigarn
Copy link
Contributor

zigarn commented Jul 22, 2021

Also I suspect some of the effects are from image sizing and placement, which can be subtly different in PDF than in browser.
But I think most of this issue is due to PDF printing process of decktape, and won't be easy to debug and fix...

@zigarn
Copy link
Contributor

zigarn commented Sep 7, 2021

Useful reading abour PDF, fonts and reader interpretation: https://linuxfr.org/users/pied/journaux/pdf-mais-que-fait-la-police

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants