Unable to insert text in Identity-H encoding using a subset font file
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by tracing how BaseFont.createFont handles the supplied subset OTF with Identity-H, then follow how PdfContentByte.showText maps the characters to glyphs. Reproduce with the provided snippet and font file, comparing it with a full font that works. Done means identifying why the subset font renders no text and confirming a fix or a clear limitation; the issue does not name a test or source file.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
I am trying to insert one word of text into the PDF page. I have made use of BaseFont class, provided Identity-H as the encoding and the subset font file corresponding to this one word of text. I am not able to see any text that had got created on the page.
Code snippet
String fontFile="CLQCTE+TradeGothic.otf";
PdfContentByte cb = writer.getDirectContent();
BaseFont bf1 = BaseFont.createFont(fontFile, BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
cb.beginText();
cb.setTextMatrix(70,804);
cb.setFontAndSize(bf1,12);
cb.beginMarkedContentSequence(e1);
cb.showText("ent");
cb.endMarkedContentSequence();
cb.endText();
Expected behavior
I wanted to see the PDF with the text "ent" in it.
System
- OS: Windows OS
- Used font: Subset font (mentioned in the code)
- OpenPDF version: 1.3.26
Even after so many trails, I am not able to see the text on the page. When I checked for the glyphs the font file supports,
came to know that these three glyphs "e", "n" and "t" are supported by this subset font file.
Hence, I have tried with a different font, and it worked well. May I know the reason/resolution for the same?
- Lenguaje dominante
- Java
- Estrellas
- 4.4k
- Forks
- 714
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de LibrePDF/OpenPDF
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
IndexOutOfBoundsException in PdfReaderPosiblemente ocupada @andreasrosdalw la tomó hace 94 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
`PdfSmartCopy` can take effectively unbounded time on nested shared Form XObjectsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Todos los issues de LibrePDF/OpenPDF
Issues similares
-
pending:code-area pending:issue-category to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area:core bug priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aomarai/minecraft-mcp#247 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
antonyrag/ragleap-core#1062 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
projectnessie/nessie#13256 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Vakore/ZappierGames#232 ·