// this is one possible case of an incomplete subfont which leads to a font exception
if (getFontEncoding() instanceof WinAnsiEncoding)
{
TTFParser ttfParser = new TTFParser(true);
TrueTypeFont ttf = ttfParser.parseTTF(inputStream);
TTFSubFont ttfSub = new TTFSubFont(ttf, "PDFBox-Rebuild");
for (int i=getFirstChar();i<=getLastChar();i++)
{
ttfSub.addCharCode(i);
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ttfSub.writeToStream(baos);
return baos.toByteArray();
}
return null;
}