Sketch a DOM-free API for laying out and painting text
Rather than using the DOM to upload text and styling information into the engine, this patch begins sketching a more direct API that bypasses the DOM and CSS. Currently, this API doesn't do anything, but it's a first step. The approach is to have a ParagraphBuilder object that can record a tree of style interior nodes and text leaves. The build() function then applies container-level styling information (such as TextAlign) and returns a Paragraph object that can undergo layout and paint. The inputs to the builder process are immutable style objects constructed from primitive values. These primitives are currently carbon-copies of the primitive we use in the framework today. After this patch lands, I'll convert the frame to re-expose these values instead of re-defining them.
Showing
sky/engine/core/text/FontStyle.h
0 → 100644
sky/engine/core/text/FontWeight.h
0 → 100644
sky/engine/core/text/Paragraph.h
0 → 100644
sky/engine/core/text/TextAlign.h
0 → 100644
sky/engine/core/text/TextStyle.h
0 → 100644
想要评论请 注册 或 登录