예제 #1
0
 public SpannableString build() {
   HashMap<String, ITypeface> mappedFonts = new HashMap<String, ITypeface>();
   for (ITypeface font : fonts) {
     mappedFonts.put(font.getMappingPrefix(), font);
   }
   return Iconics.style(ctx, mappedFonts, text, withStyles, withStylesFor);
 }
예제 #2
0
    public void build() {
      HashMap<String, ITypeface> mappedFonts = new HashMap<String, ITypeface>();
      for (ITypeface font : fonts) {
        mappedFonts.put(font.getMappingPrefix(), font);
      }

      if (view.getText() instanceof SpannableString) {
        view.setText(
            Iconics.style(
                ctx, mappedFonts, (SpannableString) view.getText(), withStyles, withStylesFor));
      } else {
        view.setText(
            Iconics.style(
                ctx, mappedFonts, new SpannableString(view.getText()), withStyles, withStylesFor));
      }

      if (Build.VERSION.SDK_INT >= 14) {
        if (view instanceof Button) {
          view.setAllCaps(false);
        }
      }
    }
예제 #3
0
 public static void registerFont(ITypeface font) {
   FONTS.put(font.getMappingPrefix(), font);
 }