【 轉 】
Text Model 存儲文本以及相應屬性的模型,主要有兩種不同的實現策略:樹形結構和平面結構。樹形結構類似 Dom,可以很好的表現結構化文檔,但是比較復雜。平面結構相對簡單的多,大多數的編輯器(e.g. Emacs),字處理器(e.g. AbiWord, OpenOffice)都用的是平面結構。
Text Model Coords 用來在 Text Model 中定位的坐標系。對于樹形結構的 Text Model 其定位方式為節點鏈接(或指向節點的路徑 e.g. XPath)以及節點內偏移值。對于平面結構則僅僅是一個索引值。
Text Presentation 展示文本的模型,一般分別為 Block, Line, Run …
Text Presentation Coords 用來在 Text Presentation 中定位的坐標系,其值通常為 (x,y)。Text Editor 必須能夠在 Text Model Coords 和 Text Presentation Coords 之間變換。例如將鼠標點擊(x,y)對應到 Text Model 中的某個字符/元素。由 fp_Page::mapXYToPosition成員函數實現
FL_DocLayout 類:
page fmt_overview Formatter
??? FL_DocLayout is a formatted representation of a specific PD_Document,?
??? formatted for a specific GR_Graphics context.?
??? A %FL_DocLayout encapsulates two related hierarchies of objects.?
??? The?
logical
?(or content) hierarchy corresponds
??? to the logical structure of the document.
??????? - each FL_DocLayout contains a list of fl_SectionLayout objects
??????? - each fl_SectionLayout are composed of fl_BlockLayout objects
??? Where each fl_BlockLayout corresponds to a logical element in
??? the PD_Document (i.e., usually a paragraph of text).
??? The?
physical
?(or layout) hierarchy, by contrast,
??? encapsulates the subdivision of physical space into objects of
??? successively finer granularity.
??????? - each FL_DocLayout contains a list of fp_Page objects, each
????????? of which was constructed during the process of formatting
????????? the document
??????? - each fp_Page is a list of fp_Columns (fp_Column)
??????? - each fp_Column is a list of fp_Lines (fp_Line)
??????? - each fp_Line is a list of fp_Runs (fp_Run)
??? Where each fp_Run contains some fragment of content from the original?
??? document, usually text.?
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
