アジアのタイポグラフィを扱う
アジアのタイポグラフィは、アジアの言語で書かれた文書のテキスト段落のオプションのセットです。
Aspose.Wordsは、ParagraphFormatクラスとそのプロパティの一部を使用したアジアのタイポグラフィをサポートします。
アジア語とラテン語のテキストまたは数字の間のスペースを自動的に調整します
東アジア語とラテン語の両方のテキストを含むテンプレートを設計していて、両方のタイプのテキスト間のスペースを制御してフォームテンプレートの外観を向上させたい場合は、これらの2つのタイプのテキスト間のスペースを自動的に調整するようにフォームテンプレートを構成できます。 これを実現するには、ParagraphFormat
クラスのAddSpaceBetweenFarEastAndAlphaプロパティとAddSpaceBetweenFarEastAndDigitプロパティを使用できます。
次のコード例は、AddSpaceBetweenFarEastAndAlphaプロパティとAddSpaceBetweenFarEastAndDigitプロパティの使用方法を示しています:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(); | |
System::SharedPtr<DocumentBuilder> builder = System::MakeObject<DocumentBuilder>(doc); | |
// Set paragraph formatting properties | |
System::SharedPtr<ParagraphFormat> paragraphFormat = builder->get_ParagraphFormat(); | |
paragraphFormat->set_AddSpaceBetweenFarEastAndAlpha(true); | |
paragraphFormat->set_AddSpaceBetweenFarEastAndDigit(true); | |
builder->Writeln(u"Automatically adjust space between Asian and Latin text"); | |
builder->Writeln(u"Automatically adjust space between Asian text and numbers"); | |
System::String outputPath = outputDataDir + u"DocumentBuilderSetFormatting.SetSpacebetweenAsianandLatintext.doc"; | |
doc->Save(outputPath); |
改行オプションの設定
Microsoft Wordの段落プロパティダイアログボックスのアジアのタイポグラフィタブには改行グループがあります。 このグループのオプションは、以下を使用して設定できます。FarEastLineBreakControl, WordWrap, HangingPunctuation ParagraphFormatクラスのプロパティ。
次のコード例は、これらのプロパティを使用する方法を示しています:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Input.docx"); | |
System::SharedPtr<ParagraphFormat> format = doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(0)->get_ParagraphFormat(); | |
format->set_FarEastLineBreakControl(false); | |
format->set_WordWrap(true); | |
format->set_HangingPunctuation(false); | |
System::String outputPath = outputDataDir + u"DocumentBuilderSetFormatting.SetAsianTypographyLinebreakGroupProp.docx"; | |
doc->Save(outputPath); |