Code example for TextPaint

Methods: getFontMetricsInt

0
		super.onConfigurationChanged(newConfig);
		this.invalidate();
	} 
 
	private int getLineHeight() { 
		return Math.round(mTextPaint.getFontMetricsInt(mTextPaint
				.getFontMetricsInt()));
	} 
 
	/** 
	 * Calculates text length based on max width of the view. It will return the 
	 * last space index on text based on the view width. 
	 *  
	 * @param text 
	 *            whole text to be written on view. 
	 * @param maxWidth 
	 *            view max width available to write the text. 
	 * @return the last space index on text based on the width value. 
	 */ 
	private int getTextSlice(String text, float maxWidth) {
		int length = mTextPaint.breakText(text, true, maxWidth, null);