for (int gid : gids.keySet()) { String mapping = font.getCharset().getNameForGID(gid); byte[] type1Bytes = formatter.format(font.getType1CharString(mapping).getType1Sequence()); byte[] charstringBytes = Type1FontUtil.charstringEncrypt(type1Bytes, 4); output.print("/" + mapping + " " + charstringBytes.length + " RD ");