code: public static float spToPx(Context ctx, float spSize){
          return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spSize, ctx.getResources().getDisplayMetrics());
      }
docs: Convert Scale-Dependent Pixels to actual pixels
  
  @param ctx       the application context
  @param spSize    the size in SP units
  @return          the size in Pixel units