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

Unable to insert text in Identity-H encoding using a subset font file

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

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.

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

説明

bug
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?

主要言語
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 を短くまとめたダイジェスト。