← Back to release summary

Canvas text writing mode support

Category
Graphics
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Writing mode support for HTML canvas text will enable correct text shaping for vertical text, as already supported by CSS. Canvas text styles gain a "writingMode" attribute along with a "textOrientation" attribute that have the same effect on a text run as the related CSS properties. The various alignment attributes are augmented to support vertically oriented text. The CSS properties from the canvas element style are ignored.

Motivation

Canvas text styles do not provide any direct control over the writing mode and character orientation, and browsers are inconsistent with how they treat the CSS properties on the canvas element. The workaround is to render and position each character separately, which may require a JS implementation of text shaping.

Standards & signals

Ecosystem

Explainers: https://github.com/schenney-chromium/explainers/blob/canvas-writing-mode/canvas-writing-mode/README.md

View on chromestatus.com