ken_20220210_Bug704925
tagged this
10 Feb 09:58
Bug #704925 "Illegal 'cm' inside text block gives incorrect result" Because the old PDF interpreter applies the text matrix, text line matrix, horizontal scaling and text rise at the time it encounters a 'BT' operator, a subsequent 'cm' will cause the result to be incorrect if any of these values are not the identity. This is because matrix algebra is not commutative, applying the multiplication in the wrong order will give the wrong result. This commit addresses this (illegal) case by detecting that a 'cm' is inside a text block, undoing the application of the text parameters then applying the CTM change, before re-applying the text parameters.