Hello Tamir,
Please create an issue in JIRA. Yeah it might be a bug. Please attach your font. If you have several type1 fonts, please try with them too. I searched for "Helvetica.pfb" and tried with that one and also failed. The font is in the PDF in full (not subsetted) and looking with PDFDebugger the äöü isn't there. Either this is also a bug, or the äöü are produced as a combination of two glyphs. If it is done as a combination, then I don't know if we can fix this, and obviously the workaround is easy.
(I haven't looked into the code, so all I just wrote is just a guess)
Tilman

Am 17.02.2018 um 22:58 schrieb Tamir Hassan:
Hi all,

I am having difficulties adding text using a PostScript Type1 font (agaramond.pfb) when the text contains German characters.

I am using the latest release (2.0.8).

The problem seems to occur with e.g. the character "ä" (adieresis) and other similar umlaut characters; it does not occur with "ß" (germandbls).

Using an embedded TTF seems to work fine but when I load the PFB like this:

InputStream pfbIn = new FileInputStream(fontFile);
font = new PDType1Font(document, pfbIn);

I get an encoding error whenever I try to print an "ä" to the page:

java.lang.IllegalArgumentException: U+00E4 ('adieresis') is not available in this font AGaramond-Regular (generic: AGaramond-Regular) encoding: built-in (Type 1)

If I specify a different encoding (WinANSI) when loading the font:

InputStream pfbIn = new FileInputStream(fontFile);
font = new PDType1Font(document, pfbIn, new WinAnsiEncoding());

then the exception is not thrown, but I just have an empty space in place of the "ä".

I have tried to look into the code, in particular I have played around with the class PDType1FontEmbedder.

When the FontBox object Type1Font is created by the parser in the following line of code:

type1 = Type1Font.createWithPFB(pfbBytes);

I have tried to look into the charstring dictionary:

type1.getCharStringsDict()

and, by iterating through the set keys, can see that "adieresis" is in there.

However, when using the default encoding from the font (i.e. by passing "null" to the PDType1FontEmbedder), the resulting encoding that is obtained by the following line of code:

fontEncoding = Type1Encoding.fromFontBox(type1.getEncoding());

does not contain "adieresis" (or other "compound" characters), but just "dieresis"

Can someone help me out here? Is this a bug? Should I submit a JIRA issue?

Thanks,
Tamir

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to