Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

IndexOutOfBoundsException in FopGlyphProcessor when shaping Thai characters (Complex Scripts)

オープン
#1,456 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java

調査の方向性

Start by reading FopGlyphProcessor.convertToBytesWithGlyphs and trace how FOP's CharAssociation maps shaped glyphs to source characters. Reproduce the Thai Sara Am case with FOP 2.11, then check that glyphs map to their original characters without an index error. The report names no test file, so locate or add a regression test for this case.

索引モデルが issue の本文から書いたものです。

説明

bug
Describe the bug

I found a bug in FopGlyphProcessor when rendering Thai language with FOP support enabled. The application crashes with IndexOutOfBoundsException because the processor assumes a 1:1 mapping between characters and glyphs.

To Reproduce

When rendering Thai characters like "ำ" (Sara Am), the FOP shaping engine decomposes one character into two glyphs (Nikkhahit + Lak Khang).
The current loop in FopGlyphProcessor.convertToBytesWithGlyphs iterates based on the glyph count but tries to access the charBuffer using the same index:

for (int i = 0; i < limit; i++) {
    // ...
    longTag.put(glyphCode, new int[]{..., charBuffer.get(i)}); // This throws Exception when limit > charBuffer size
}
Expected behavior

The processor should handle cases where the number of glyphs is greater than the number of characters by correctly mapping glyphs back to their original source characters using FOP's CharAssociation.

Screenshots
Image Image Image
System

OpenPDF version: 3.0.0
FOP version: 2.11
Language: Thai

主要言語
Java
スター
4.4k
フォーク
714
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LibrePDF/OpenPDF のほかの issue

LibrePDF/OpenPDF の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。