Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConTeXt template: support font fallback #9361

Merged
merged 4 commits into from Feb 3, 2024
Merged

Conversation

lawcho
Copy link
Contributor

@lawcho lawcho commented Jan 23, 2024

Follow up to #9204 (comment).

You write:

---
title: Demo Document
mainfontfallback:
  - EmojiOne Color
  - OpenSymbol
  - XITS Math
---

This empty set comes from OpenSymbol → ∅ ←

But these [stange operators](https://tex.stackexchange.com/a/397674)
aren't in OpenSymbol, so are fetched from XITS Math:

X × ⎰Y ⨿ Z⎱ → ⎰X × Y⎱ ⨿ ⎰X × Z⎱.

Emoji fallback doesn't work 🙁 .

You run:

pandoc src.md -o out.pdf --pdf-engine=context

You get:

Screenshot from 2024-01-23 17-19-38

Notes:

  • You don't need to set mainfont (unlike in the LaTeX template)
  • ConTeXt provdes two competing commands for fallback setup:
  • I couldn't get emoji fallback to work
    • NotoColorEmoji fails to load (with a loca table not foundmtx-context error)
    • EmojiOne Color loads but doesn't substitute anything
  • Testing ConTeXt with new fonts is fiddly
    • Must run mtxrun --script fonts --reload
  • More tests needed (cc @tarleb)

* Using the same YAML options as the LaTeX template
@tarleb
Copy link
Collaborator

tarleb commented Jan 25, 2024

Thanks for this. I tried it and didn't succeed in getting emojis working either, and it seems that this is not an easy issue to solve. Apart from that it seems to work really well.

You can avoid the test failures by using a template comment instead of a TeX comment (syntax: $-- comment text). LGTM once that's fixed.

@jgm
Copy link
Owner

jgm commented Jan 25, 2024

MANUAL.txt should be updated as well.

@lawcho
Copy link
Contributor Author

lawcho commented Jan 26, 2024

You can avoid the test failures by using a template comment instead of a TeX comment (syntax: $-- comment text).

I tried this (in 9384ac3), but the CI still fails.

Probably the comment isn't the root cause, since there are % Ordinary LaTeX comments nearby in the same file.

Could somebody else please fix this, I don't know what I'm doing with pandoc's CI.

@tarleb
Copy link
Collaborator

tarleb commented Jan 26, 2024

The error comes from the empty line that's added in the output. Removing line 72 should fix the test.

@jgm jgm merged commit 7164a23 into jgm:main Feb 3, 2024
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants