Custom fonts in a tvOS TVML app
Asked Answered
W

1

26

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>
Wira answered 22/9, 2015 at 15:13 Comment(3)
I would very much like to know this swell. I can't find it mentioned in the docs However it is mentioned in the interface guidelinesElectrostatics
Guidelines covers tvOS apps in general, Native apps can have any fonts they like.Sonometer
Have you read the answer for this question https://mcmap.net/q/537587/-set-font-family-in-tvml/… ?Bille
D
4

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.

Discommon answered 15/3, 2016 at 18:38 Comment(1)
the shopgate it's a very good one however it's in swift and requires some love to integrate.Plourde

© 2022 - 2024 — McMap. All rights reserved.