IndexOutOfBoundsException in FopGlyphProcessor when shaping Thai characters (Complex Scripts)
まだ誰も着手していません。
評価
- 難易度
- 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 の本文から書いたものです。
説明
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
System
OpenPDF version: 3.0.0
FOP version: 2.11
Language: Thai
- 主要言語
- Java
- スター
- 4.4k
- フォーク
- 714
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LibrePDF/OpenPDF のほかの issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
IndexOutOfBoundsException in PdfReader対応中かも @andreasrosdalw が 93 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
`PdfSmartCopy` can take effectively unbounded time on nested shared Form XObjects対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
LibrePDF/OpenPDF の issue をすべて見る
似ている issue
-
bug web-server
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jooby-project/jooby#4035 ·
メンテナーはふだん 1 日以内に返信
-
L: javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dependabot/dependabot-core#16744 ·
メンテナーはふだん 1 日以内に返信
-
intake mcp-intake needs-human-review priority:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Ikalus1988/MisakaNet#3987 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
quarkiverse/quarkus-google-cloud-services#1187 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
locationtech/jts#1250 ·