[dev-context] \doiftext and fallback fonts

Hans Hagen j.hagen at xs4all.nl
Tue Oct 8 10:54:57 CEST 2019


On 10/7/2019 11:24 PM, Wolfgang Schuster wrote:
> Hi Hans,
> 
> the \doiftext(else) command gives a wrong result when the checked 
> character comes from a fallback font.
> 
> 
> \definefontfallback [testfallback] [file:dejavuserif] [greekandcoptic]
> 
> \definefontsynonym [FallbackTest] [file:lmroman10-regular] 
> [fallbacks=testfallback]
> 
> \starttext
> 
> \definedfont[FallbackTest]
> 
> a α % does the fallback work?
> 
> \doiftextelse{a}{YES}{NO}
> 
> \doiftextelse{α}{YES}{NO}
> 
> \stoptext
> 
> 
> As a result of this mechanism which use this check like the number 
> renderer in the section command produce wrong output (missing number in 
> the section title).
> 
> 
> \setuphead [section] [conversion=g]
> 
> \definefallbackfamily [mainface] [rm] [DejaVu Serif] [range=greekandcoptic]
> 
> \definefontfamily [mainface] [rm] [Latin Modern Roman]
> \definefontfamily [mainface] [mm] [Latin Modern Math]
> 
> \setupbodyfont [mainface]
> 
> \starttext
> 
> \placecontent
> 
> \section{wow}
> 
> \stoptext
ok, so we need

    \setbox\scratchbox\hbox % no \hpack because we can have fallbacks

in the checkers

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the dev-context mailing list