No. The text matrix, as its name says, affects only the text.
The entire drawing passes through the current transformation matrix, and only the text also passes through the text matrix. Thus, for anything that is not text, you need to change the CTM.
You can use the CGContextConcatCTM function to combine your flip matrix in CTM into one function call, although I would find that translation + scale is easier to read. Note that combining one matrix with another does not coincide with replacing the old matrix with the new one.
There is no function to replace CTM with another matrix in Core Graphics; you can only contact him. You can get CTM, invert it and concatenate the inverse matrix to the current matrix to return to the identity matrix; then, concatenating the desired matrix, we get the matrix, which is your desired matrix without any other influences. However, there is no reason to go to all these efforts.
source share