Reputation: 3285
I've two views on my view one is a UIWebview
and other is a UITextView
and I want both of them to display system default font. But, I just loaded a plain HTML
text on my UIWebview
and loaded another plain text on textview with default system font. On UIWebview
it looks like Times New Roman and on textview it looks like Helvetica. Does the default system font differs for UIWebview
?
This is the HTML
page source that I load and below is a textview that uses system font.
<html>
<body>
This is a sample html Page
</body>
</html>
Upvotes: 0
Views: 1708
Reputation: 73
UIWebView
is just a Safari component inside your app. So when you put HTML content into it, you're kind of loading a page.
The default fontface for web content is Times New Roman, so if you want to change it you need to style your HTML content to change default fontface, using the same type as the system.
Upvotes: 0
Reputation: 1051
I presume if you didn't specify the Font name in html it will take default Font from OS. The default font may vary based on OS and browsers. In iOS you can specify the default name like given below:
<html>
<head>
<style type=\"text/css\">
body{font-family: '-apple-system','HelveticaNeue'; font-size:17;}
</style>
</head>
<body>
This is a sample html Page
</body>
</html>
In the above code it will take apple default font. If it is not available it will take HelveticaNeue font.
Upvotes: 2