custom-font

How to use custom font with WebView

戏子无情 提交于 2019-11-26 13:06:19
Now I want to display some unicode characters and I have used tag: <font face=" Arial">something here</font> . But it seems that WebView can not find the Arial font because I can only see UFO-characters. Do I have to copy arial.ttf to somewhere or how can I use this TrueType font with WebView ? Thanks. App8ite loadData didn't work for me either, so I used file:///android_asset in the src path. It worked with loadDataWithBaseURL ! For this example I changed the CSS to: @font-face { font-family: 'feast'; src: url('fonts/feasfbrg.ttf'); } body {font-family: 'feast';} Then use the assets path as

Custom Fonts in Android PhoneGap

不打扰是莪最后的温柔 提交于 2019-11-26 12:41:48
问题 I tried to make custom fonts for my application. For that, I wrote this code in my html file: <style type=\"text/css\" media=\"screen\"> @font-face { font-family: centurySchoolbook; src: url(/fonts/arial.ttf); } body { font-family: centurySchoolbook; font-size:30px; } </style> In my Html Body: <body onload=\"init();\"> <h>Custom Fonts</h> <div>This is for sample</div> </body> But, these styles are not applied to my html body.. Any help to solve this..?? 回答1: I made it work after doing the

Add custom font for complete android application

喜夏-厌秋 提交于 2019-11-26 07:22:28
问题 In my application I need to use helvetica font for all the textviews and edit-text fields. Is there any way to do this other than using settypeface method for every textview ? Any suggestion would be a great help. Thanks in advance ! 回答1: I figured it out by my self. This is the code I used. I create custom TextView which has custom font as default font. public class MyTextView extends TextView { public MyTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs,

How to use custom font with WebView

依然范特西╮ 提交于 2019-11-26 05:53:50
问题 Now I want to display some unicode characters and I have used tag: <font face=\" Arial\">something here</font> . But it seems that WebView can not find the Arial font because I can only see UFO-characters. Do I have to copy arial.ttf to somewhere or how can I use this TrueType font with WebView ? Thanks. 回答1: loadData didn't work for me either, so I used file:///android_asset in the src path. It worked with loadDataWithBaseURL ! For this example I changed the CSS to: @font-face { font-family:

Custom font in a storyboard?

余生颓废 提交于 2019-11-26 04:05:59
问题 I have a font added to my iOS project. It\'s in the project and copied when the project builds. It appears to be a valid font and will show up if I list all fonts on the device through the app. I have the plist set up properly to include the font. I can\'t seem to get the find to show up to use it in my text controls, buttons, etc in Xcode 4.2\'s storyboard section. Further it doesn\'t appear to allow me to type the font name, it forces me to use the font dialog. I attempted to install this

How to change font face of Webview in Android?

我与影子孤独终老i 提交于 2019-11-25 23:39:57
问题 I want change the default font of webview to a custom font. I\'m using webview in developing an bilingual browser app for Android. I tried getting an instance of custom typeface by placing my custom font in assets. But still couldn\'t set webview\'s default font to my font. This is what I tried: Typeface font = Typeface.createFromAsset(getAssets(), \"myfont.ttf\"); private WebView webview; WebSettings webSettings = webView.getSettings(); webSettings.setFixedFontFamily(font); Can anyone

Android - Using Custom Font

江枫思渺然 提交于 2019-11-25 23:03:24
问题 I applied a custom font to a TextView , but it doesn\'t seems to change the typeface. Here is my code: Typeface myTypeface = Typeface.createFromAsset(getAssets(), \"fonts/myFont.ttf\"); TextView myTextView = (TextView)findViewById(R.id.myTextView); myTextView.setTypeface(myTypeface); Can anyone please get me out of this issue? 回答1: On Mobiletuts+ there is very good tutorial on Text formatting for Android. Quick Tip: Customize Android Fonts EDIT: Tested it myself now. Here is the solution. You