Ok my first question is:
Is there a way to change the font on everything in my app? I mean to put for ex the font x.ttf to be the default font for all the buttons,listviews,for everything that is in my app? And if yes,how?
And my second question:
If that is not possible,then please tell me how to change the font on the Tab widget...
Thanks
Still There is no way to change the font for a complete application. All You can do is for Text Views create custom Text View and override the font method. Then you can use the customized text view rather than using the default text view.
This is the way I used the font Helvetica for My app.
Related
Well, I'm making one Android app which can display Time and Date in App Widget(in HomeScreen).
I Loaded my Font under Assets -> Fonts.
Even after trying with FontFamily it doesn't work.
I'm sure font family doesn't work in widgets. I don't have any idea about this.
Thanks for your Help :)
Setting fontFamily in a homescreen widget layout file, like this
android:fontFamily="#font/cherry_swash"
does correctly display a custom font in homescreen widget TextViews with Android O and P, but not with earlier versions.
I am trying to create app which provide text formatting (like font style , font size , font color). So I want default fonts provided by android as a list to be shown in drop-down. Selecting font from drop-down will change the Text dynamically.
Can anyone help , how can I achieve this either via XML or programmatically ?
See the image how it must look like
font list is saved in Typeface class as a static field Map<Stirng, Typeface> sSystemFontMap. you just need to get this field. See my answer here.
There are only three system wide fonts in Android SDK.
normal
serif
monospace
More info : click here
I am using floatlabelededittext in my application. My requirement is to set 2 different fonts for hint and text. Is it possible? Then how?
To have 2 different fonts for text and hint you need to use custom TypefaceSpan.
Set a font to a text by using usual setTypeface method
Set a font to a hint by using SpannableString
I already answered to that question Android EditText hint uses the same font that the EditText has
You can also keep the same font and change the hint's size and style independently. To know how, please, see my answer here
I don't think it is possible right now. But if you look at the source code of floatlabeledittext here https://github.com/wrapp/floatlabelededittext/blob/master/library/src/com/wrapp/floatlabelededittext/FloatLabeledEditText.java you see that it will be easy to add such feature.
All you need to do is to use setTypeface on the hint label mHintTextView.
I changed the font in my application to a custom font, but I don't know how to change the font in Android Studio in the design view, where you can drag n drop buttons, textviews, etc.... Any ideas? Because of this I can't position correctly the buttons on my layout, because it's different in emulator, and different in design view. Thanks for help!
If you want to use the custom font in android you have to add that font in assets and use it from there. Use these links 1 & 2 hope this can help
You can't set custom font at design view. you set custom font using only java code.
Can I set the default font which is bydefault set in android app irrespective of which font user has selected???
Thanks in advance
As a developer there is no easy way to use a specific font in every screen of your app.
You have to set your custom font on each and every UI element. This is explained here.
Alternatively you can use this CustomFont helper class to change every UI elemnt for you.