drifter
drifter

Reputation: 683

How make font in TextView more thinner?

I want to make font in TextView more thinner. How can I do it?

Upvotes: 2

Views: 2768

Answers (4)

You can do this using a fontFamily:

From xml:

android:fontFamily="sans-serif-light"

Programmatically

textView.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));

Upvotes: 3

Niranj Patel
Niranj Patel

Reputation: 33258

in android only four fonttype-face

TypeFace

Typeface.DEFAULT
Typeface.MONOSPACE
Typeface.SANS_SERIF
Typeface.SERIF

and font-type

Typeface.NORMAL
Typeface.BOLD
Typeface.BOLD_ITALIC
Typeface.ITALIC

you can use like as

textView.setTypeface(Typeface.DEFAULT, Typeface.BOLD);

and other way is you can download any .ttf file and put it in asset folder and use like as this

Typeface type=Typeface.createFromAsset(context.getAssets(),
        "DroidSansMono.ttf");
textView.setTypeface(type, null);

Upvotes: 1

Nibha Jain
Nibha Jain

Reputation: 8161

you can use another typeface as well if you want:

android:typeface="monospace"

or increase the size of the text :

android:textSize="15sp"

Upvotes: 0

Rahul Choudhary
Rahul Choudhary

Reputation: 3809

Have you tried this attribute in your layout xml?

android:height="10dp" //Use as many pixel as you want here

Upvotes: 0

Related Questions