WICG / canvas-formatted-text

Other
82 stars 17 forks source link

Vertical Writing Modes in Canvas Formatted Text #4

Closed travisleithead closed 3 years ago

travisleithead commented 4 years ago

Copied (with discussion) from: https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/372

Text drawing needs to be aware of vertical writing mode to rotate glyphs in some fonts / languages while rendering a line.

The topic needs further investigation.

(Note existing text APIs in Canvas do not handle this scenario either--a solution would ideally be comprehensive.)


@Malvoz : /cc @bdon


@kojiishi :

Would it make sense for this to match what CSS renders, by making Canvas aware of writing-mode and text-orientation properties?


@travisleithead

I think finding a way to incorporate those properties into the input to this feature is likely the best way to achieve vertical writing mode.

Currently some values, e.g., "width", and "height" would need to be generalized to make sense in vertical writing modes. I like the idea of reusing some of the terminology in CSS Layout API to do this (as well as aligning on a few other concepts as well).

proYang commented 3 years ago

This is important for CJK characters. :fire: