stream.getStream().setInt(COSName.LENGTH1, stream.getByteArray().length); // todo: wrong?
stream.addCompression();
// only support winansi encoding right now, should really
// just use Identity-H with unicode mapping
Encoding encoding = new WinAnsiEncoding(); // fixme: read encoding from TTF
this.fontEncoding = encoding;
dict.setItem(COSName.ENCODING, encoding.getCOSObject());
// as the stream was close within the PDStream constructor, we have to recreate it
InputStream stream2 = null;
PDFontDescriptor fd;
try