Closed onbigion13 closed 3 months ago
What do you mean? Any details?
Thanks for your replying, here I show the content I build.
Indeed, it's content is as below:
No matter Chinese or English, the content build are both messy.
Thank you for letting me know the actual book you are building. I built the book at my side and everything is fine at my side (see attached file and also the config file I appended to book.toml
), so I would say it's related to the missing Chinese fonts in your system (you will find similar results if you directly print from Chrome). I have also experienced such an issue in the CI, and this is how I solved this (by installing Chinese fonts such as fonts-wqy-microhei
or fonts-wqy-zenhei
) https://github.com/HollowMan6/mdbook-pdf/commit/d884679354c937e0aa4f0091024c93004031a893, hope this helps.
[output.pdf]
static_site_url = "https://nomicon.purewhite.io/"
[output.pdf-outline]
Thanks for your relying. I have installed the fonts you mentioned, While the compiled pdf still not display Chinese text. And there are 2 strange things I wanna share.
mdbook-typst、typst、argo 、mdbook-svgbob 、 mdbook-i18n-helpers 、i18n-report 、 mdbook-exerciser、mdbook-course.
And during this event, I met error that my Windows 10 OS lack font of "Helvetica", So I installed this fonts pack.
And then my Adobe Acrobat DC Pro cannot read the compiled pdf file anymore.
if you know anything conflicts among these packages or this font, please let me know.
It's ok if you have no more advice. Anyway, thanks for your replying.
Thanks for letting me know more details, it would be appreciated next time if you could post all the details in the beginning to save everyone's time.
Since you are using Windows instead of Linux, and it displays normally in open-source software, I don't think it's caused by the missing fonts, and there should be no conflicts for these packages you mentioned to build the Rust Book from Rust's official website, and Comprehensive Rust from google's repo.
Attached is the book built in Windows generated from CI https://github.com/HollowMan6/mdbook-pdf/actions/runs/9928368120, does that display normally in your Adobe Acrobat Pro?
It works fine on my side when I open it with Adobe Acrobat Pro. As it's closed-source software, I can't give you more suggestions but to upgrade its version.
Yes, the pdf file you built can display in Acrobat DC Pro.
And I can find some thing different. If I open the pdf file I built with Browser, the color density of fonts is lighter than that of fonts when I open the pdf you build with Acrobat.
the effect of the file I build in Edge Browser:
the effect of the file you build in Acrobat DC Pro:
I have searched lots of similar problem tonight. I think it's because of the fonts in the built pdf are not correctly embeded within it, or because of that my cargo environment is broken for reason that I install so many packages for build md docs with typst.
it's ok, you can end this issue. I think the eventual problems are that I carelessly delete some font necessary for building Chinese fonts, while I am not sure which are them, or my cargo environment is broken during installing those packages.
By the way, I find that the fonts embeded in pdf file are different.
My "not-normally-displayted" pdf 's fonts:
Your "normally-displayed" pdf's fonts:
And my former "normally-displayed" pdf's fonts:
They are build on the same md docs, which are from the same link, which you also used above.
I'm curious about which fonts are the default ones of "mdbook" and "mdbook-pdf"? Why different pdf files upon the same md docs have different embeded fonts inside? what kind of reasons or configurations of my OS will decide the fonts during building the mdbook pdf files? I will appreciate if you have any idea about this question.
It's decided by Chrome, we have no control of the fonts to be used in the document.
It's decided by Chrome, we have no control of the fonts to be used in the document.
If there both Chrome and edge in my OS,the font will always be decided by Chrome, right?
Yes, Chrome has priority over Edge.
I installed mdbook and mdbook-pdf, but after build the md docs, I found that the content in pdf file cannot be read.