On Tue, Jan 6, 2009 at 7:09 AM, Xiongzh <[email protected]> wrote:

> Say, my font size of the text in TextView is 20.5px.
> It doesn't mean that every character of the text occupies 20.5px in
> the screen, does it?
>

certainly not, the "text size" is only a notional unit. the actual number of
pixels
covered by the text depend on the font design itself.

For example, try writing a document in a word processor that uses the same
words with three
different fonts (e.g. Arial, Times New Roman and Courier New), and see how
each letter has a
different height, even if they use the same font size.


>
> I'm inheriting android.widget.TextView to implement a TextView which
> text can be scrolled automatically. Just as the behavior of the HTML
> <marquee/>.
>
> I need to know the actual pixels the text occupied to determine how
> far I shall scroll the text.
> However the getTextSize() * getText().length() is much longer than the
> actual length of the text, so I can't make the text re-displayed on
> time.
>
> Thank you in advance for helping me.
>
> BR
> xion...@beijing, China
>
> [email protected]
> >
>

--~--~---------~--~----~------------~-------~--~----~
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