Code example for TextPaint

Methods: getFontMetricsIntgetTextWidthsset

0
// Jota Text Editor 
//        MetricAffectingSpan[] spans = 
//            text.getSpans(start, end, MetricAffectingSpan.class); 
// 
//		ReplacementSpan replacement = null; 
        workPaint.set(paint);
// 
//		for (int i = 0; i < spans.length; i++) { 
//			MetricAffectingSpan span = spans[i]; 
//			if (span instanceof ReplacementSpan) { 
//				replacement = (ReplacementSpan)span; 
//			} 
//			else { 
//				span.updateMeasureState(workPaint); 
//			} 
//		} 
// 
//        if (replacement == null) { 
            workPaint.getFontMetricsInt(fmi);
            workPaint.getTextWidths(text, start, end, widths);
//        } else { 
//            int wid = replacement.getSize(workPaint, text, start, end, fmi); 
// 
//            if (end > start) { 
//                widths[0] = wid; 
Connect your IDE to all the code out there  Get Codota for Java