0

I have a contextual action bar which is showing some text. I have changed the font of each and every text in my App expect this cab. I looked for it, but I am unable to find any. Is there any way to change the font of CAB to an external typeface font.?

Here is what I have:

enter image description here

Here is the font I want:

enter image description here

The font is external one, called VTKS-BAGACO.ttf

Durandal
  • 5,575
  • 5
  • 35
  • 49
  • 1
    Oh my god that is unreadable. – Kevin Coppock Feb 24 '14 at 06:16
  • This is relevant: http://stackoverflow.com/a/11277115/321697 – Kevin Coppock Feb 24 '14 at 06:17
  • @kcoppock Actually I have another font to use which is not very different from the default Android font. So I am using this one right now so that I can easily understand all those who have changed. –  Feb 24 '14 at 06:19
  • @kcoppock I read that, but that is giving error in my code, at layout inflater. Can you please give an example code for that. –  Feb 24 '14 at 06:25

1 Answers1

1

you need to create external typeface for VTKS-BAGACO. and put it in assets folder. Now use that typeface as below in your activity:

Typeface tf = Typeface.createFromAsset(this.getAssets(), "VTKS-BAGACO.otf");
textview.setTypeface(tf);
  • The method getLayoutInflater() is undefined for the type SingleSelectActionModeCallback. This error is what I am getting When I am entering this: TextView tv= (TextView)getLayoutInflater().inflate(R.menu.advanced_delegations_multiselect, null); Typeface tf = Typeface.createFromAsset(this.getAssets(), "VTKS-BAGACO.otf"); tv.setTypeface(tf); –  Feb 24 '14 at 06:41
  • Nad by the way what is this textview.? –  Feb 24 '14 at 07:14
  • it's your Action bar text, Which you want to change. –  Feb 24 '14 at 07:15
  • But its menu and the shown text is menuitem, not textview –  Feb 24 '14 at 08:26