Example usage for android.graphics Typeface create

List of usage examples for android.graphics Typeface create

Introduction

In this page you can find the example usage for android.graphics Typeface create.

Prototype

public static Typeface create(Typeface family, @Style int style) 

Source Link

Document

Create a typeface object that best matches the specified existing typeface and the specified Style.

Usage

From source file:com.android.yijiang.kzx.widget.betterpickers.calendardatepicker.SimpleMonthView.java

/**
 * Sets up the text and style properties for painting. Override this if you want to use a different paint.
 *//*w ww.j  a  v  a  2  s . c  o  m*/
protected void initView() {
    mMonthTitlePaint = new Paint();
    mMonthTitlePaint.setFakeBoldText(true);
    mMonthTitlePaint.setAntiAlias(true);
    mMonthTitlePaint.setTextSize(sMonthLabelTextSize);
    mMonthTitlePaint.setTypeface(Typeface.create(mMonthTitleTypeface, Typeface.BOLD));
    mMonthTitlePaint.setColor(mDayTextColor);
    mMonthTitlePaint.setTextAlign(Align.CENTER);
    mMonthTitlePaint.setStyle(Style.FILL);

    mMonthTitleBGPaint = new Paint();
    mMonthTitleBGPaint.setFakeBoldText(true);
    mMonthTitleBGPaint.setAntiAlias(true);
    mMonthTitleBGPaint.setColor(mMonthTitleBGColor);
    mMonthTitleBGPaint.setTextAlign(Align.CENTER);
    mMonthTitleBGPaint.setStyle(Style.FILL);

    mSelectedCirclePaint = new Paint();
    mSelectedCirclePaint.setFakeBoldText(true);
    mSelectedCirclePaint.setAntiAlias(true);
    mSelectedCirclePaint.setColor(mTodayNumberColor);
    mSelectedCirclePaint.setTextAlign(Align.CENTER);
    mSelectedCirclePaint.setStyle(Style.FILL);
    mSelectedCirclePaint.setAlpha(SELECTED_CIRCLE_ALPHA);

    mMonthDayLabelPaint = new Paint();
    mMonthDayLabelPaint.setAntiAlias(true);
    mMonthDayLabelPaint.setTextSize(sMonthDayLabelTextSize);
    mMonthDayLabelPaint.setColor(mDayTextColor);
    mMonthDayLabelPaint.setTypeface(Typeface.create(mDayOfWeekTypeface, Typeface.NORMAL));
    mMonthDayLabelPaint.setStyle(Style.FILL);
    mMonthDayLabelPaint.setTextAlign(Align.CENTER);
    mMonthDayLabelPaint.setFakeBoldText(true);

    mMonthNumPaint = new Paint();
    mMonthNumPaint.setAntiAlias(true);
    mMonthNumPaint.setTextSize(sMiniDayNumberTextSize);
    mMonthNumPaint.setStyle(Style.FILL);
    mMonthNumPaint.setTextAlign(Align.CENTER);
    mMonthNumPaint.setFakeBoldText(false);
}

From source file:net.yaly.ViewPagerDoubleIndicator.java

