I am putting some text inside of a box by using the text() function and passing in the coordinates of the center of the box. I am also centering the text with textAlign(CENTER, CENTER) On windows, this produces the following result:
If I run the built artifact (I use intellij) on a raspberry pi with the java -jar command, it produces this result: (please don’t look at the upside down, that is not the point )
This happens when using the Prometo font, a font I import during setup. I am also using the textMode(SHAPE) command and the P2D renderer with the raspbian opengl fake KMS drivers enabled. Changing to non P2D and turning off shape mode does not solve the problem.
Scaling with scale(1, -1) and then translate(0, height) only makes the entire picture 180 degrees upside down, it does not affect the vertical alignment of the text in the rectangles.
I just tried with a different screen and the problem no longer happens. Very interesting
I was also noticing that my circles were slightly ‘squeezed’, they were shorter in Y than in X, this also does not happen with a different screen. It seems something is wrong in the Y axis with some of my screens. The screen that is having the Y issue is a official raspberry pi touchscreen connected trough the DSI connector, connecting it trough HDMI has the same issue. Connecting the raspberry to a normal HDMI monitor, the issue is gone
Would there be any way to debug why this happens so I can fix it? It needs to work with the other screen as well.