TChunkedText

The TChunkedText A class that encapsulates a list of font formatted text 'chunks' (usually space seperated words) that greatly speeds up displaying word-wrapped text.

A good demonstration of the capabilities of TChunkedText is found in the Examples/Text sample application.

And here's an abbreviated example of its use from the Examples/FMX2 sample application:


  essay := TextResourceToString('ESSAY', RT_RCDATA, TEncoding.Unicode);
  essay := StringReplace(essay, '\n', #10, [rfReplaceAll]);  
  
  chunkedText := TChunkedText.Create(essay, regularFontCache);
  try
    chunkedText.DrawText(imgMain, displayRec, taJustify, tvaTop, 0);
  finally
    chunkedText.Free;
  end;
      

Reference

Methods Properties
Clear Chunk
Create Count
DrawText Text
GetChunkAndGlyphOffsetAtPt
GetPageMetrics
InsertTextChunk
SetText