Skip to content

Commit

Permalink
chore: use Noto fonts in LaTeX tests (#48)
Browse files Browse the repository at this point in the history
Uses the [Noto family](https://fonts.google.com/noto) of fonts when rendering books in tests, reducing the number of missing character warnings
  • Loading branch information
max-heller authored Jan 6, 2024
1 parent f2c20f6 commit 1c41ec9
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 459 deletions.
11 changes: 2 additions & 9 deletions scripts/install-ci-deps
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,5 @@ export PATH="$PWD/pandoc-3.1.11/bin:$PATH"
# rsvg-convert (SVG support)
sudo apt-get install -y librsvg2-bin

# TeX Live
sudo apt-get install -y texlive texlive-luatex texlive-xetex texlive-fonts-extra fonts-font-awesome

# Source Code Pro font
wget -O source-code-pro.zip https://fonts.google.com/download?family=Source%20Code%20Pro
unzip -d source-code-pro source-code-pro.zip
rm source-code-pro.zip
mv source-code-pro /usr/share/fonts
fc-cache -fv
# TeX Live and fonts
sudo apt-get install -y texlive texlive-luatex texlive-xetex texlive-fonts-extra fonts-font-awesome fonts-noto
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ mod tests {
toc_depth: None,
variables: FromIterator::from_iter([
("documentclass".into(), "report".into()),
("monofont".into(), "Source Code Pro".into()),
("mainfont".into(), "Noto Serif".into()),
("sansfont".into(), "Noto Sans".into()),
("monofont".into(), "Noto Sans Mono".into()),
]),
rest: Default::default(),
}
Expand Down
5 changes: 2 additions & 3 deletions src/snapshots/mdbook_pandoc__tests__cargo_book.snap
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ expression: logs
WARN mdbook_pandoc::preprocess: Unable to normalize link '../../reference/attributes/codegen.html#the-target_feature-attribute' in chapter 'Appendix: Glossary': Unable to canonicalize path: $ROOT/src/appendix/../../reference/attributes/codegen.html: No such file or directory (os error 2)
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__commands__cargomd__option-cargo---offline'
on page 265 undefined on input line 19222.
on page 277 undefined on input line 19224.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__commands__cargo-buildmd__option-cargo-build---keep-going'
on page 269 undefined on input line 19459.
on page 281 undefined on input line 19461.
[WARNING] [makePDF] LaTeX Warning: There were undefined references.
[WARNING] Missing character: There is no Ι‘ (U+0251) (U+0251) in font [lmroman10-regular]:+tlig;!
INFO mdbook_pandoc::pandoc::renderer: Wrote output to book/pdf/book.pdf

9 changes: 3 additions & 6 deletions src/snapshots/mdbook_pandoc__tests__nomicon.snap
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@ expression: logs
WARN mdbook_pandoc::preprocess: Unable to normalize link '../std/panic/fn.catch_unwind.html' in chapter 'FFI': Unable to canonicalize path: $ROOT/src/../std/panic/fn.catch_unwind.html: No such file or directory (os error 2)
WARN mdbook_pandoc::preprocess: Unable to normalize link '../std/panic/fn.catch_unwind.html' in chapter 'FFI': Unable to canonicalize path: $ROOT/src/../std/panic/fn.catch_unwind.html: No such file or directory (os error 2)
WARN mdbook_pandoc::preprocess: Unable to normalize link '../core/panic/struct.PanicInfo.html' in chapter '#[panic_handler]': Unable to canonicalize path: $ROOT/src/../core/panic/struct.PanicInfo.html: No such file or directory (os error 2)
[WARNING] Missing character: There is no πŸ™€ (U+1F640) (U+1F640) in font [lmroman10-regular]:+tlig;
[WARNING] Missing character: There is no β€’ (U+2012) (U+2012) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no Ӛ (U+04DA) (U+04DA) in font SourceCodePro/I:mode=node;scr
[WARNING] Missing character: There is no 😿 (U+1F63F) (U+1F63F) in font SourceCodePro/I:mode=node;
[WARNING] Missing character: There is no 😿 (U+1F63F) (U+1F63F) in font SourceCodePro/I:mode=node;
[WARNING] Missing character: There is no β€’ (U+2012) (U+2012) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no πŸ™€ (U+1F640) (U+1F640) in font NotoSerif:mode=node;script
[WARNING] Missing character: There is no 😿 (U+1F63F) (U+1F63F) in font NotoSansMono:mode=node;scr
[WARNING] Missing character: There is no 😿 (U+1F63F) (U+1F63F) in font NotoSansMono:mode=node;scr
INFO mdbook_pandoc::pandoc::renderer: Wrote output to book/pdf/book.pdf

350 changes: 155 additions & 195 deletions src/snapshots/mdbook_pandoc__tests__rust_book.snap

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/snapshots/mdbook_pandoc__tests__rust_by_example.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ expression: logs
---
INFO mdbook::book: Running the pandoc backend
WARN mdbook_pandoc::preprocess: Unable to normalize link '../../reference/inline-assembly.html#abi-clobbers' in chapter 'Inline assembly': Unable to canonicalize path: $ROOT/src/unsafe/../../reference/inline-assembly.html: No such file or directory (os error 2)
[WARNING] Missing character: There is no πŸ›ˆ (U+1F6C8) (U+1F6C8) in font [lmroman10-regular]:+tlig;
[WARNING] Missing character: There is no πŸ›ˆ (U+1F6C8) (U+1F6C8) in font [lmroman10-regular]:+tlig;
[WARNING] Missing character: There is no γ‚ˆ (U+3088) (U+3088) in font SourceCodePro/I:mode=node;sc
[WARNING] Missing character: There is no う (U+3046) (U+3046) in font SourceCodePro/I:mode=node;sc
[WARNING] Missing character: There is no こ (U+3053) (U+3053) in font SourceCodePro/I:mode=node;sc
[WARNING] Missing character: There is no そ (U+305D) (U+305D) in font SourceCodePro/I:mode=node;sc
[WARNING] Missing character: There is no πŸ›ˆ (U+1F6C8) (U+1F6C8) in font NotoSerif:mode=node;script
[WARNING] Missing character: There is no πŸ›ˆ (U+1F6C8) (U+1F6C8) in font NotoSerif:mode=node;script
[WARNING] Missing character: There is no γ‚ˆ (U+3088) (U+3088) in font NotoSansMono:mode=node;scrip
[WARNING] Missing character: There is no う (U+3046) (U+3046) in font NotoSansMono:mode=node;scrip
[WARNING] Missing character: There is no こ (U+3053) (U+3053) in font NotoSansMono:mode=node;scrip
[WARNING] Missing character: There is no そ (U+305D) (U+305D) in font NotoSansMono:mode=node;scrip
INFO mdbook_pandoc::pandoc::renderer: Wrote output to book/pdf/book.pdf

42 changes: 21 additions & 21 deletions src/snapshots/mdbook_pandoc__tests__rust_embedded.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ expression: logs
INFO mdbook::book: Running the pandoc backend
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__namingmd__c-crate-name'
on page 95 undefined on input line 5763.
on page 97 undefined on input line 5765.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__interoperabilitymd__c-free'
on page 95 undefined on input line 5773.
on page 97 undefined on input line 5775.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__interoperabilitymd__c-reexport-pac'
on page 95 undefined on input line 5776.
on page 97 undefined on input line 5778.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__interoperabilitymd__c-hal-traits'
on page 95 undefined on input line 5779.
on page 97 undefined on input line 5781.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__predictabilitymd__c-ctor'
on page 95 undefined on input line 5789.
on page 97 undefined on input line 5791.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__gpiomd__c-zst-pin' on
page 95 undefined on input line 5799.
page 97 undefined on input line 5801.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__gpiomd__c-erased-pin'
on page 95 undefined on input line 5802.
on page 98 undefined on input line 5804.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__design-patterns__hal__gpiomd__c-pin-state'
on page 95 undefined on input line 5805.
on page 98 undefined on input line 5807.
[WARNING] [makePDF] LaTeX Warning: There were undefined references.
[WARNING] Missing character: There is no πŸ¦€ (U+1F980) (U+1F980) in font [lmroman10-regular]:+tlig;
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font [lmroman10-regular]:+tlig;!
[WARNING] Missing character: There is no πŸ¦€ (U+1F980) (U+1F980) in font NotoSerif:mode=node;script
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no βœ“ (U+2713) (U+2713) in font NotoSerif:mode=node;script=l
[WARNING] Missing character: There is no ✘ (U+2718) (U+2718) in font NotoSerif:mode=node;script=l
INFO mdbook_pandoc::pandoc::renderer: Wrote output to book/pdf/book.pdf

Loading

0 comments on commit 1c41ec9

Please sign in to comment.