Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom fonts in a tvOS TVML app

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>
like image 626
Aodh Avatar asked Sep 10 '25 23:09

Aodh


1 Answers

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.

like image 52
Joe Longstreet Avatar answered Sep 13 '25 00:09

Joe Longstreet