Subpixel anti-aliased text on HTML5's canvas element

后端 未结 5 768
长发绾君心
长发绾君心 2020-12-02 14:31

I\'m a bit confused with the way the canvas element anti-aliases text and am hoping you all can help.

In the following screenshot the top \"Quick Brown Fox\" is an

5条回答
  •  青春惊慌失措
    2020-12-02 15:05

    It's now possible to get sub-pixel font rendering by creating an opaque canvas context. In Safari and Chrome you can get this using this snippet:

    var ctx = canvas.getContext("2d", {alpha: false})

    I found this from this blog post.

提交回复
热议问题