HTML5 Canvas TextBaseline Top looks different in Firefox and chrome

后端 未结 1 1604
一向
一向 2021-02-14 00:15

In canvas, while setting textBaseline property to \'top\', its rendering differently in chrome and firefox. In chrome, there is a gap between line and the text where as there is

1条回答
  •  失恋的感觉
    2021-02-14 00:48

    I agree with the OP that this is an issue and it's peculiar to Firefox. Increasingly though, it seems that Firefox has adjusted the vertical offset overtime. It was once once about 4 pixels, then 3. Now, it is almost imperceptible. So, I agree with @Kaiido above. Use/set *object*.textBaseline="alphabetic"; I believe that this is consistent across browsers.

    0 讨论(0)
提交回复
热议问题