metanorma / bipm-si-brochure

SI Brochure edition 9, semantic encoded version (WARNING: DRAFT)
3 stars 0 forks source link

PDF: Wrong fonts used when generated on GHA #188

Closed ronaldtse closed 1 year ago

ronaldtse commented 2 years ago

In the site artifact generated by https://github.com/metanorma/bipm-si-brochure/actions/runs/2997291371 , the fonts used for the SI Brochure generated through the collection command (English, French and bilingual) are wrong:

Screen Shot 2022-09-13 at 12 34 57 PM Screen Shot 2022-09-13 at 12 35 12 PM

However, the direct documents generated have correct fonts:

This file contains collection*.pdf and collection*.xml for debugging: Archive.zip

Intelligent2013 commented 2 years ago

@ronaldtse the parameter --font-manifest ... is missing in the command line for collection PDF processing:

java -Xss5m -Xmx2048m -jar /usr/local/bundle/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "collection/collection.presentation.xml" --xsl-file "/usr/local/bundle/gems/metanorma-bipm-2.1.7/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "collection/collection.pdf" --syntax-highlight  --split-by-language 

therefore mn2pdf puts default Noto fonts.

For instance, there is -font-manifest ... in the command line for usual documents:

java -Xss5m -Xmx2048m -jar /usr/local/bundle/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/__w/bipm-si-brochure/bipm-si-brochure/site/documents/si-brochure-en.presentation.xml" --xsl-file "/usr/local/bundle/gems/metanorma-bipm-2.1.7/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/__w/bipm-si-brochure/bipm-si-brochure/site/documents/si-brochure-en.pdf" --param baseassetpath="/__w/bipm-si-brochure/bipm-si-brochure/sources" --syntax-highlight  --font-manifest "/tmp/fontist_locations20220906-1233-wyxn8g.yml"

A 1.5 years ago, we've had the similar issue: https://github.com/metanorma/bipm-si-brochure/issues/108#issuecomment-816585382

@CAMOBAP could you check it? Thanks.

ronaldtse commented 2 years ago

Then this could be an issue with the new "collection" command. It must be failing to properly inherit those parameters like the "site generate" command. @abunashir can you please help here? This is important. Thanks.

ronaldtse commented 2 years ago

@abunashir is this fixed? Thanks!

abunashir commented 2 years ago

Nope, not yet. I am looking into it next!

abunashir commented 2 years ago

Hi @ronaldtse, I finally managed to drill down the issue. Looks like the font-mainfest was never being used for collection document, so even though we were trying to set it but the pdf generation was ignoring that. I have created two separate pull request, and once that is merged then this issue should be resolved. Here are pull request:

I've also tried to use this edge version here, and it seems to be working as expected :)

Screenshot 2022-11-06 at 15 05 50

//cc: @opoudjis, @CAMOBAP

abunashir commented 2 years ago

@ronaldtse: I assume we are done with this one, can we close this?

abunashir commented 1 year ago

Closing this one, but if there is anything else please feel free to reopen this one