draw text as big as possible inside a rectangle

by Michael Bollmann » Sat, 11 Apr 2009 21:42:08 GMT

Sponsored Links
 Is there any convenient method to draw a string (custom true type
as big is possible inside a supplied rectangle or to calculate the
size of a paint object based on a string and some rectangle

Thanks in advance

draw text as big as possible inside a rectangle

by Michael Bollmann » Tue, 14 Apr 2009 00:08:17 GMT

 thanks for your reply

in case anyone runs into the same problem i solved it using

1. calculate the scale factor between your original rect and the rect
returned by getTextBounds
2. multiply the font size by this factor

Sponsored Links

Other Threads

1. Audio Settings Permission Denial

I am attempting to enable/disable bluetooth support in my app, like

        AudioManager am = (AudioManager) getSystemService


And when I make that call, I get:

09-25 22:42:20.290: WARN/AudioService(586): Audio Settings Permission
Denial: setRouting() from pid=847, uid=10019


In my AndroidManifest.xml file I have this:

        <uses-permission android:name="android.permission.BLUETOOTH"></uses-
        <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></

any ideas?


2. Move widget programatically

Hello all,

Is it possible to programatically move a widget through the home


3. display brightness settings from my activity

4. Gimana cara nge-Root, dan Gunanya handset di ROOT apa?

5. How to run GPS based application (WikiTude) in Android SDK Emulator?

6. Freezing and thawing of Views in a Gallery

7. ProgressDialog doesnt show when called...?