Text Shaping
Text shaping is the process of transforming a sequence of characters into a visually appealing representation, taking into account the specific features of the font being used. This is particularly important for complex scripts and languages that require precise placement of glyphs (visual representations of characters) to ensure correct rendering.
Text Shaping in Wordize
In the context of Wordize, text shaping is performed when exporting documents to fixed-page formats, such as PDF or XPS, utilizing advanced typography features provided by OpenType fonts. Wordize supports these OpenType features through the HarfBuzz text shaping engine.
The following code example shows how to enable text shaping globally:
Wordize.Settings.EnableTextShaping = true;
The following code example shows how to enable text shaping for concrete operation using the conversion example:
ConverterContext converterContext = new ConverterContext();
converterContext.LayoutOptions.EnableTextShaping = true;
Converter.Create(converterContext)
.From(inPath)
.To(outPath)
.Execute();
How to Install HarfBuzz
For Windows platforms, no additional effort is required to install HarfBuzz, as Wordize already includes the compiled HarfBuzz library.
For other systems, Wordize relies on already installed HarfBuzz library. For instance, many Linux-based systems have HarfBuzz installed by default system-wide. If not, there is usually a package available for installation via package manager. For example, in the clear Ubuntu Docker image, it is required to additionally install Harfbuzz using the following command:
RUN apt-get update && apt-get install -y libharfbuzz-dev