def is_opentype_cff_font(filename):
 if (os.path.splitext(filename)[1].lower() == u'.otf'):
  result = _is_opentype_cff_font_cache.get(filename)
  if (result is None):
   with open(filename, u'rb') as fd:
    tag = fd.read(4)
   result = (tag == 'OTTO')
   _is_opentype_cff_font_cache[filename] = result
  return result
 return False

def is_opentype_cff_font ( filename ) : if ( os . path . splitext ( filename ) [ 1 ] . lower ( ) == u'.otf' ) : result = _is_opentype_cff_font_cache . get ( filename ) if ( result is None ) : with open ( filename , u'rb' ) as fd : tag = fd . read ( 4 ) result = ( tag == 'OTTO' ) _is_opentype_cff_font_cache [ filename ] = result return result return False
returns true if the given font is a postscript compact font format font embedded in an opentype wrapper .