android-fonts

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

寵の児 提交于 2019-11-27 09:22:24
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. Imran Rana 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. You can find one here: Rooted Market Enabled AVD 2.Then grab an explorer app, I prefer root

How to get name of the font applied on the textview

我的梦境 提交于 2019-11-27 08:16:59
问题 Textview label = (TextView) findViewById(R.id.item_title); label.setText("Solve My Issue !"); Log.d("TAG","Font-Family : "+ String.valueOf(label.getTypeface())); When i see the log it return Font-Family : android.graphics.Typeface@7f37f870 How to know the name of the font family ? Is it possible ? 回答1: getTypeface() method returns the Typeface of label , while this Tyepface instance is a value of Map<String, Typeface> sSystemFontMap , which is a static field of Typeface . So now you get the

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

邮差的信 提交于 2019-11-27 04:38:44
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 ? The probable solution would be you create a base class which extends TextView , and use this text view class as edit text. Hope you are asking for size in

Android sp vs dp texts - what would adjust the 'scale' and what is the philosophy of support

眉间皱痕 提交于 2019-11-27 03:41:29
So we know from many other posts that we should use sp rather than dp for text in Android, and we know the reason for this is to respect a 'user's preferences'. But precisely what are these preferences? How might a user change this setting? I cannot find any reference through the settings on my phone (I would have expected something in 'Accessibility' or 'Display'). So what is a user setting? Is it only done through the likes of an app such as 'Big Font'? Assuming that it is (set by something like big font) - I have played with Google Docs and some other Google apps with the font set to 130%.

Reducing font size of AlertDialog.Builder's components

♀尐吖头ヾ 提交于 2019-11-27 03:16:26
问题 I created an AlertDialogue using the following code : int selectedModeId=0; public void sortTypeModeSelection(){ AlertDialog.Builder alertBuilder=new AlertDialog.Builder(WatchListDetailActivity.this); alertBuilder.setSingleChoiceItems(R.array.watchlist_sorting_modes,selectedModeId, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int which) { switch (which){ case 0: selectedModeId=0; break; case 1: selectedModeId=1; break; case 2: selectedModeId=2; break;

Set Indian Rupee symbol on text view

ぃ、小莉子 提交于 2019-11-27 00:19:36
问题 I am developing an application. And i need to set the symbol of Indian rupee on text view which is set with the text as amount. Symbol: I am having the font or .TTF file of this in Assets/fonts folder. And i tried to use it as : Typeface typeFace_Rupee = Typeface.createFromAsset(getAssets(),fonts/Rupee_Foradian.ttf"); TextView tvRupee = (TextView) findViewById(R.id.textview_rupee_mlsaa); tvRupee.setTypeface(typeFace_Rupee); // Tried to set symbol on text view as follows. tvRupee.setText("`");

Android Tamil font between english word

*爱你&永不变心* 提交于 2019-11-26 23:03:27
问题 I am having a TextView that has a huge text in between i have a tamil word and i know how to embedd the tamil font in seperate textview .but i need the tamil word between english word please help thanks in advance my part of text in textview : Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's 回答1: Try setting this Akshar.ttf font to your TextView through setTypeface, it suuports both English and Tamil. Here is

Font size of TextView in Android application changes on changing font size from native settings

耗尽温柔 提交于 2019-11-26 22:31:24
问题 I want to specify my own text size in my application, but I am having a problem doing this. When I change the font size in the device settings, the font size of my application TextView also changes. 回答1: Actually, Settings font size affects only sizes in sp . So all You need to do - define textSize in dp instead of sp , then settings won't change text size in Your app. Here's a link to the documentation: Dimensions However please note that the expected behavior is that the fonts in all apps

Accessing a font under assets folder from XML file in Android

我与影子孤独终老i 提交于 2019-11-26 20:32:04
问题 I am trying to do a application-wide font change and creating a style file to do so. In this file (below) I just want to change typeface value of TextAppearance style of Android. <?xml version="1.0" encoding="utf-8"?> <resources> <style name="NightRiderFont" parent="@android:style/TextAppearance"> <item name="android:typeface"> /***help need here***/ </item> </style> </resources> However font is in "assets/fonts/". How can I access this font, so I can use that style as a theme to get rid of

“RuntimeException: native typeface cannot be made” when loading font

社会主义新天地 提交于 2019-11-26 20:04:35
问题 I am attempting to use a custom font for a TextView on Android, following the guide here. Using the same font, same code, same everything, I get this in adb logcat: W/dalvikvm( 317): threadid=1: thread exiting with uncaught exception (group=0x4001d800) E/AndroidRuntime( 317): FATAL EXCEPTION: main E/AndroidRuntime( 317): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.evilx.quacklock/org.evilx.quacklock.MainActivity}: java.lang.RuntimeException: native typeface cannot