Is there another way to use custom fonts than use "setTypeface"
directly on your view like in the following code lines?

typeface = Typeface.createFromAsset(context.getAssets(), "fonts/
xyz.TTF");
textview.setTypeface(typeface);

The best way to use a custom font I can imagine is by setting it
globally in your theme style. But it seems to be impossible to define
your settings in xml.
To avoid an exessive usage of the findViewById method, which is also
told to be quite expensive, the next preferred way would be to
override your View classes and use them in your xml (reduces the
amount of java code).

I tried to override TextView and set the font in the constructor. This
is working quite good but textstyles like "bold" or italic" got lost
this way although I tried to keep it by mappig the constructor
Parameter "AttributeSet attr" by "setTypeface(typeface,
attr.textStyle);" or by overriding the method "setTypeface (Typeface
tf)"; by "setTypeface(typeface, tf.getStyle());"
That was not working.

So has somebody figured out a way to solve this issue? Thanks in
advance.

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