* true for CIDType2 , false for CIDType0
* @return
*/
protected CIDToGIDMap checkCIDToGIDMap(COSBase ctog, boolean mandatory)
{
CIDToGIDMap cidToGidMap = null;
if (COSUtils.isString(ctog, cosDocument))
{
// ---- valid only if the string is Identity
String ctogStr = COSUtils.getAsString(ctog, cosDocument);
if (!FONT_DICTIONARY_VALUE_CMAP_IDENTITY.equals(ctogStr))
{
this.fontContainer.push(new ValidationError(ERROR_FONTS_CIDKEYED_CIDTOGID,
"The CIDToGID entry is invalid"));
}
}
else if (COSUtils.isStream(ctog, cosDocument))
{
try
{
COSStream ctogMap = COSUtils.getAsStream(ctog, cosDocument);
cidToGidMap = new CIDToGIDMap();
cidToGidMap.parseStream(ctogMap);
}
catch (IOException e)
{
// map can be invalid, return a Validation Error
this.fontContainer.push(new ValidationError(ERROR_FONTS_CIDKEYED_CIDTOGID));