使用亚洲版式
亚洲版式是针对以亚洲语言编写的文档中的文本段落的一组选项。
Aspose.Words 使用 ParagraphFormat 类及其一些属性支持亚洲版式。
自动调整亚洲和拉丁文本或数字之间的间距
如果您正在设计包含东亚和拉丁文本的模板,并且希望通过控制两种类型文本之间的间距来增强表单模板的外观,则可以将表单模板配置为自动调整这两种类型文本之间的间距。为此,您可以使用 ParagraphFormat
类的 AddSpaceBetweenFarEastAndAlpha 和 AddSpaceBetweenFarEastAndDigit 属性。
以下代码示例显示如何使用 AddSpaceBetweenFarEastAndAlpha 和 AddSpaceBetweenFarEastAndDigit 属性:
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET | |
doc = aw.Document() | |
builder = aw.DocumentBuilder(doc) | |
paragraphFormat = builder.paragraph_format | |
paragraphFormat.add_space_between_far_east_and_alpha = True | |
paragraphFormat.add_space_between_far_east_and_digit = True | |
builder.writeln("Automatically adjust space between Asian and Latin text") | |
builder.writeln("Automatically adjust space between Asian text and numbers") | |
doc.save(docs_base.artifacts_dir + "DocumentFormatting.space_between_asian_and_latin_text.docx") |
设置换行选项
Microsoft Word 中段落属性对话框的亚洲版式选项卡具有换行符组。该组的选项可以使用 ParagraphFormat 类的 FarEastLineBreakControl、WordWrap、HangingPunctuation 属性进行设置。
以下代码示例展示了如何使用这些属性:
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET | |
doc = aw.Document(docs_base.my_dir + "Asian typography.docx") | |
format = doc.first_section.body.paragraphs[0].paragraph_format | |
format.far_east_line_break_control = False | |
format.word_wrap = True | |
format.hanging_punctuation = False | |
doc.save(docs_base.artifacts_dir + "DocumentFormatting.asian_typography_line_break_group.docx") |