2

I am writing some notes using ConTeXt, with the Palatino font. The notes include verbatim Coq code containing Unicode characters. The problem is that some of these characters don't show up in the PDF output. How does one substitute missing characters in ConTeXt?

Here is a file that illustrates the problem:

\usetypescript
  [pagella]

\setupbodyfont
  [pagella]

\enabletrackers
  [fonts.missing]

\starttext

Here is some code from {\tt https://github.com/UniMath/UniMath/blob/master/UniMath/Foundations/PartA.v}:

\starttyping
Definition rdistrtocoprod (X Y Z : UU) :
  X × (Y ⨿ Z) → (X × Y) ⨿ (X × Z).
\stoptyping

\stoptext

Here is the relevant part of the output of the command context file.tex:

PDF output with missing fonts

The character ⨿ is missing at both the places in the output that correspond to its occurrences in the ConTeXt input. The log file says:

fonts > checking > char ⨿ (U+02A3F) in font 'LMMono10-Regular' with id 5: missing
  • For testing purpose, could you point out a font that contains the symbol. – Aditya Oct 22 '17 at 14:03
  • If I replace "pagella" with "stix" in the example file, the missing character appears correctly in the PDF output. However, then the verbatim code is in the main proportional font, whereas I would like it to be in a monospaced font. Also, in case it is relevant, I am able to type the character in Emacs, which displays it with the Free Symbola font. – Raghu Oct 22 '17 at 15:08
  • @Aditya I have replied to your comment. I didn't realize I have to prefix my response with "at-name" to send a notification. Thanks. – Raghu Oct 22 '17 at 15:25
2

Thanks to Aditya's comment above, I found that the STIX font has the missing character, and is recognised by ConTeXt. The following file now produces PDF output in which the missing character is replaced from the STIX font.

\usetypescript
  [pagella]

%% Unicode block `Supplemental Mathematical Operators', range
%% 2A00--2AFF, http://unicode.org/charts/PDF/Unicode-3.2/U32-2A00.pdf.

\definefontfallback
  [SupplementalMathematicalOperators]
  [STIXGeneralRegular]
  [supplementalmathematicaloperators]

\definefontsynonym
  [Mono]
  [pagella]
  [fallbacks=SupplementalMathematicalOperators]

\enabletrackers
  [fonts.missing]

\setupbodyfont
  [pagella]

\starttext

Here is some code from {\tt https://github.com/UniMath/UniMath/blob/master/UniMath/Foundations/PartA.v}:

\starttyping
Definition rdistrtocoprod (X Y Z : UU) :
  X × (Y ⨿ Z) → (X × Y) ⨿ (X × Z).
\stoptyping

\stoptext

Here is the relevant part of the output of the command context file.tex:

enter image description here

The character ⨿ is no longer missing in the output. The log file does not report any missing fonts, and says:

system > 14: filename=/usr/share/fonts/opentype/stix/STIXGeneral-Regular.otf

so context appears to take the missing font from the OS.

@Aditya Thanks for your comment.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.