static String getFontName ( AssetManager assets , String filePath ) { TTFAssetInputStream in = null ; try { InputStream file = assets . open ( filePath , AssetManager . ACCESS_RANDOM ) ; in = new TTFAssetInputStream ( file ) ; return getTTFFontName ( in , filePath ) ; } catch ( FileNotFoundException e ) { return null ; // Missing permissions? } catch ( IOException e ) { return null ; // Corrupted font file? } finally { IOUtils . closeQuietly ( in ) ; } }
Retrieve the file name for a font in the asset folder .