การทำงานกับตัวอักษรเอเชีย

พิมพ์เอเชียเป็นชุดของตัวเลือกสำหรับย่อหน้าข้อความในเอกสารที่เขียนในภาษาเอเชีย.

Aspose.Wordsรองรับการพิมพ์เอเชียโดยใช้ชั้นเรียนParagraphFormatและบางส่วนของคุณสมบัติของมัน.

ปรับช่องว่างโดยอัตโนมัติระหว่างข้อความหรือตัวเลขเอเชียและละติน

ลักษณะที่ปรากฏของแม่แบบฟอร์มโดยการควบคุมช่องว่างระหว่างข้อความทั้งสองชนิดคุณส เพื่อให้บรรลุนี้คุณสามารถใช้AddSpaceBetweenFarEastAndAlphaและAddSpaceBetweenFarEastAndDigitคุณสมบัติของParagraphFormatคลาส.

ตัวอย่างรหัสต่อไปนี้แสดงวิธีใช้คุณสมบัติ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);