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, using the EnableTextShaping property:
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-devFAQ
Q: How can I enable text shaping for all conversions in Wordize?
A: Set the global flagWordize.Settings.EnableTextShapingtotruebefore performing any conversion. This activates the HarfBuzz engine for every subsequent export operation.Q: How do I enable text shaping only for a specific conversion?
A: Create aConverterContext, setLayoutOptions.EnableTextShapingtotrueon that context, and use it when building the converter. This limits shaping to the current conversion call.Q: Do I need to install HarfBuzz manually on Windows?
A: No. The Windows distribution of Wordize bundles the HarfBuzz library, so text shaping works out‑of‑the‑box without any extra installation steps.Q: What steps are required to install HarfBuzz on Linux or in a Docker container?
A: Ensure thelibharfbuzz-devpackage (or the equivalent for your distribution) is installed. For example, on an Ubuntu‑based image you can runapt-get update && apt-get install -y libharfbuzz-devbefore using Wordize.