Kanzi 3.9.16
kanzi::ScriptAwareTextShaper Class Reference

Script-aware FreeType shaper. More...

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

Inheritance diagram for kanzi::ScriptAwareTextShaper:
[legend]

Public Member Functions

void cleanup () override
 Cleans up the data that this text shaper used for shaping a specific text run.
 
std::vector< TextLayouter::CharacterInfo > markBidiAndShape (const std::vector< char32_t > &text) override
 
void prepareLines (TextLayouter::IntermediateLayout *layout) override
 Prepares internal data structures after line breaking.
 
void reorderLine (TextLayouter::IntermediateLayout *layout, const TextLayouter::LineInfo &line) override
 Reorders the text line for text written right-to-left.
 
 ScriptAwareTextShaper (FontRuntimeSharedPtr primaryFont, FreeTypeFontEnginePlugin &plugin, ScriptFontResolverPtr formatResolver, ScriptFontResolverPtr globalResolver)
 
- Public Member Functions inherited from kanzi::FreeTypeTextShaper
 FreeTypeTextShaper (const FontRuntime &font)
 Constructor.
 
vector< TextLayouter::CharacterInfo > markBidiAndShape (const vector< char32_t > &unicodeText) override
 Use this function to:
 
vector< TextLayouter::CharacterInfo > markBidiAndShapeWithFonts (const vector< char32_t > &unicodeText, const vector< FontRuntimeSharedPtr > &fontAt)
 Same as markBidiAndShape, but each UTF-32 index may use a different RuntimeFont.
 
 ~FreeTypeTextShaper () override
 Destructor.
 
- 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.
 
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.
 
uint8_t getBaseBiDiLevel () const
 Gets the base bidi-level of the text.
 
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.
 
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.
 
void setBaseBiDiLevel (uint8_t baseBiDiLevel)
 Sets the base bidi-level of the text.
 
 TextShaper (const FontRuntime &font)
 Constructor.
 
virtual ~TextShaper ()
 Destructor.
 

Additional Inherited Members

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

Detailed Description

Script-aware FreeType shaper.

Same-font paragraphs use stock BiDi; mixed RuntimeFonts shape per span and emit visual order (skip reorderLine).

Constructor & Destructor Documentation

◆ ScriptAwareTextShaper()

kanzi::ScriptAwareTextShaper::ScriptAwareTextShaper ( FontRuntimeSharedPtr primaryFont,
FreeTypeFontEnginePlugin & plugin,
ScriptFontResolverPtr formatResolver,
ScriptFontResolverPtr globalResolver )

Member Function Documentation

◆ markBidiAndShape()

std::vector< TextLayouter::CharacterInfo > kanzi::ScriptAwareTextShaper::markBidiAndShape ( const std::vector< char32_t > & text)
override

◆ prepareLines()

void kanzi::ScriptAwareTextShaper::prepareLines ( TextLayouter::IntermediateLayout * layout)
overridevirtual

Prepares internal data structures after line breaking.

Parameters
layoutPointer to intermediate layout containing the text.

Reimplemented from kanzi::FreeTypeTextShaper.

◆ reorderLine()

void kanzi::ScriptAwareTextShaper::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::FreeTypeTextShaper.

◆ cleanup()

void kanzi::ScriptAwareTextShaper::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::FreeTypeTextShaper.


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