Is there a way to use custom fonts in an Apple tvOS TVML
based application? I've tried the @font-face
at-rule to no avail.
<document>
<head>
<style>
@font-face {
font-family: 'My Awesome Font';
font-weight: 600;
src: url("${this.BASEURL}/resources/fonts/awesome-font-bold.otf");
}
</style>
</head>
...
</document>
It's not possible to set the font-family in tvOS using Apple's provided TVML styles. You can however use the TVElementFactory class to extend upon TVML to create new markup elements.
This article from Shopgate describes the process. They've also put together a repository with a sample project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With