Printing text on canvas ends up on different places in browser vs on Android

Hello, I am not sure where to ask the question. Maybe it is Cordova related rather than ionic related, I simply don’t know.

So, in my app I have a canvas element and I print to it using context.fillText(); It works fine, but the problem is that the text ends up on different Y coordinate on browsers and on my phone.

The Canvas height is 1200px and I print the text at 600 px on Y axis. In combination with context.textBaseLine set to 'middle', this should center the text vertically I guess. Well, it does, but only on the Android phone. In the browser, it is shifted very close to the top of the screen.

How come the text ends up so different on the phone and in browsers (I tried Firefox and Chrome)? Something to do with the textBaseline settings?


Just some additional info…
I had an opportunity to try more Android phones and the other phones have the same output as browsers. So the issue I have here seems to be with the old phone. It has Android 4.4