When using \X'string', if any of the characters in string have kerning pairs, the final text layout is affected. \Y does not have this issue. This may be more or less pronounced, depending on the font being used. For example, font "TexGyre Schola" has a kerning adjustment for the pair "et", meaning that \X'SetColor: ...' will affect the text positioning, if that particular font is active. The following example purposely uses characters which make the problem easier to notice:
.do xflag 3
.mediasize 100p 100p
.po 10p
.ll 40p
.\" example device control function with kerning pairs:
.ds T VAVA: WaWa
.\" PROBLEM:
\X'\*T'A \X'\*T'B \X'\*T'C\p
.\" OK:
\YTA \YTB \YTC\p
.
.\" verify \Z'string' is not affected by the fix:
.kern 0
VA Wa \" kern off: reference
.br
.kern 1
VA Wa \" kern on
.br
\Z'VA Wa' \" same result
.br
The example input includes the line \Z'VA Wa' to verify that the fix does not break kerning in zero width/height text. Maybe there are other cases which would need testing.
Thank you for reporting the issues you have found. Unfortunately I'm not even have the time to verify them. Would you like to prepare a pull request of your suggested fix? If no one complains I'd apply it.
When using
\X'string'
, if any of the characters instring
have kerning pairs, the final text layout is affected.\Y
does not have this issue. This may be more or less pronounced, depending on the font being used. For example, font "TexGyre Schola" has a kerning adjustment for the pair "et", meaning that\X'SetColor: ...'
will affect the text positioning, if that particular font is active. The following example purposely uses characters which make the problem easier to notice:The result can be seen in attached file kern_problem.pdf.
The following fix seems to solve this problem, hopefully without creating any new problems. In file
troff/troff.d/t6.c
, modify line 471:The result after the fix can be seen in attached file kern_problem_after_fix.pdf.
The example input includes the line
\Z'VA Wa'
to verify that the fix does not break kerning in zero width/height text. Maybe there are other cases which would need testing.