hi,
As described in the title, how to reset fallbackfont?
I have created a number of Chinese typescripts and related fallbackfont (latin).
However, in the actual operation process,
I found that if you want to switch different fallbackfont,
you must change the bodyfont at the same time (\setupbodyfont).
The following is an example.
How should I reset and switch to fallbackfont without changing the bodyfont?
%%%%%%%
\definefontfeature[zh][mode=node,script=hang,lang=zhs]
\startsetups fallbacks:reset
\resetfontfallback[serifwhatever]
\resetfontfallback[serifboldwhatever]
\resetfontfallback[serifitalicwhatever]
\resetfontfallback[serifbolditalicwhatever]
\stopsetups
\startsetups fallback:lm
\definefontfallback[serifwhatever] [lmroman10-regular]
[0x0000-0x0400][force=yes]
\definefontfallback[serifboldwhatever] [lmroman10-bold]
[0x0000-0x0400][force=yes]
\definefontfallback[serifitalicwhatever] [lmroman10-italic]
[0x0000-0x0400][force=yes]
\definefontfallback[serifbolditalicwhatever][lmroman10-bolditalic][0x0000-0x0400][force=yes]
\stopsetups
\startsetups fallback:eb
\definefontfallback[serifwhatever] [ebgaramondregular]
[0x0000-0x0400][force=yes]
\definefontfallback[serifboldwhatever] [ebgaramondbold]
[0x0000-0x0400][force=yes]
\definefontfallback[serifitalicwhatever] [ebgaramonditalic]
[0x0000-0x0400][force=yes]
\definefontfallback[serifbolditalicwhatever][ebgaramondbolditalic][0x0000-0x0400][force=yes]
\stopsetups
\starttypescript [serif] [zhfont]
\definefontsynonym [Serif] [AdobeSongStd-Light]
[features=zh,fallbacks=serifwhatever]
\definefontsynonym [SerifBold]
[AdobeHeitiStd-Regular][features=zh,fallbacks=serifboldwhatever]
\definefontsynonym [SerifItalic]
[AdobeKaitiStd-Regular][features=zh,fallbacks=serifitalicwhatever]
\definefontsynonym
[SerifBoldItalic][AdobeHeitiStd-Regular][features=zh,fallbacks=serifbolditalicwhatever]
\stoptypescript
\starttypescript[myfont]
\definetypeface[myfont][rm][serif][zhfont]
\stoptypescript
\usetypescript[myfont]
\starttext
\setups{fallback:lm}
\setupbodyfont[myfont,rm,12pt]
fonts {\bf fonts} {\bi fonts} {\it fonts} % will be lm font
\\\the\font
\setups{fallbacks:reset}
\setups{fallback:eb}
fonts {\bf fonts} {\bi fonts} {\it fonts} % expected eb but lm
\\\the\font
\setups{fallbacks:reset}
\setups{fallback:eb}
\setupbodyfont[myfont,rm,12pt]%% any other chinese font, and change to eb
fonts {\bf fonts} {\bi fonts} {\it fonts}
\\\the\font
\stoptext
%%%%
best wishes,
autumnus
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________