\ifx equality of expanded fonts
Hi, I don't know whether this qualifies as a bug or not, and whether anything can or even should be done about it, but at least to me the following behaviour seems somewhat unexpected: \ifx\directlua\undefined\else \def\pdffontexpand#1autoexpand{\expandglyphsinfont#1} \fi \def\test#1#2{\relax0#1 expanded, 1#2 expanded: \ifx\0\1equal\else different\fi\par} \font\0=cmr10 \font\1=cmr10 \test{ not}{ not} \pdffontexpand\1 20 20 1 autoexpand \test{ not}{} \pdffontexpand\0 20 20 1 autoexpand \font\1=cmr10 \test{}{ not} \pdffontexpand\1 20 20 1 autoexpand \test{}{} \edef\x{\meaning\0} \edef\y{\meaning\1} meaning \ifx\x\y for both: \x\else different\fi \bye As you see, the font definitions are equal (in terms of \ifx) if the first font has not been expanded before the second one is defined, but are different if the first one has been expanded first (in both cases regardless of whether the second font is expanded or not). (The real-world example is this: https://tex.stackexchange.com/questions/633441/, where Spanish babel tests whether a small caps font exists by comparing it with the upright font, which gives a wrong result if the upright font has been expanded.) (Second parenthesis: with luatex, all of the above \ifx comparisons yield unequality, but that's of course outside the scope of this list.) Best regards, -- Robert
following behaviour seems somewhat unexpected: I agree it's somewhat unexpected. I also am unsure if anything could/should be done about it. https://tex.stackexchange.com/questions/633441/, where Spanish babel tests whether a small caps font exists by comparing it with the upright Evidently not a viable test method ... -k
On 2/23/2022 12:08 AM, Karl Berry wrote:
following behaviour seems somewhat unexpected:
I agree it's somewhat unexpected. I also am unsure if anything could/should be done about it.
https://tex.stackexchange.com/questions/633441/, where Spanish babel tests whether a small caps font exists by comparing it with the upright
Evidently not a viable test method ... -k
maybe use this instead \edef\x{\fontname\0} \edef\y{\fontname\1} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Karl Berry
-
Robert