marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.85k stars 105 forks source link

Different styling in HTML and PDF #567

Closed johnny12150 closed 7 months ago

johnny12150 commented 7 months ago

Is it normal to have different styles in HTML and PDF?

HTML Outputs

image image

PDF Outputs

image image
yhatt commented 7 months ago

Yes, when the environments used for conversion are different, the fonts displayed in HTML and PDF may differ.

HTML uses the system fonts installed on the viewer's system to display slides. On the other hand, PDF uses the system fonts installed on the system used for conversion.

EXAMPLE: When using Marp CLI Docker image in Mac, the Mac's system fonts are used when displaying the output HTML. PDF generation is processed on the Docker image's Linux environment, so the system fonts pre-installed on Linux in the Docker image are used. When using Marp CLI installed on Mac, the fonts used for both HTML and PDF should match.

johnny12150 commented 7 months ago

Thanks for the detailed explanation, since it's a expected behavior, I will close this issue.