My app uses a custom View that does a lot of text drawing.  To ensure
my text is always readable I've been using the result of calling
getTextSize() on a newly-created Paint() instance as the minimum
size.  Docs say calling 'new Paint()' sets attributes like text size
to default values.

One of my European users just got a Motorola Milestone phone and
reports that some text is unreadably small.  I believe I've duplicated
this using the WVGA854 skin in a 2.1 emulator.  Run in that emulator
my app's smallest TextViews look fine, but the text I'm drawing myself
using Paint instances where I haven't changed the text size from the
default is too small.  I confirmed this by commenting out all
setTextSize() calls in my View subclass: the text becomes too small to
read comfortably.

It feels like a bug to me that the default text size on Paint can be
significantly smaller than default TextView size on some devices.  Is
it a known bug?

In the meantime, can someone suggest a way to size Paint text so that
it's readable on any device regardless of screen resolution?  I
believe there are APIs to translate inches to pixels, so perhaps I
could hard-code a size in inches.  Or I could measure the laid-out
height of a TextView and store that as an invisible preference.  But
is there a better way, say an API I haven't found?  (I suspect it'd be
enough if Paint were like TextView in allowing you to specify the
units in which text size is set, but it doesn't.)

Thanks,

--Eric

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to