code: public static void setUpTypeface(@NonNull TextView textView, @NonNull Context context, @Nullable AttributeSet attrs) {
          Typeface typeface;
          if (attrs != null) {
              TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView);
              try {
                  typeface = obtainTypeface(context, a);
              } finally {
                  a.recycle();
              }
          } else {
              typeface = obtainTypeface(context, TYPEFACE_ROBOTO_REGULAR);
          }
          setUpTypeface(textView, typeface);
      }
docs: Set up typeface for TextView from the attributes.
  
  @param textView The roboto text view
  @param context  The context the widget is running in, through which it can
  access the current theme, resources, etc.
  @param attrs    The attributes of the XML tag that is inflating the widget.