当我们需要像上面那样进行乘法时,有时还需要加法。以编程方式我怎么能知道这一点。解析准确的位置?
这很简单,对于一个Td操作你always相乘,请参阅 ISO 32000-1 规范(ISO 32000-2 中类似):
For a freshly initialized (i.e. identity) text line matrix Tlm this matrix multiplication looks like replacing its bottom row with tx ty 1.
For a text line matrix Tlm with only changes in the bottom row against an identity this matrix multiplication looks like an addition to the bottom row, e.g. x y 1 becomes x+tx y+ty 1.
For a text line matrix Tlm like in your second example
a 0 0
0 a 0
x y 1
this matrix multiplication looks like a multiplication with a followed by an addition to the bottom row, i.e. x y 1 becomes x+a·tx y+a·ty 1. If the font size parameter of the preceding Tf operation was 1, then a would effectively be the resultant font size giving rise to your assumption the font size is part of the formula.
In general, for an arbitrary, non-degenerate text line matrix Tlm
a b 0
c d 0
x y 1
this matrix multiplication looks even more complex, x y 1 becomes x+a·tx+c·ty y+b·tx+d·ty 1.
因此,关于你的问题
以编程方式我怎么能知道这一点。解析准确的位置?
你的程序应该只是总是使用矩阵乘法并忽略它在单独坐标层面上的样子。
使第二个圆圈指令看起来只是替换的原因是先前的文本行矩阵是单位矩阵。但这并不是由于 François 假设的恢复状态操作,而是更简单地由于文本对象操作的开始BT:
由于文本矩阵和文本行矩阵在文本对象开始时被重置,并且图形状态无法在文本对象中保存或恢复,因此在这种情况下不能归咎于保存和恢复图形状态操作。
(屏幕截图来自 Adobe 共享的 ISO 32000-1 副本。)