DictData.Entry charStringsEntry = topDict.getEntry("CharStrings");
int charStringsOffset = charStringsEntry.getNumber(0).intValue();
input.setPosition(charStringsOffset);
IndexData charStringsIndex = readIndexData(input);
DictData.Entry charsetEntry = topDict.getEntry("charset");
CFFCharset charset;
int charsetId = charsetEntry != null ? charsetEntry.getNumber(0).intValue() : 0;
if (charsetId == 0)
{
charset = CFFISOAdobeCharset.getInstance();
}
else if (charsetId == 1)
{
charset = CFFExpertCharset.getInstance();
}
else if (charsetId == 2)
{
charset = CFFExpertSubsetCharset.getInstance();
}
else
{
input.setPosition(charsetId);
charset = readCharset(input, charStringsIndex.getCount());
}
font.setCharset(charset);
font.getCharStringsDict().put(".notdef", charStringsIndex.getBytes(0));
int[] gids = new int[charStringsIndex.getCount()];
List<CFFCharset.Entry> glyphEntries = charset.getEntries();
for (int i = 1; i < charStringsIndex.getCount(); i++)
{
CFFCharset.Entry glyphEntry = glyphEntries.get(i - 1);
gids[i - 1] = glyphEntry.getSID();
font.getCharStringsDict().put(glyphEntry.getName(), charStringsIndex.getBytes(i));