Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 735 Bytes

File metadata and controls

14 lines (10 loc) · 735 Bytes

任务

构建一个LayoutTree

LayoutTree介绍

LayoutTree 负责布局和排版文本、Attachment等子元素。

LayoutTree 由 ElementTree生成,每个Element节点都会有对应的Layout节点,每个Layout节点的布局规则如下:

  • Block:块级元素,布局类似CSS中的 display: block,布局效果参考 CSSLayout.md 文件
  • InlineBlock:内联块级元素,布局类似CSS中的 display: inline-block,布局效果参考 CSSLayout.md 文件
  • Inline:内联元素,布局类似CSS中的 display: inline,布局效果参考 CSSLayout.md 文件
  • Text:文本元素,分词、排版需要使用 CoreText API,CoreText API使用可以参考 CoreText.md 文件
  • Attachment:自定义附件