Calligra/Text Layout

From KDE Community Wiki

I thought I'd try to write some stuff up as I learn more about the text layout code. It's just a stub for now.

Text layout code in KOffice can be found in four different places:

  1. Qt Scribe
    • QTextDocument
    • QTextLine
    • QTextLayout
    • Et.c.
  2. KoText library
    • Code in libs/kotext/KoTextDocumentLayout.cpp.
    • Simple document layout.
    • Used by many KOffice apps.
    • Implements the QAbstractTextDocumentLayout interface from Qt.
    • Works with an underlying QTextDocument.
    • Depends on the text plugin for core work.
  3. KWord's layouter
    • Code in kword/part/frames/KWTextDocumentLayout.cpp.
    • More advanced document layout
    • Inherits the basic document layout in KoText.
    • Depends on the text plugin for core work.
    • Allows text to run around shapes.
    • Allows anchored shapes.
  4. Text plugin
    • Code in plugins/textshape/Layout.cpp.
    • Implements the KoTextDocumentLayout::LayoutState interface.
    • Does a lot of grunt layout work.