question: public static DataDisplayTable listCharBlockCoverage ( Font font ) { String [ ] header = { "Block" , "Coverage" } ; Align [ ] displayAlignment = { Align . Left , Align . Right } ; DataDisplayTable table = new DataDisplayTable ( Arrays . asList ( header ) ) ; table . setAlignment ( Arrays . asList ( displayAlignment ) ) ; CMap cmap = FontUtils . getUCSCMap ( font ) ; int totalCount = 0 ; for ( int i = 0 ; i < UnicodeBlockData . numBlocks ( ) ; i ++ ) { String block = UnicodeBlockData . getBlockName ( i ) ; UnicodeSet set = null ; try { set = new UnicodeSet ( "[[:Block=" + block + ":]-[:gc=Unassigned:]-[:gc=Control:]]" ) ; } catch ( IllegalIcuArgumentException e ) { continue ; } int count = 0 ; for ( String charStr : set ) { if ( cmap . glyphId ( UCharacter . codePointAt ( charStr , 0 ) ) > 0 ) { count ++ ; } } if ( count > 0 ) { table . add ( Arrays . asList ( new String [ ] { String . format ( "%s [%s, %s]" , block , UnicodeBlockData . getBlockStartCode ( i ) , UnicodeBlockData . getBlockEndCode ( i ) ) , String . format ( "%d / %d" , count , set . size ( ) ) } ) ) ; } totalCount += count ; } UnicodeSet controlSet = new UnicodeSet ( "[[:gc=Control:]]" ) ; for ( String charStr : controlSet ) { if ( cmap . glyphId ( UCharacter . codePointAt ( charStr , 0 ) ) > 0 ) { totalCount ++ ; } } int nonUnicodeCount = numChars ( font ) - totalCount ; if ( nonUnicodeCount > 0 ) { table . add ( Arrays . asList ( new String [ ] { "Unknown" , String . format ( "%d" , nonUnicodeCount ) } ) ) ; } return table ; }
target:  Gets a list of Unicode blocks covered by the font and the amount each block is covered.