Unable to insert text in Identity-H encoding using a subset font file
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- Java
- Stelle
- 4.4k
- Fork
- 714
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LibrePDF/OpenPDF
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
IndexOutOfBoundsException in PdfReaderForse già presa @andreasrosdalw l’ha presa 93 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
`PdfSmartCopy` can take effectively unbounded time on nested shared Form XObjectsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
Tutte le issue di LibrePDF/OpenPDF
Issue simili
-
priority: p2 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
googleapis/java-genai#1372 ·
I maintainer di solito rispondono entro 1 giorno
-
GeoSeries scale and skew tests fail with pytest 9.2.0Forse già presa @jiayuasu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
carlos-emr/carlos#5431 ·
I maintainer di solito rispondono entro 1 giorno
-
Integration tests: jetty:run fails with WELD-001408 for CountryJpaServiceForse già presa @viniciusmachak l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
primefaces/primefaces#15431 ·
I maintainer di solito rispondono entro 1 giorno
-
test(multi-tenancy): assert cross-tenant vulnerability reads are refused in the CWE isolation testAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenAEV-Platform/openaev#8792 ·
I maintainer di solito rispondono entro 2 giorni