Code example for TypefaceSpan

0
     * @param starIndex 
     * @param endIndex 
     */ 
    public void getTypefaceSpan(SpannableString spannableString,
                                String typeface, int starIndex, int endIndex) {
        spannableString.setSpan(new TypefaceSpan(typeface), starIndex,
                endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    } 
 
    /** 
     * 设置绝对字体大小(单位:像素) 
     * 
     * @param spannableString 
     * @param pixel 
     * @param starIndex 
     * @param endIndex 
     */ 
    public void getAbsoluteSizeSpan(SpannableString spannableString, int pixel,
                                    int starIndex, int endIndex) {
        spannableString.setSpan(new AbsoluteSizeSpan(pixel), starIndex,
Connect your IDE to all the code out there  Get Codota for Java