JaspreReportsで作成したPDFファイルでセルから内容があふれてしまう場合の対応

JaspreReportsで作成したPDFファイルでセル(テキストフィールド)から、内容はあふれてしまうという現象があったので調査しました。
実際にここに貼り付けられるサンプルがないのですが、、英数字部分の改行位置がおかしくて1行分セルの高さが足りなくなっているようでした(例えば2行分の高さなのにデータは3行になってしまう)。
私の環境では、フォントを埋め込まず"HeiseiKakuGo-W5"だとNGで、"HeiseiMin-W3"だとOKだったり、埋め込むフォントによって発生したりしなかったりしました。ただ、フォントの設定(フォント埋め込み有無、埋め込むフォントの種類)と入力データによって計算される行の長さが変わると思われるので、フォントが関与しているかは疑問ですが。

この現象はJRPdfExporterのパラメータ"FORCE_LINEBREAK_POLICY"をtrueに設定することで回避できました。FORCE_LINEBREAK_POLICYは、以下にあるとおり、改行位置の計算方法をiTextに合わせるという設定です(falseだとセルの描画とデータの流し込みで改行位置の計算方法がかわる?)。デメリットとしてエクスポートのパフォーマンスが落ちるようです。

Flag that decides whether the PDF exporter should use a SplitCharacter implementation which ensures that report texts are broken into lines by iText in the same manner as done by the fill process.
The default line-breaking logic differs from AWT (which is used during the report fill) to iText (used by the PDF exporter). By setting this flag, the logic used by AWT is imposed to iText. The drawback is that the PDF export performance would drop. Because of this, the flag is not set by default.
JRPdfExporterParameter (JasperReports 3.7.6 API)

このプロパティを設定するためには、JasperPdfExporterのパラメータとして渡すか、

JRExporter exporter = new JRPdfExporter();
exporter.setParameter(JRPdfExporterParameter.FORCE_LINEBREAK_POLICY, Boolean.TRUE);

jrxmlファイルにpropertyを追加します。

<property name="net.sf.jasperreports.export.pdf.force.linebreak.policy" value="true"/>