Working with Asian Typography

Asian Typography is a set of options for text paragraphs in documents written in Asian languages.

Aspose.Words supports Asian Typography using the ParagraphFormat class and some of its properties.

Automatically Adjust Space between Asian and Latin Text or Numbers

If you are designing a template with both East Asian and Latin text and want to enhance the appearance of your form template by controlling the spaces between both types of text, you can configure your form template to automatically adjust the spaces between these two types of text. To achieve this, you can use AddSpaceBetweenFarEastAndAlpha and AddSpaceBetweenFarEastAndDigit properties of the ParagraphFormat class.

The following code example shows how to use AddSpaceBetweenFarEastAndAlpha and AddSpaceBetweenFarEastAndDigit properties:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set paragraph formatting properties
ParagraphFormat paragraphFormat = builder.ParagraphFormat;
paragraphFormat.AddSpaceBetweenFarEastAndAlpha = true;
paragraphFormat.AddSpaceBetweenFarEastAndDigit = true;
builder.Writeln("Automatically adjust space between Asian and Latin text");
builder.Writeln("Automatically adjust space between Asian text and numbers");
dataDir = dataDir + "DocumentBuilderSetSpacebetweenAsianandLatintext.doc";
doc.Save(dataDir);

Set Line Break Options

The Asian Typography tab of the paragraph properties dialog box in Microsoft Word has line break group. The options of this group can be set using the FarEastLineBreakControl, WordWrap, HangingPunctuation properties of the ParagraphFormat class.

The following code example shows how to use these properties:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
Document doc = new Document(dataDir + "Input.docx");
ParagraphFormat format = doc.FirstSection.Body.Paragraphs[0].ParagraphFormat;
format.FarEastLineBreakControl = false;
format.WordWrap = true;
format.HangingPunctuation = false;
dataDir = dataDir + "SetAsianTypographyLinebreakGroupProp_out.docx";
doc.Save(dataDir);