That indeed seems to be the issue, on the emulator, they both return
the same size (whereas on my phone, they do not).
Trying to browse the source for Paint, I found that getTextSize is a
native function with a quite useless comment about it returning the
text size. Any idea where I can find C source code?

BR,
Schoel

On 15 Dec, 09:12, Kostya Vasilyev <[email protected]> wrote:
> The mismatch is by a factor of 1.5.
>
> Which kinda looks like a mismatch between pixel and dp units of an hdpi
> (240 dpi) device.
>
> In what context is this code run? Is this a subclass of TextView?
>
> I'd recommend you take a look at the source, to see if these methods
> actually scale text size, you might discover something interesting.
>
> In particular, TextView getSize returns pixels, but setSize assumes the
> value is in SP units, and scales it.
>
> http://netmite.com/android/mydroid/1.0/frameworks/base/core/java/andr...
>
> -- Kostya
>
> 15.12.2010 10:45, Schoel пишет:
>
>
>
> > I can provide some additional information here:
> > m_TestPaint = new Paint();
> > m_TestPaint.set(getPaint());
> > m_MaxTextSize = getTextSize();
> > m_TestPaint.setTextSize(m_MaxTextSize);
> > Log.e("FintFit", "Paint text size: " + m_TestPaint.getTextSize());
> > Log.e("FintFit", "Text text size: " + getTextSize());
>
> > This outputs 42.0 and 63.0 respectively. That doesn't seem right, does
> > it? Why isn't the Paint respecting the size I set to it?
>
> > Zsolt: Thanks for the offer but I can't send you my .apk as this code
> > is part of a closed source project.
>
> > BR,
> > Schoel
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

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