slidev
slidev copied to clipboard
Some formatting is lost when exporting a presentation to `.pdf`
Describe the bug
Some formatting is lost when exporting a presentation with theme-apple-basic
to .pdf
:
The public slide show opens the first slide like this:
But the exported presentation's first slide looks like this:
The second slide should look like this:
But it looks like this in the exported file:
Something is going on with font weights, bold formatting and letter spacing.
I guess this issue belongs here, but it could also go under themes
.
To reproduce Steps to reproduce the behavior:
- Clone this repo
-
git checkout dev_main
-
git checkout 80ddf676
-
cd presentation
-
slidev export
(orslidev export --dark
, doesn't matter) - This file is created without any errors
Desktop
- OS: macOS
14.4.1
- Browser: Safari
17.4.1
- Slidev version:
0.48.8
It seems that the font "Helvetica Neue"
isn't loaded in the public slide show, but loaded in the export mode. On my Windows machine, both two ways load "Helvetica Neue"
correctly.
The font-family of the text is "Helvetica Neue",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"
Everything works fine on my Mac machine
It seems that the font
"Helvetica Neue"
isn't loaded in the public slide show, but loaded in the export mode.
@KermanX I don't think so. I would guess that the public slide show uses Helvetica Neue Bold (correctly) and the export uses Helvetica Neue Regular (incorrectly) with the font weight increased. (I would rule out the fallback to ui-sans-serif
or system-ui
, which would be SF Pro Display or SF Pro Text in my case.) See the comparison below:
When using slidev v0.49.0-beta.1
, the macOS versions of Chrome (123.0.6312.124
) and Microsoft Edge (123.0.2420.81
) also display the public slide show the same way (incorrectly) as the exported one looks like.
Everything works fine on my Mac machine
@kamuiiiii @KermanX I could reproduce this on a MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports; macOS 14.4.1
) different from mine (14-inch, 2021) right now, following the instructions in the issue description and with a fresh install of the latest version of everything (brew
, npm
, slidev
(global), theme-apple-basic
and playwright-chromium
). It gives the same .pdf
output.
How about using the ----executable-path
option?
@KermanX I've tried providing the executable of Chrome 126.0.6478.62
and Edge 126.0.2592.61
but unfortunately none of these helped. Neither --timeout 60000
nor --wait 10000
(with any browser–argument(s) combination).
I think the main issue is that Chrome and Edge uses the wrong variant (Regular) of the theme font while Safari uses the correct one (Bold).