public ViewPagerDoubleIndicator(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    setFillViewport(true);/*from w  w  w.j  av a2 s . c o m*/
    setWillNotDraw(false);
    mTabsContainer = new LinearLayout(context);
    mTabsContainer.setOrientation(LinearLayout.HORIZONTAL);
    addView(mTabsContainer);

    mRectPaint = new Paint();
    mRectPaint.setAntiAlias(true);
    mRectPaint.setStyle(Style.FILL);
    mPaintLine = new Paint();
    mPaintLine.setStyle(Style.FILL);
    mPaintLine.setAntiAlias(true);

    //
    DisplayMetrics dm = getResources().getDisplayMetrics();
    mScrollOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mScrollOffset, dm);
    mIndicatorHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mIndicatorHeight, dm);
    mUnderlineHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mUnderlineHeight, dm);
    mDividerPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mDividerPadding, dm);
    mTabPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mTabPadding, dm);
    mDividerWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mDividerWidth, dm);
    mTabTextSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, mTabTextSize, dm);
    // ?
    mDividerPaint = new Paint();
    mDividerPaint.setAntiAlias(true);
    mDividerPaint.setStrokeWidth(mDividerWidth);

    // get system attrs for container?
    TypedArray a = context.obtainStyledAttributes(attrs, ANDROID_ATTRS);
    int textPrimaryColor = a.getColor(TEXT_COLOR_PRIMARY, getResources().getColor(android.R.color.black));
    mUnderlineColor = textPrimaryColor;
    mDividerColor = textPrimaryColor;
    mBaseLineColor = textPrimaryColor;
    mIndicatorColor = textPrimaryColor;
    int padding = a.getDimensionPixelSize(PADDING_INDEX, 0);
    mPaddingLeft = padding > 0 ? padding : a.getDimensionPixelSize(PADDING_LEFT_INDEX, 0);
    mPaddingRight = padding > 0 ? padding : a.getDimensionPixelSize(PADDING_RIGHT_INDEX, 0);
    a.recycle();

    String tabTextTypefaceName = "sans-serif";
    // Use Roboto Medium as the default typeface from API 21 onwards
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        tabTextTypefaceName = "sans-serif-medium";
        mTabTextTypefaceStyle = Typeface.NORMAL;
    }

    // get custom attrs for tabs and container ?attr?
    a = context.obtainStyledAttributes(attrs, R.styleable.ViewPagerDoubleIndicator);
    mBaseLineColor = a.getColor(R.styleable.ViewPagerDoubleIndicator_vpdiBaseLineColor, mBaseLineColor);
    mIndicatorColor = a.getColor(R.styleable.ViewPagerDoubleIndicator_vpdiIndicatorColor, mIndicatorColor);
    mIndicatorHeight = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiIndicatorHeight,
            mIndicatorHeight);
    mUnderlineColor = a.getColor(R.styleable.ViewPagerDoubleIndicator_vpdiUnderlineColor, mUnderlineColor);
    mUnderlineHeight = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiUnderlineHeight,
            mUnderlineHeight);
    mDividerColor = a.getColor(R.styleable.ViewPagerDoubleIndicator_vpdiDividerColor, mDividerColor);
    mDividerWidth = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiDividerWidth,
            mDividerWidth);
    mDividerPadding = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiDividerPadding,
            mDividerPadding);
    isExpandTabs = a.getBoolean(R.styleable.ViewPagerDoubleIndicator_vpdiShouldExpand, isExpandTabs);
    mScrollOffset = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiScrollOffset,
            mScrollOffset);
    isPaddingMiddle = a.getBoolean(R.styleable.ViewPagerDoubleIndicator_vpdiPaddingMiddle, isPaddingMiddle);
    isHorizontalSplit = a.getBoolean(R.styleable.ViewPagerDoubleIndicator_vpdiHorizontalSplit,
            isHorizontalSplit);
    mTabPadding = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiTabPaddingLeftRight,
            mTabPadding);
    mTabBackgroundResId = a.getResourceId(R.styleable.ViewPagerDoubleIndicator_vpdiTabBackground,
            mTabBackgroundResId);
    mTabTextSize = a.getDimensionPixelSize(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextSize, mTabTextSize);
    mTabTextColor = a.hasValue(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextColor)
            ? a.getColorStateList(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextColor)
            : null;
    mTabTextColorUnSelected = a.hasValue(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextColorUnSelected)
            ? a.getColorStateList(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextColorUnSelected)
            : null;
    mTabTextTypefaceStyle = a.getInt(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextStyle,
            mTabTextTypefaceStyle);
    isTabTextAllCaps = a.getBoolean(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextAllCaps, isTabTextAllCaps);
    int tabTextAlpha = a.getInt(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextAlpha,
            DEF_VALUE_TAB_TEXT_ALPHA);
    String fontFamily = a.getString(R.styleable.ViewPagerDoubleIndicator_vpdiTabTextFontFamily);
    a.recycle();

    //Tab text color selector
    if (mTabTextColor == null) {
        mTabTextColor = createColorStateList(textPrimaryColor, textPrimaryColor, Color.argb(tabTextAlpha,
                Color.red(textPrimaryColor), Color.green(textPrimaryColor), Color.blue(textPrimaryColor)));
    }

    //Tab text typeface and style
    if (fontFamily != null) {
        tabTextTypefaceName = fontFamily;
    }
    mTabTextTypeface = Typeface.create(tabTextTypefaceName, mTabTextTypefaceStyle);

    //Bottom padding for the tabs container parent view to show indicator and underline
    setTabsContainerParentViewPaddings();

    //Configure tab's container LayoutParams for either equal divided space or just wrap tabs
    //?Viewlayout? TODO
    if (isHorizontalSplit) {
        mTabLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT,
                1f);//?view
    } else {
        mTabLayoutParams = isExpandTabs ? new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f)
                : new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);//?view
    }
}

