SetTextShaping
Text
Description
This page describes SetTextShaping in PDFlibPas under the "Text" topic. API names, parameters, class names, filenames, and literals are kept exactly as they appear in the Delphi library and DLL entry points.
Review the syntax, parameters, and return values before calling the function.
Syntax
Delphi
Function TPDFlib.SetTextShaping(Enable: Integer): Integer;
Parameters
Enable 1 turns automatic complex-script shaping on (the default), 0 turns it off.
Return Values
Returns the previous state: 1 when shaping was enabled before the call, 0 when it was disabled.
Remarks
When enabled, DrawText and GetTextWidth detect Arabic, Hebrew, Indic and other complex-script characters and route them through the shaping engine automatically, so contextual forms, mandatory ligatures and right-to-left ordering come out correctly without calling DrawShapedText yourself. Latin, Cyrillic, Greek and CJK text is never rerouted, so existing output is unchanged. Disable the routing to reproduce the exact pre-shaping behaviour or when the unshaped byte-for-byte content stream matters more than correct complex-script rendering.