gpt4 book ai didi

java - 如何在 itext Hyphenation Auto cyrillic 中使用它

转载 作者:行者123 更新时间:2023-11-30 10:12:08 25 4
gpt4 key购买 nike

PdfPTable table = new PdfPTable(1);
table.setWidthPercentage(10);

Phrase phrase = new Phrase();
phrase.setHyphenation(new HyphenationAuto("ru", "ru", 2,2));
phrase.add(new Chunk("привет мир ",font3));

table.addCell(phrase);
document.add(table);

测试显示不正确!!

我可以将“ru”应用于断字吗?

最佳答案

您可以创建一个新的 HyphenationAuto(String lang, String country, int leftMin, int rightMin) 对象,如下所示:

  • lang - 语言(例如“en”代表英语)
  • country - 国家(例如,“GB”代表英国,“none”代表没有国家)
  • leftMin - 连字符前的最小字母数
  • rightMin - 连字符后的最小字母数

总而言之,您可以使用 ru 作为俄语的国家/地区代码。

关于java - 如何在 itext Hyphenation Auto cyrillic 中使用它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52018413/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com