行首确保不是标点符号

显示效果:

示例代码所生成的OFD文件:下载

 示例代码

package test.create.c02;

import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.paragraph.Text;
import test.create.TestDocUtil;

/**
 * 展示如何处理标点符号
 * */
public class C0210PunctuationEnds {

	public static void main(String[] args) throws Throwable {
		C0210PunctuationEnds o = new C0210PunctuationEnds();
		o.done();
	}

	private void done() throws Throwable {
		String clzName = this.getClass().getSimpleName();
		System.out.println(clzName + " begin");
		
		String s = "正式的文本需要确保标点符号不会在第一个位置(以下开始凑字数)凑字数凑。";
		
		OfdDocument doc = new OfdDocument();
		Paragraph p = new Paragraph();
		Text text = new Text(s);
		p.add(text);
		doc.add(p);
		
		String fileName = TestDocUtil.getOfdFilePath(this.getClass());
		doc.save(fileName);
		System.out.println(clzName + " end");
	}
}