Open tantek opened 3 years ago
Took a deep-dive into SVG text and CSS Houdini and came to several conclusions that I plan to address in a coming update:
CanvasRenderingContext2D
with new APIs that are just a different syntax for accomplishing what CSS can do today and will do in the future. (Plus implementation wise-we want to leverage the native CSS layout engine anyway.) It seems like we need to have better integration with CSS in a way that still allows the Canvas Formatted Text to operate in non-DOM environments, but not reinvent new syntax for all the things that CSS can do for inline level layout and formatting.Some potential positive outcomes from these proposed changes include:
With greater integration of CSS, the interaction layer between Canvas drawing state, where that state is overlapping or conflicting with CSS-specified values in the Canvas Formatted Text must be clearly and logically clarified. At present, we do not desire to continue adding more text-formatting properties that are redundant with CSS to the Canvas drawing state when they can be specified using the Canvas Formatted Text object, which offers a clearer path forward for aligning many other relevant CSS line-formatting features.
Hi @tantek. The CG met today to talk over the updated documents, including the Formatted Text Metrics proposal. I specifically called out some ways in which this feature can be harmonized with CSS Houdini and DOM in this section: https://github.com/WICG/canvas-formatted-text/blob/main/explainer-metrics.md#thinking-ahead-future-integration-into-dom-or-houdini-layout-api
High level feedback on Canvas Formatted Text: Please harmonize this work with the CSS Houdini effort. In addition you may want to take a look at some of the prior work in: SVG2 Chapter 11: Text.
(Originally published at: https://tantek.com/2020/290/b1/)