Add custom font for complete android application

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, defStyle); init(); } public MyTextView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public MyTextView(Context … Read more

UITextView renders custom font incorrectly in iOS 7

I debugged this issue a little, and it seems to be a bug in the way NSLayoutManager layouts the text. As other answers pointed out, UITextView is build around TextKit since iOS7, and thus uses NSLayoutManager internally to layout text. UILabel uses Core Text to layout text directly. Both eventually use Core Text to render … Read more

Xcode 8 custom font doesn’t show up in interface builder

Try Below Steps: Code tested in Swift 3. Step 1: Add Your custom font into your project( Make sure Add to Target ticked).I am using “PermanentMarker.ttf”,”Pecita.otf” and “AROLY.ttf” font as a test font. Note: Supporting font Type ttf and otf (Both font types should work) Step 2: Modify the application-info.plist file. Add the key “Fonts … Read more

How to use custom font with WebView

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 the base url: loadDataWithBaseURL(“file:///android_asset/”,myhtml,”text/html”,”utf-8″,null);

How to change font face of Webview in Android?

There’s a working example of this in this project. It boils down to: In your assets/fonts folder, place the desired OTF or TTF font (here MyFont.otf) Create a HTML file that you’ll use for the WebView’s content, inside the assets folder (here inside assets/demo/my_page.html): <html> <head> <style type=”text/css”> @font-face { font-family: MyFont; src: url(“file:///android_asset/fonts/MyFont.otf”) } … Read more

Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4

I got the exact same error, and in my case it turned out to be because of a wrong path for the @font-face declaration. The web inspector never complained with a 404 since the dev server we’re using (live-server) was configured to serve up the default index.html on any 404:s. Without knowing any details about … Read more

tech