การทำงานกับตัวอักษรเอเชีย
Asian Typography คือชุดตัวเลือกสำหรับย่อหน้าข้อความในเอกสารที่เขียนในภาษาเอเชีย
Aspose.Words รองรับ Asian Typography โดยใช้คลาส ParagraphFormat และคุณสมบัติบางอย่าง
ปรับช่องว่างระหว่างข้อความหรือตัวเลขเอเชียและละตินโดยอัตโนมัติ
หากคุณกำลังออกแบบเทมเพลตที่มีทั้งข้อความเอเชียตะวันออกและละติน และต้องการปรับปรุงลักษณะที่ปรากฏของเทมเพลตฟอร์มของคุณโดยการควบคุมช่องว่างระหว่างข้อความทั้งสองชนิด คุณสามารถกำหนดค่าเทมเพลตของคุณฟอร์มเพื่อปรับช่องว่างระหว่างข้อความทั้งสองชนิดนี้โดยอัตโนมัติ. เพื่อให้บรรลุเป้าหมายนี้ คุณสามารถใช้คุณสมบัติ AddSpaceBetweenFarEastAndAlpha และ AddSpaceBetweenFarEastAndDigit ของคลาส ParagraphFormat
ได้
ตัวอย่างโค้ดต่อไปนี้แสดงวิธีการใช้คุณสมบัติ 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") |
ตั้งค่าตัวเลือกตัวแบ่งบรรทัด
แท็บ Asian Typography ของกล่องโต้ตอบคุณสมบัติย่อหน้าใน Microsoft Word มีกลุ่มตัวแบ่งบรรทัด ตัวเลือกของกลุ่มนี้สามารถตั้งค่าได้โดยใช้คุณสมบัติ FarEastLineBreakControl, WordWrap, HangingPunctuation ของคลาส ParagraphFormat
ตัวอย่างโค้ดต่อไปนี้แสดงวิธีการใช้คุณสมบัติเหล่านี้:
# 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") |