From source file:com.stasbar.knowyourself.timer.CountingTimerView.java

public CountingTimerView(Context context, AttributeSet attrs) {
    super(context, attrs);
    mAccessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
    Resources r = context.getResources();
    mDefaultColor = mWhiteColor = ContextCompat.getColor(context, R.color.colorPrimary);
    mPressedColor = mAccentColor = ContextCompat.getColor(context, R.color.colorPrimary);
    mBigFontSize = r.getDimension(R.dimen.big_font_size);
    mSmallFontSize = r.getDimension(R.dimen.small_font_size);

    mPaintBigThin.setAntiAlias(true);//from   ww w . j  av a 2  s. c  om
    mPaintBigThin.setStyle(Paint.Style.STROKE);
    mPaintBigThin.setTextAlign(Paint.Align.CENTER);
    mPaintBigThin.setTypeface(Typeface.create("sans-serif-thin", Typeface.NORMAL));

    mPaintMed.setAntiAlias(true);
    mPaintMed.setStyle(Paint.Style.STROKE);
    mPaintMed.setTextAlign(Paint.Align.CENTER);
    mPaintMed.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));

    resetTextSize();
    setTextColor(mDefaultColor);

    // allDigits will contain ten digits: "0123456789" in the default locale
    final String allDigits = String.format(Locale.getDefault(), "%010d", 123456789);
    mBigSeconds = new UnsignedTime(mPaintBigThin, 0.f, allDigits);
    mBigHours = new SignedTime(mBigSeconds, HOURS_MINUTES_SPACING);
    mBigMinutes = new SignedTime(mBigSeconds, HOURS_MINUTES_SPACING);
    mMedHundredths = new Hundredths(mPaintMed, HUNDREDTHS_SPACING, allDigits);

    mRadiusOffset = Utils.calculateRadiusOffset(r);
}

From source file:org.cocos2dx.lib.Cocos2dxBitmap.java

private static Paint newPaint(String fontName, int fontSize, int alignment) {
    Paint paint = new Paint();
    paint.setColor(Color.WHITE);/*from  www. ja  v  a 2s. com*/
    paint.setTextSize(fontSize);
    paint.setAntiAlias(true);

    /*
     * Set type face for paint, now it support .ttf file.
     */
    if (fontName.endsWith(".ttf")) {
        try {
            //Typeface typeFace = Typeface.createFromAsset(context.getAssets(), fontName);
            Typeface typeFace = Cocos2dxTypefaces.get(context, fontName);
            paint.setTypeface(typeFace);
        } catch (Exception e) {
            Log.e("Cocos2dxBitmap", "error to create ttf type face: " + fontName);

            /*
             * The file may not find, use system font
             */
            paint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));
        }
    } else {
        paint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));
    }

    int hAlignment = alignment & 0x0F;
    switch (hAlignment) {
    case HALIGNCENTER:
        paint.setTextAlign(Align.CENTER);
        break;

    case HALIGNLEFT:
        paint.setTextAlign(Align.LEFT);
        break;

    case HALIGNRIGHT:
        paint.setTextAlign(Align.RIGHT);
        break;

    default:
        paint.setTextAlign(Align.LEFT);
        break;
    }

    return paint;
}

From source file:android.support.v7.widget.AppCompatTextHelper.java

