Kanzi  3.9.6
Kanzi Engine API
kanzi::FreeTypeTextShaper Class Reference

TextShaper implementation using these open source libraries: More...

#include <kanzi/plugins/freetype/freetype_text_shaper.hpp>

Inheritance diagram for kanzi::FreeTypeTextShaper:
[legend]

Public Member Functions

void cleanup () override
 Cleans up the data that this text shaper used for shaping a specific text run. More...
 
 FreeTypeTextShaper (const FontRuntime &font)
 Constructor. More...
 
vector< TextLayouter::CharacterInfomarkBidiAndShape (const vector< char32_t > &unicodeText) override
 Use this function to: More...
 
void prepareLines (TextLayouter::IntermediateLayout *layout) override
 Prepares internal data structures after line breaking. More...
 
void reorderLine (TextLayouter::IntermediateLayout *layout, const TextLayouter::LineInfo &line) override
 Reorders the text line for text written right-to-left. More...
 
 ~FreeTypeTextShaper () override
 Destructor. More...
 
- Public Member Functions inherited from kanzi::TextShaper
virtual void adjustPositions (TextLayouter::IntermediateLayout *layout, const TextLayouter::LineInfo &line) const
 This phase iterates through all layouted glyphs on the line and adjusts the positions based on shaping results. More...
 
virtual void appendTerminator (unsigned int newSize, const TextLayouter::IntermediateLayout *terminator, unsigned int terminatorPosition)
 Updates the internal shaper structures to accommodate a terminator string, which replaces a part of the original text. More...
 
uint8_t getBaseBiDiLevel () const
 Gets the base bidi-level of the text. More...
 
virtual void insertText (unsigned int location, const TextLayouter::IntermediateLayout *text)
 Updates the internal shaper structures to accommodate another string, which Kanzi inserts in the original text. More...
 
virtual void removeText (unsigned int location, unsigned int length)
 When Kanzi truncates a part of text, updates the internal shaper structures in accordance with the changes to the shaped text during the text layout. More...
 
void setBaseBiDiLevel (uint8_t baseBiDiLevel)
 Sets the base bidi-level of the text. More...
 
 TextShaper (const FontRuntime &font)
 Constructor. More...
 
virtual ~TextShaper ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from kanzi::TextShaper
FontFilegetFontFile (const FontRuntime &font) const
 Gets the font file that the passed font is currently using. More...
 
- Protected Attributes inherited from kanzi::TextShaper
uint8_t m_baseBiDiLevel
 The base bidi-level. More...
 
const FontRuntimem_font
 Font object used for shaping. More...
 

Detailed Description

TextShaper implementation using these open source libraries:

  • HarfBuzz for text shaping
  • libunibreak for line breaking
  • ICU for handling text containing a mixture of left-to-right and right-to-left data

Constructor & Destructor Documentation

◆ FreeTypeTextShaper()

kanzi::FreeTypeTextShaper::FreeTypeTextShaper ( const FontRuntime font)
explicit

Constructor.

Parameters
fontFont object used for shaping.

◆ ~FreeTypeTextShaper()

kanzi::FreeTypeTextShaper::~FreeTypeTextShaper ( )
override

Destructor.

Member Function Documentation

◆ markBidiAndShape()

vector<TextLayouter::CharacterInfo> kanzi::FreeTypeTextShaper::markBidiAndShape ( const vector< char32_t > &  unicodeText)
overridevirtual

Use this function to:

  • Create tags to indicate which parts of the text must be written left-to-right and which right-to-left.
  • Mirror specific character for text written right-to-left.
  • Shape text.
    Parameters
    unicodeTextText to shape and mirror.
    Returns
    Layouting information for each character.

Reimplemented from kanzi::TextShaper.

◆ prepareLines()

void kanzi::FreeTypeTextShaper::prepareLines ( TextLayouter::IntermediateLayout layout)
overridevirtual

Prepares internal data structures after line breaking.

Parameters
layoutPointer to intermediate layout containing the text.

Reimplemented from kanzi::TextShaper.

◆ reorderLine()

void kanzi::FreeTypeTextShaper::reorderLine ( TextLayouter::IntermediateLayout layout,
const TextLayouter::LineInfo line 
)
overridevirtual

Reorders the text line for text written right-to-left.

Parameters
layoutPointer to intermediate layout containing the text.
lineInformation defining the currently processed line.

Reimplemented from kanzi::TextShaper.

◆ cleanup()

void kanzi::FreeTypeTextShaper::cleanup ( )
overridevirtual

Cleans up the data that this text shaper used for shaping a specific text run.

You must call this function at the end of every text shaping run.

Reimplemented from kanzi::TextShaper.


The documentation for this class was generated from the following file: