private static StyleContainer placeFontIcon(Editable editable, int iconStart, int iconEnd, HashMap<String, ITypeface> fonts) {
        //make sure to check only for possible icons
        if (iconEnd - iconStart >= 6) {
            //build the iconString
            String iconString = editable.subSequence(iconStart + 1, iconEnd).toString().replace("-", "_");
            //find out the fontKey
            String fontKey = editable.subSequence(iconStart + 1, iconStart + 4).toString();

            try {
                //get the correct character for this Font and Icon
                ITypeface typeface = fonts.get(fontKey);
                if (typeface != null) {
                    //get the icon for the iconString
                    IIcon icon = typeface.getIcon(iconString);
                    //we can only add an icon which is a font
                    if (icon != null) {
                        //get and add the mapped char to the string
                        char fontChar = icon.getCharacter();
                        editable.replace(iconStart, iconEnd + 1, String.valueOf(fontChar));

                        //add the current icon to the container
                        return new StyleContainer(iconStart, iconStart + 1, iconString, fonts.get(fontKey));
                    } else {
                        Log.e(Iconics.TAG, "Wrong icon name: " + iconString);
                    }
                } else {
                    Log.e(Iconics.TAG, "Wrong fontId: " + iconString);
                }
            } catch (IllegalArgumentException e) {
                Log.e(Iconics.TAG, "Wrong icon name: " + iconString);
            }
        }
        return null;
    }
private static StyleContainer placeFontIcon ( Editable editable , int iconStart , int iconEnd , HashMap < String , ITypeface > fonts ) { if ( iconEnd - iconStart >= 6 ) { String iconString = editable . subSequence ( iconStart + 1 , iconEnd ) . toString ( ) . replace ( "-" , "_" ) ; String fontKey = editable . subSequence ( iconStart + 1 , iconStart + 4 ) . toString ( ) ; try { ITypeface typeface = fonts . get ( fontKey ) ; if ( typeface != null ) { IIcon icon = typeface . getIcon ( iconString ) ; if ( icon != null ) { char fontChar = icon . getCharacter ( ) ; editable . replace ( iconStart , iconEnd + 1 , String . valueOf ( fontChar ) ) ; return new StyleContainer ( iconStart , iconStart + 1 , iconString , fonts . get ( fontKey ) ) ; } else { Log . e ( Iconics . TAG , "Wrong icon name: " + iconString ) ; } } else { Log . e ( Iconics . TAG , "Wrong fontId: " + iconString ) ; } } catch ( IllegalArgumentException e ) { Log . e ( Iconics . TAG , "Wrong icon name: " + iconString ) ; } } return null ; }
@param editable
@param iconStart
@param iconEnd
@param fonts
@return