I am wondering if it is possible to set the font weight without setting a custom font for Textview. Because i can see that android:textFontWeight attribute works fine when i am using with a custom font but if i don't set any custom font for the textview it just doesn't work.
PS: I don't want to use a custom font
Do you guys came across this before?
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 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 am developing an android application and I strongly need to use Justify text alignment and also I should use custom font for texts. my application is in Persian language.
If I use TextView for showing texts I cant set text alignment to Justify.
If I use WebView and load html to it I cant use font for it (I know that I can set font using html and css but it does not work for some languages like Persian and Arabic , I tested it, only on android 4.4.2 i see my custom font but on other versions of android webview show android default font)
I tried converting font to SVG but nothings changed.
also I searched in github for a custom webview or textview , I fount one custom textView , both font and text alignment was ok but the direction was left to right but i need it be right to left (I tried changing gravity and other things but cant fix problem).
So what is your suggestion ?
Thank you so much for helping.
Regards.
Take a look at this forum.I used this library with the following attrs and everything works perfectly:
ext:documentView_reverse="true"
ext:documentView_textAlignment="justified"
ext:documentView_textFormat="formatted"
Is it possible to set a custom font as default in a android application? Because typing this for every TextView is not efficient.
login = (TextView)findViewById(R.id.tvLogin);
login.setTypeface(titleFont);
Is it possible to set a custom font as default in a android application?
Not for a custom Typeface that you loaded from your own font file, sorry. As others have noted, there are workarounds and libraries to help simplify matters a bit. Personally, I'd look at Calligraphy or perhaps Fontify.
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.