boundingRectWithSize similar function in android
<p><code>boundingRectWithSize</code> is an API on iOS which will calculate the size of a string constrained to a given width and height. Is there a similar function on Android?</p>

<pre><code>- (CGRect)boundingRectWithSize:(CGSize)size 
                       options:(NSStringDrawingOptions)options 
                    attributes:(NSDictionary&lt;NSString *,id&gt; *)attributes 
                       context:(NSStringDrawingContext *)context;
</code></pre>

<p><a href="https://developer.apple.com/reference/foundation/nsstring/1524729-boundingrectwithsize" rel="nofollow noreferrer">https://developer.apple.com/reference/foundation/nsstring/1524729-boundingrectwithsize</a></p>