private void updateTypefaceAndStyle(Context context, TintTypedArray a) {
    mStyle = a.getInt(R.styleable.TextAppearance_android_textStyle, mStyle);

    if (a.hasValue(R.styleable.TextAppearance_android_fontFamily)
            || a.hasValue(R.styleable.TextAppearance_fontFamily)) {
        mFontTypeface = null;/*w  w w .  ja  v  a2 s. co  m*/
        int fontFamilyId = a.hasValue(R.styleable.TextAppearance_fontFamily)
                ? R.styleable.TextAppearance_fontFamily
                : R.styleable.TextAppearance_android_fontFamily;
        if (!context.isRestricted()) {
            final WeakReference<TextView> textViewWeak = new WeakReference<>(mView);
            ResourcesCompat.FontCallback replyCallback = new ResourcesCompat.FontCallback() {
                @Override
                public void onFontRetrieved(@NonNull Typeface typeface) {
                    onAsyncTypefaceReceived(textViewWeak, typeface);
                }

                @Override
                public void onFontRetrievalFailed(int reason) {
                    // Do nothing.
                }
            };
            try {
                // Note the callback will be triggered on the UI thread.
                mFontTypeface = a.getFont(fontFamilyId, mStyle, replyCallback);
                // If this call gave us an immediate result, ignore any pending callbacks.
                mAsyncFontPending = mFontTypeface == null;
            } catch (UnsupportedOperationException | Resources.NotFoundException e) {
                // Expected if it is not a font resource.
            }
        }
        if (mFontTypeface == null) {
            // Try with String. This is done by TextView JB+, but fails in ICS
            String fontFamilyName = a.getString(fontFamilyId);
            if (fontFamilyName != null) {
                mFontTypeface = Typeface.create(fontFamilyName, mStyle);
            }
        }
        return;
    }

    if (a.hasValue(R.styleable.TextAppearance_android_typeface)) {
        // Ignore previous pending fonts
        mAsyncFontPending = false;
        int typefaceIndex = a.getInt(R.styleable.TextAppearance_android_typeface, SANS);
        switch (typefaceIndex) {
        case SANS:
            mFontTypeface = Typeface.SANS_SERIF;
            break;

        case SERIF:
            mFontTypeface = Typeface.SERIF;
            break;

        case MONOSPACE:
            mFontTypeface = Typeface.MONOSPACE;
            break;
        }
    }
}

From source file:com.cyanogenmod.effem.FmRadio.java

/**
 * Sets up the buttons and their listeners
 *//*w  w w.  j a  v  a  2s  .c om*/
private void setupButtons() {
    // populate favorites menu
    mMenuAdapter = new ArrayAdapter<MenuTuple>(this, android.R.layout.simple_spinner_item);

    try {
        SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
        JSONObject conf = new JSONObject(settings.getString("stations", ""));
        JSONArray stations = conf.getJSONArray("stations");
        for (int i = 0; i < stations.length(); i++) {
            MenuTuple mt = MenuTuple.fromJSON(stations.getJSONObject(i));
            mMenuAdapter.add(mt);
        }
    } catch (JSONException e) {
        Log.e(LOG_TAG, "Failed to load station list");
    }

    // get references to buttons
    mFrequencyTextView = (TextView) findViewById(R.id.FrequencyTextView);
    mStationNameTextView = (TextView) findViewById(R.id.PSNTextView);
    mStationInfoTextView = (TextView) findViewById(R.id.RTTextView);
    mProgramTypeTextView = (TextView) findViewById(R.id.PTYTextView);
    final ImageButton scanUp = (ImageButton) findViewById(R.id.ScanUp);
    final ImageButton scanDown = (ImageButton) findViewById(R.id.ScanDown);
    final ImageButton pause = (ImageButton) findViewById(R.id.Pause);
    final ImageButton favorite = (ImageButton) findViewById(R.id.Favorite);
    mStationInfoTextView.setSelected(true);

    // set typeface for station frequency widget
    // this is done here instead of layout xml to keep ICS compatibility
    mFrequencyTextView.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));

    scanUp.setOnLongClickListener(new OnLongClickListener() {
        public boolean onLongClick(View v) {
            scanUp.setEnabled(false);
            mWorkerHandler.post(new Runnable() {
                public void run() {
                    mService.changeFrequency(FmRadioService.SEEK_STEPUP, 0);
                }
            });
            return true;
        }
    });

    scanDown.setOnLongClickListener(new OnLongClickListener() {
        public boolean onLongClick(View v) {
            scanDown.setEnabled(false);
            mWorkerHandler.post(new Runnable() {
                public void run() {
                    mService.changeFrequency(FmRadioService.SEEK_STEPDOWN, 0);
                }
            });
            return true;
        }
    });

    scanUp.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            mWorkerHandler.post(new Runnable() {
                public void run() {
                    mService.startRadio(mSelectedBand, mCurrentFrequency, mSelectedOutput);
                    if (mService.isStarted())
                        mService.changeFrequency(FmRadioService.SEEK_SCANUP, 0);
                }
            });
            scanUp.setEnabled(false);
        }
    });

    scanDown.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            mWorkerHandler.post(new Runnable() {
                public void run() {
                    mService.startRadio(mSelectedBand, mCurrentFrequency, mSelectedOutput);
                    if (mService.isStarted())
                        mService.changeFrequency(FmRadioService.SEEK_SCANDOWN, 0);
                }
            });
            scanDown.setEnabled(false);
        }
    });

    pause.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            if (mService.isStarted())
                mService.stopRadio();
            else {
                mWorkerHandler.post(new Runnable() {
                    public void run() {
                        mService.startRadio(mSelectedBand, mCurrentFrequency, mSelectedOutput);
                    }
                });
            }
        }
    });

    favorite.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            toggleFavorite(v, mCurrentFrequency);
        }
    });
}

