Created
December 29, 2014 17:41
-
-
Save cuber5566/f28f37ba18e9f876dbcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cuber.uidemo; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.graphics.Typeface; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** | |
* Created by Cuber on 2014/12/21. | |
*/ | |
public class CuberView extends View { | |
private Paint mPaint; | |
public CuberView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
mPaint = new Paint(); | |
mPaint.setStrokeWidth(2); | |
mPaint.setStyle(Paint.Style.STROKE); | |
mPaint.setTextSize(600); | |
mPaint.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/wt071.ttf")); | |
} | |
@Override | |
protected void onDraw(Canvas canvas) { | |
Rect rect = canvas.getClipBounds(); | |
canvas.drawText("風",200, 500, mPaint); | |
super.onDraw(canvas); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment