PdfPatternHyphenator Class

Hyphenates the words with the hyphenation patterns of a language, loaded by Hyphenator.

public sealed class PdfPatternHyphenator : IPdfHyphenator

Remarks

No pattern is included in the library: the hyph-utf8 project of the TeX community publishes patterns for many languages, each under its own license.

Implements

Constructors

NameDescription
PdfPatternHyphenator(Hyphenator)Initializes a new instance of the PdfPatternHyphenator class.

PdfPatternHyphenator(Hyphenator)

PdfPatternHyphenator.cs

Initializes a new instance of the PdfPatternHyphenator class.

public PdfPatternHyphenator(Hyphenator hyphenator)

Parameters

hyphenator Hyphenator
The patterns of the language.

Properties

NameDescription
HyphenatorGets the patterns of the language.

Gets the patterns of the language.

public Hyphenator Hyphenator { get; }

Property value

Hyphenator

Methods

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

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

PdfPatternHyphenator.cs

Finds the positions where a word can be hyphenated.

public 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.