Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

IndexOutOfBoundsException in FopGlyphProcessor when shaping Thai characters (Complex Scripts)

Abierto
#1,456 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Java
Estrellas
4.4k
Forks
714
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de LibrePDF/OpenPDF

Todos los issues de LibrePDF/OpenPDF

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.