IPdfHyphenator Interface

Finds the positions where a word can be hyphenated, for the text boxes and the tables of the content builder.

public interface IPdfHyphenator

Remarks

The content builder calls the hyphenator for the word that does not fit at the end of a line, and breaks the word at the last position where the line, ended by a hyphen, fits. PdfPatternHyphenator uses the hyphenation patterns of a language; implement the interface to use another source, such as a dictionary.

The soft hyphens (U+00AD) of a text are break opportunities without a hyphenator.

Methods

NameDescription
Hyphenate(ReadOnlySpan<char>, Span<int>)Finds the positions where a word can be hyphenated.

Hyphenate(ReadOnlySpan<char>, Span<int>)

Finds the positions where a word can be hyphenated.

int Hyphenate(ReadOnlySpan<char> word, Span<int> breakPositions)

Parameters

word ReadOnlySpan<char>
The word: the letters and the combining marks of the text, without the punctuation and the spaces around it.
breakPositions Span<int>
The buffer that receives the positions, in increasing order: a position is the index of the UTF-16 code unit of word before which a hyphen can be inserted. Its length is the length of the word.

Returns

int The number of positions written; 0 when the word cannot be hyphenated.