From source file:com.appeaser.sublimepickerlibrary.datepicker.SimpleMonthView.java

/**
 * Sets up the text and style properties for painting.
 *//*from   w  w w . ja  v a2 s . co  m*/
private void initPaints(Resources res) {
    final String monthTypeface = res.getString(R.string.sp_date_picker_month_typeface);
    final String dayOfWeekTypeface = res.getString(R.string.sp_date_picker_day_of_week_typeface);
    final String dayTypeface = res.getString(R.string.sp_date_picker_day_typeface);

    final int monthTextSize = res.getDimensionPixelSize(R.dimen.sp_date_picker_month_text_size);
    final int dayOfWeekTextSize = res.getDimensionPixelSize(R.dimen.sp_date_picker_day_of_week_text_size);
    final int dayTextSize = res.getDimensionPixelSize(R.dimen.sp_date_picker_day_text_size);

    mMonthPaint.setAntiAlias(true);
    mMonthPaint.setTextSize(monthTextSize);
    mMonthPaint.setTypeface(Typeface.create(monthTypeface, 0));
    mMonthPaint.setTextAlign(Paint.Align.CENTER);
    mMonthPaint.setStyle(Paint.Style.FILL);

    mDayOfWeekPaint.setAntiAlias(true);
    mDayOfWeekPaint.setTextSize(dayOfWeekTextSize);
    mDayOfWeekPaint.setTypeface(Typeface.create(dayOfWeekTypeface, 0));
    mDayOfWeekPaint.setTextAlign(Paint.Align.CENTER);
    mDayOfWeekPaint.setStyle(Paint.Style.FILL);

    mDaySelectorPaint.setAntiAlias(true);
    mDaySelectorPaint.setStyle(Paint.Style.FILL);

    mDayHighlightPaint.setAntiAlias(true);
    mDayHighlightPaint.setStyle(Paint.Style.FILL);

    mDayRangeSelectorPaint.setAntiAlias(true);
    mDayRangeSelectorPaint.setStyle(Paint.Style.FILL);

    mDayPaint.setAntiAlias(true);
    mDayPaint.setTextSize(dayTextSize);
    mDayPaint.setTypeface(Typeface.create(dayTypeface, 0));
    mDayPaint.setTextAlign(Paint.Align.CENTER);
    mDayPaint.setStyle(Paint.Style.FILL);
}

From source file:com.appsummary.luoxf.myappsummary.navigationtabstrip.NavigationTabStrip.java

public void setTypeface(final String typeface) {
    Typeface tempTypeface;/*from  w w  w . ja v a  2 s .  c o  m*/
    try {
        tempTypeface = Typeface.createFromAsset(getContext().getAssets(), typeface);
    } catch (Exception e) {
        tempTypeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL);
        e.printStackTrace();
    }

    setTypeface(tempTypeface);
}

From source file:ir.blue_saffron.persianmaterialdatetimepicker.date.MonthView.java

/**
 * Sets up the text and style properties for painting. Override this if you
 * want to use a different paint./*  w  w w  . j  a v a  2s.com*/
 */
