Try setting the text value after setting the typeface? It may incorrectly cache the measurement using the view's Paint's font, and not revise that measurement when the typeface is changed.
On Mar 5, 10:38 am, Nikolay Elenkov <nikolay.elen...@gmail.com> wrote: > On Sat, Mar 5, 2011 at 1:10 PM, Nikolay Elenkov > > <nikolay.elen...@gmail.com> wrote: > > Hi, > > I have a TextView displaying a single character, centered inside the view. > > It works fine on all sort of devices, but on Galaxy Tab, the character is > > aligned with the top of the view and slightly clipped. I've reproduced it > > with the emulator, and tried all combination of gravity > > (center_vertical|center_horizontal, etc), with no success. > > OK, this only happens when I use a custom font. This same font works fine on > other devices. Anything obvious I am missing? What I am doing is very simple: > > Typeface tf = Typeface.createFromFile("my-font.ttf"); > myText.setTypeface(tf); > > There are no errors or warnings in logcat. I'm guessing the custom font > somehow > is screwing up text drawing. Is there anyway I can get it redraw the > text? I've tried > with postInvalidate() and requestLayout() with no success. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en