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
font)
as big is possible inside a supplied rectangle or to calculate the
font
size of a paint object based on a string and some rectangle
dimensions.

Thanks in advance
Michael
--~--~---------~--~----~------------~-------~--~----~



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
getTextBounds

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. Library problems

Hi,

I tried to build test library and test app howver Eclipse complains on
each reference I made to library classes.
This is what I did:

1. created Test Library Android project, marked it as "Library"
(package name "test.library.lib")
2. created Test App project (package "test.library.app") and set it to
use Test Library
3. Test Library got LibActivity class which simply referes to
lib_main.xml layout
4. I defined that activity in Test App manifest file:

        <activity android:name="test.library.lib.LibActivity"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.Dialog"
                                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

The problem is that Eclipse now compains "Class
test.library.lib.LibActivity" does not exists".
I also got same problem when I i.e. create a class in Test App that
refers to classes
in library. Import test.library.lib.*; does not help. SDK version is
recent. Target sdk=3 (tried
setting to 8, but made no difference)

What am I doing wrong?

-- 

2. DO NOT INSTALL ANY HTC UPDATES OVER THE WEEKEND IF YOU WANT ROOT

42turk...@xda

INSTALLING THE UPDATE WILL WIPE YOUR ROOT AND YOU MAY NEVER BE ABLE TO ROOT
AGAIN.
(Copy + paste that warning into your sig )

The update will either come in one of these formats:
A PB99IMG . zip which can be flashed in HBOOT mode OTA
An RUU to run on your computer
A zip to flash in recovery which will ' patch' existing files to bring them
up
to date. ( This is the one which it will probably be)

LATEST NEWS :
Fri 8 : 31 GMT - HTC NL posts on their official Facebook page : http: //
bit.ly /
aK 9 RQw
Follow @ rootmydroid on Twitter for the very latest information.

FAQ :
I'm Rooted and I still want the official update after reading the warning .
1 ) Make a goldcard using this guide ( For Desire too )
2 ) Download this
3 ) Double click it and follow the instructions .
4 ) When the update is ready to be pushed out , you will get a notification
.

I got the update notification! How can I find out the link ?
You will need to download an app of the market called ' Log Collector'
before
you get the notification . Then , after selecting accept and it starts
downloading,
run the log collector app and email it to yourself . Then post the output of
the
email here and email it to me and I will pick
out the link for you .

I want to keep my root but still have the update.
As soon as we get a link, it will be a race to see who can be the first to
release
the update. You can help by. ..

I want to help people root the update!
If the update comes in the form of an RUU or PB99IMG . zip , I will be able
to
instantly root & upload it . However , if the update is in the form of a
patch zip ,
someone will have to install the update and use busybox to tar it , or a dev
will
have to patch the files with the originals.

I have the update, I want to tar it .
1 ) Install Android SDK or simply adb
2 ) Download busybox for Android
3 ) Launch Windows console (cmd ) and go to the directory where busybox is
with the "cd path /to/the/file " command .
4 ) "adb devices" < - Is your device detected ? If not , install HTC Sync //
Of
course , before you have to plug your device in .. . (Sync mode I guess )
5 ) "adb push busybox /data /local/busybox
6 ) "adb shell "
7 ) "cd /sdcard/"
8 ) "chmod 755 /data /local/busybox" (something like that )
9 ) "/data /local/busybox tar cvf dump .tar /system"
10) When it ' s finished , you will have a normal error like ' tar : error
exit delayed
from previous errors' .
11) Compress it and then upload it . Feel like a rock star.

Jargon Buster :
RUU - Rom Update Utility - Official HTC Programs used to update or restore
your phone from a computer
ADB ( logcat ) - Android Device (or Debug) Bridge - A command line tool to
manage your phone from a computer. ADB logcat is the system log of your
phone which displays the URL of the update when you get the notification.
__________________
.co . uk
N 00b Friendly Guides , News & More. ..
DO NOT INSTALL ANY HTC UPDATES OVER THE WEEKEND IF YOU WANT
ROOT!

Note:
Update official FroYo baru di negara eropa
Ane dah minta tlg cek HH ane ke bro 42turkey
Jawabannya kayak gini

Max Marroni 142turk...@gmail.com
To: Ocu Mudo

Did you actually get a notification to update? I don't see anything.

hTC Desire FroYoSENSE UIROM: 2.06.832.1
KERNEL: 2.6.32.15
RADIO: 32.42.00.32U_5.09.00.08
Built: FRF91

-- 
"Indonesian Android Community [id-android]" 

3. APIDemos Is sample SaveRestoreState incomplete?

4. How to get handle to ImageView in a ListItem

5. Library development - Development requirements

6. Synchronize animations on multiple view

7. Library development - Development requirements