android-fonts

Change the font of tab text in android design support TabLayout

喜欢而已 提交于 2019-11-26 19:47:58
I'm trying to work on the new TabLayout from the android design library. I want to change tab text to custom font . And,I tried to search some styling related to TabLayout ,but ended up to this . Please guide how can I change the tab text fonts. Farmaan Elahi Create a TextView from Java Code or XML like this <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@android:id/text1" android:layout_width="match_parent" android:textSize="15sp" android:textColor="@color/tabs_default

how to prevent system font-size changing effects to android application?

天涯浪子 提交于 2019-11-26 17:37:18
I recently finished developing my android application. I used sp (Scaled pixels) for all textSize. The problem is when i adjusted the system font-size, my application's font-sizes are changing. I can use dp (Device independent pixels) but it will take too long to maintain my application. I referenced text size from this . Is there a way to prevent system font-size changing effects to my application ? If you require your text to remain the same size, you'll have to use dp . To quote the documentation : An sp is the same base unit, but is scaled by the user's preferred text size (it’s a scale

How to change the FontSize in an Android WebView?

为君一笑 提交于 2019-11-26 17:29:57
How can you manually change the font size of a webview? e.g. When the page loads up in the webview the font size is like 24pt. and way too large for my android's screen. I've looked into the "websettings" but it seems that the two are not related. Thanks Scott I finally found it:- WebSettings webSettings = webView.getSettings(); either setTextSize or webSettings.setTextSize(WebSettings.TextSize.SMALLEST); This one works too:- webSettings.setDefaultFontSize(10); It seems that nowadays prefered way, ie not depreciated is to change text zoom, like this: WebSettings settings = mWebView.getSettings

How to set font custom font to Spinner text programmatically?

独自空忆成欢 提交于 2019-11-26 16:06:36
I have a ttf font file in my assets folder. I know how to use it for textviews with: Typeface externalFont=Typeface.createFromAsset(getAssets(), "fonts/HelveticaNeueLTCom-Lt.ttf"); textview1.setTypeface(externalFont); I have defined look for my spinner text in it's own xml file (as usuall in android): <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+android:id/text1" style="?android:attr/spinnerItemStyle" android:singleLine="true" android:textColor="#ffffff" android:gravity="center" android:layout_width="fill_parent"

android - install font to android platform without root

十年热恋 提交于 2019-11-26 14:58:06
问题 I develop new app that wrote (coptic) its an old Egyptian language , I need to install specific font to android platform make this language readable . I search if find app do the same function iFont plus when I access font folder, I find its allowable to install font Get fonts online , so how can I install font programatically to this folder thank you 回答1: It is not possible to install new fonts without root, the iFont app only works without root on very few devices (please check their app

What is the best way of installing new font to android emulator?

别来无恙 提交于 2019-11-26 14:44:12
问题 I know there are many questions regarding font installation on android emulator. I'm sharing the method that worked for me as an answer, if anyone have a better way please share it. 回答1: Whenever android fails to find a specific character it looks to DroidSansFallback.ttf , so what you need to do is replace the DroidSansFallback.ttf of the emulator by renaming a ttf font of your required language to DroidSansFallback.ttf . Do the following steps. 1.Get a market enabled rooted android emulator

How set Spannable object font with custom font

隐身守侯 提交于 2019-11-26 11:42:37
I have Spannable object which I want to set its font by a custom font I have loaded before. Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/font_Name.ttf"); Spannable span1 = /*Spannable Item*/; /// I want to set span1 to have tf font face??? /// Here where I want help. EDIT : My problem is that I want to set two different custom fonts for the text view so I am working with the Spannable Imran Rana This is a late answer but will help others to solve the issue. Use the following code:(I'm using Bangla and Tamil font) TextView txt = (TextView) findViewById(R.id.custom_fonts); txt

How to change the Font Size in a whole Application programmatically, Android?

六眼飞鱼酱① 提交于 2019-11-26 11:10:18
问题 I have created Spinner with the list of Font Sizes from \"8\" to \"46\" . I could be able to click the font Size and in a spinner it has shown me . My need is, if i click the Font Size \"26\" inside a Spinner then it should be applied to my whole project. Like applying to my Screen, Textview appearance, Edittext - Bold/ Italic, etc. Again if i click 46 size then it should be apply to my whole project. How could i do this by programmatically ? 回答1: The probable solution would be you create a

How to add external fonts to android application

主宰稳场 提交于 2019-11-26 09:06:11
问题 I was looking for some stylish fonts for my android application. but the problem is how can i make my android application supportable for external fonts. Thank you. 回答1: You need to create fonts folder under assets folder in your project and put your TTF into it. Then in your Activity onCreate() TextView myTextView=(TextView)findViewById(R.id.textBox); Typeface typeFace=Typeface.createFromAsset(getAssets(),"fonts/mytruetypefont.ttf"); myTextView.setTypeface(typeFace); Please note that not all

how to prevent system font-size changing effects to android application?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 07:29:18
问题 I recently finished developing my android application. I used sp (Scaled pixels) for all textSize. The problem is when i adjusted the system font-size, my application\'s font-sizes are changing. I can use dp (Device independent pixels) but it will take too long to maintain my application. I referenced text size from this. Is there a way to prevent system font-size changing effects to my application ? 回答1: If you require your text to remain the same size, you'll have to use dp . To quote the