protected void initView() {
    mMonthTitlePaint = new Paint();
    mMonthTitlePaint.setFakeBoldText(true);
    mMonthTitlePaint.setAntiAlias(true);
    mMonthTitlePaint.setTextSize(MONTH_LABEL_TEXT_SIZE);
    mMonthTitlePaint.setTypeface(Typeface.create(mMonthTitleTypeface, Typeface.BOLD));
    mMonthTitlePaint.setColor(mDayTextColor);
    mMonthTitlePaint.setTextAlign(Align.CENTER);
    mMonthTitlePaint.setStyle(Style.FILL);

    mSelectedCirclePaint = new Paint();
    mSelectedCirclePaint.setFakeBoldText(true);
    mSelectedCirclePaint.setAntiAlias(true);
    mSelectedCirclePaint.setColor(mTodayNumberColor);
    mSelectedCirclePaint.setTextAlign(Align.CENTER);
    mSelectedCirclePaint.setStyle(Style.FILL);
    mSelectedCirclePaint.setAlpha(SELECTED_CIRCLE_ALPHA);

    mMonthDayLabelPaint = new Paint();
    mMonthDayLabelPaint.setAntiAlias(true);
    mMonthDayLabelPaint.setTextSize(MONTH_DAY_LABEL_TEXT_SIZE);
    mMonthDayLabelPaint.setColor(mMonthDayTextColor);
    //        mMonthDayLabelPaint.setTypeface(TypefaceHelper.get(getContext(),"Roboto-Medium")); //TODO: Changed Here.
    mMonthDayLabelPaint.setStyle(Style.FILL);
    mMonthDayLabelPaint.setTextAlign(Align.CENTER);
    mMonthDayLabelPaint.setFakeBoldText(true);

    mMonthNumPaint = new Paint();
    mMonthNumPaint.setAntiAlias(true);
    mMonthNumPaint.setTextSize(MINI_DAY_NUMBER_TEXT_SIZE);
    mMonthNumPaint.setStyle(Style.FILL);
    mMonthNumPaint.setTextAlign(Align.CENTER);
    mMonthNumPaint.setFakeBoldText(false);
}

From source file:com.appsimobile.appsii.module.appsiagenda.MonthView.java

/**
 * Sets up the text and style properties for painting. Override this if you
 * want to use a different paint./*  ww  w  . j a v a 2s.  c  o  m*/
 */
protected void initView() {
    mMonthTitlePaint = new Paint();
    mMonthTitlePaint.setFakeBoldText(true);
    mMonthTitlePaint.setAntiAlias(true);
    mMonthTitlePaint.setTextSize(MONTH_LABEL_TEXT_SIZE);
    mMonthTitlePaint.setTypeface(Typeface.create(mMonthTitleTypeface, Typeface.BOLD));
    mMonthTitlePaint.setColor(mMonthTitleColor);
    mMonthTitlePaint.setTextAlign(Align.CENTER);
    mMonthTitlePaint.setStyle(Style.FILL);

    mMonthTitleBGPaint = new Paint();
    mMonthTitleBGPaint.setFakeBoldText(true);
    mMonthTitleBGPaint.setAntiAlias(true);
    mMonthTitleBGPaint.setColor(mMonthTitleBGColor);
    mMonthTitleBGPaint.setTextAlign(Align.CENTER);
    mMonthTitleBGPaint.setStyle(Style.FILL);

    mSelectedCirclePaint = new Paint();
    mSelectedCirclePaint.setFakeBoldText(true);
    mSelectedCirclePaint.setAntiAlias(true);
    mSelectedCirclePaint.setColor(mTodayNumberColor);
    mSelectedCirclePaint.setTextAlign(Align.CENTER);
    mSelectedCirclePaint.setStyle(Style.FILL);
    mSelectedCirclePaint.setAlpha(SELECTED_CIRCLE_ALPHA);

    mEventDayCirclePaint = new Paint();
    mEventDayCirclePaint.setAntiAlias(true);
    mEventDayCirclePaint.setColor(mDayTextColor);
    mEventDayCirclePaint.setStyle(Style.STROKE);

    mMonthDayLabelPaint = new Paint();
    mMonthDayLabelPaint.setAntiAlias(true);
    mMonthDayLabelPaint.setTextSize(MONTH_DAY_LABEL_TEXT_SIZE);
    mMonthDayLabelPaint.setColor(mDayTextColor);
    mMonthDayLabelPaint.setTypeface(Typeface.create(mDayOfWeekTypeface, Typeface.NORMAL));
    mMonthDayLabelPaint.setStyle(Style.FILL);
    mMonthDayLabelPaint.setTextAlign(Align.CENTER);
    mMonthDayLabelPaint.setFakeBoldText(true);

    mMonthNumPaint = new Paint();
    mMonthNumPaint.setAntiAlias(true);
    mMonthNumPaint.setTextSize(MINI_DAY_NUMBER_TEXT_SIZE);
    mMonthNumPaint.setStyle(Style.FILL);
    mMonthNumPaint.setTextAlign(Align.CENTER);
    mMonthNumPaint.setFakeBoldText(false);
}