Code example for Paint

Methods: getFontMetricsgetTextSizemeasureText

0
	private Bitmap createBitmapToRender() {
		float width = 1;
		float height = 1;
		 
		if (text.length() > 0) {  
			width = paint.measureText(text);
			height = paint.getTextSize();
		} 
		 
		Bitmap bitmap = Bitmap.createBitmap(Math.round(width), Math.round(height), Bitmap.Config.ARGB_4444);
		bitmap.eraseColor(0x00000000);
		bitmap.setDensity(res.getDisplayMetrics().densityDpi);
		Canvas canvas = new Canvas(bitmap);
		canvas.drawText(text, 0, height - paint.getFontMetrics().bottom, paint);
		return bitmap;
	} 
 
	@Override 
	public void init(GL10 gl, int program) {
		sprite.init(gl, program);
Connect your IDE to all the code out there  Get Codota for Java