code: @NonNull
      public static Typeface obtainTypeface(@NonNull Context context, @NonNull TypedArray attrs) {
          if (attrs.hasValue(R.styleable.RobotoTextView_robotoTypeface)) {
              @RobotoTypeface int typefaceValue = attrs.getInt(R.styleable.RobotoTextView_robotoTypeface, TYPEFACE_ROBOTO_REGULAR);
              return obtainTypeface(context, typefaceValue);
          } else {
              @RobotoFontFamily int fontFamily = attrs.getInt(R.styleable.RobotoTextView_robotoFontFamily, FONT_FAMILY_ROBOTO);
              @RobotoTextWeight int textWeight = attrs.getInt(R.styleable.RobotoTextView_robotoTextWeight, TEXT_WEIGHT_NORMAL);
              @RobotoTextStyle int textStyle = attrs.getInt(R.styleable.RobotoTextView_robotoTextStyle, TEXT_STYLE_NORMAL);
              return obtainTypeface(context, fontFamily, textWeight, textStyle);
          }
      }
docs: Obtain typeface from attributes.
  
  @param context The Context the widget is running in, through which it can access the current theme, resources, etc.
  @param attrs   The styled attribute values in this Context's theme.
  @return specify {@link Typeface}