On Sat, May 5, 2012 at 1:23 PM, x300 <[email protected]> wrote:
> Thank you very much for the response.  It almost worked.

Almost who-hoo!

:-)

> Please check the following code if I implemented your method as you
> intended:

Yeah, you did, but Android messed me up. It can take a Spanned with
font sizes and *generate* <font size="">. However, at least with the
current code in the repo, it won't *parse* <font size="">, though I
think it used to.

Phooey.

> Am I doing it right?
> The reference for Html.fromHtml says "Returns displayable styled text
> from the provided HTML string.", which leaves the question of
> "displayable by what", other than TextView and Button.

Anything inheriting from TextView handles Spanned, and I think the 2D
drawing stuff can do it too.

> Although "final void TextView.setText(Spanned string)" is not
> documented, either

Yes it is. CharSequence is a super-interface of Spanned.

> the fact that this trick did not cause any anomaly
> nor create error makes the whole picture even more frustrating as I
> thought and appreciated your idea as being marvelous.

Yeah, you'll have to do it the hard way, using SpannableString or
SpannableStringBuilder, using an AbsoluteSizeSpan or a
RelativeSizeSpan to change the font sizes. This is more tedious and
wordy, but has the advantage of being faster and not being tied to the
implementation of fromHtml().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.7 Available!

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