0

i want my text look better in web view but when i try to load a font for it,it doesnt change. according to some questions this and this i found this code:

<style type="text/css">
@font-face {
font-family: "My Custom Font";
src: url(http://www.example.org/mycustomfont.ttf) format("truetype");
}
p.customfont { 
font-family: "My Custom Font", Verdana, Tahoma;
}
</style>
<p class="customfont">Hello world!</p>

i tried this for loading it from assets:

<style type=text/css>
@font-face {
font-family: "ROYA";
src="Roya.ttf";
}
p.customfont { 
font-family: "ROYA", Verdana, Tahoma;
}
<p class="ROYA">Hello world!</p>

but it doesnt working. what should i do?

Community
  • 1
  • 1

2 Answers2

1

use : instead or =

@font-face{
  font-family: "ROYA";
  src: url("Roya.ttf") format("truetype");
}

and change class name on the next code block

p.ROYA { 
font-family: "ROYA", Verdana, Tahoma;
}
<p class="ROYA">Hello world!</p>
Abood
  • 572
  • 1
  • 5
  • 13
0

You still need url().

@font-face{
  font-family: "ROYA";
  src: url("Roya.ttf") format("truetype")
}
Brad
  • 159,648
  • 54
  • 349
  • 530