Skip to content

Writing Mode for Canvas text #11449

@schenney-chromium

Description

@schenney-chromium

What problem are you trying to solve?

Canvas text supports text direction and language for internationalization, but there is no way to render characters in the correct orientation for vertical writing modes. While the text string may be rotated using canvas transforms to get a vertical orientation, the characters within the string will not be oriented correctly.

What solutions exist today?

The only way to solve this today is to render each character separately, each one positioned vertically below the previous.

How would you solve it?

I think the simplest solution for web developers is to support the CSS writing modes, which is possibly easiest for browsers too. Someone on Stack Overflow claims that Firefox applies CSS writing mode to rendered text when the canvas element has such style. There's quite a bit of work to make this happen because the definition of origin, start, end, align etc all need to make sense with the various writing modes.

Anything else?

This issue came up in TAG review for Extended Text Metrics. I think we really need to solve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions