iText中文标点在行首 [英] iText Chinese punctuation at the beginning of line

查看:331
本文介绍了iText中文标点在行首的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道在一行已满时如何解决该问题,然后将中文标点放在下一行的开始处,如(1)所示?实际上,我们希望将标点符号放置在每行的末尾,如(2)所示.

Do you know how to resolve the problem when one line is full, then the Chinese punctuations will be placed at the beginning of next line as shown in (1)? In fact we hope the punctuations to be placed at the end of each line as shown in (2).

(1)

你好你好

你好你好

,你好你好

,你好你好

(2)

你好你好

你好你好,

你好你好

你好你好

非常感谢您的提前帮助!

Thank you very much for your help in advance!

推荐答案

您要在最后一个字符和标点之间放置一个空格,这是一个分割点.最简单的方法是在穿刺之前移除空间,然后在穿刺之后添加空间.另一种选择是用不间断空格\ u00a0替换该空格,以避免在该点处拆分.

You are placing a space between the last char and the punctuation and that is a split point. The simplest way is to remove the space before the puntuation and add it after. Other option is to replace the space with a non breaking space \u00a0 to avoid the split at that point.

这篇关于iText中文标点在行首的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