1

I am trying to write a ConTeXt document, and need to replace multiple blocks of missing fonts with other fonts. I am using the fallbacks key of \definefontsynonym to do so. However, none of the missing fonts is replaced. How does one specify multiple fallbacks in ConTeXt?

Here is a file that illustrates the problem:

\usetypescript
  [pagella]

%% Unicode block `Miscellaneous Technical', range 2300--23FF,
%% http://www.unicode.org/charts/PDF/U2300.pdf

\definefontfallback
  [BracketPieces]
  [XITSMath]
  [023B0,
   023B1]

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

\definefontfallback
  [SupplementalMathematicalOperators]
  [STIXGeneralRegular]
  [supplementalmathematicaloperators]

\definefontsynonym
  [Mono]
  [pagella]
  [fallbacks={BracketPieces,SupplementalMathematicalOperators}]

\enabletrackers
  [fonts.missing]

\setupbodyfont
  [pagella]

\starttext

\starttyping
Definition RightDistributivityTo (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 sans brackets and coproduct

All the characters ⎰ ⨿ ⎱ are missing from the output. The log file does not mention that the XITS and STIX fonts are being loaded.

However, if I use only one of the fallbacks, that fallback is used as expected. For example, if I replace

[fallbacks={BracketPieces,SupplementalMathematicalOperators}]

with

[fallbacks=BracketPieces]

then I get the following PDF output, which displays the characters ⎰ and ⎱, and the log file mentions that the XITS font is being loaded.

enter image description here

A similar thing happens when I load only the other fallback. I would appreciate any advice on how to use multiple font fallbacks in this context.

1

(I don't really understand the internals of font fallbacks. My answer is based on the type-imp-euler.mkiv typescript).

One option is to use a single name of the fallback. For example:

\definefontfallback[myfallbacks][XITSMath] [023B0, 023B1] 
\definefontfallback[myfallbacks][STIXGeneralRegular][supplementalmathematicaloperators]
\definefontsynonym [Mono] [pagella] [fallbacks=myfallbacks]
\setupbodyfont [pagella]

\enabletrackers [fonts.missing]

\starttext
\starttyping
Definition RightDistributivityTo (X Y Z : UU) :
  X × ⎰Y ⨿ Z⎱ → ⎰X × Y⎱ ⨿ ⎰X × Z⎱.
\stoptyping
\stoptext

which gives

enter image description here

  • Thank you, the answer works perfectly. The plural fallbacks is a bit misleading. All the examples I found in the sources use a single fallback. It was instructive to look at the file type-imp-euler.mkiv. Incidentally, what do the the check and force keys in \definefontfallback mean? – Raghu Oct 23 '17 at 17:02
  • Found this just now in font-col.mkiv.check : only replace when present in replacement font (default: no); % force : force replacent even when basefont has glyph (default: yes) – Raghu Oct 23 '17 at 17:42

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.