When using your own font in the subtitles, you need to provide the URL to the font file in the font-url
property.
The font file must be a valid font file in TTF format.
Also, the font file must be hosted in a public URL, so it can be accessed by the API. You can host your font file in your server or in a service like Google Drive or Dropbox.
Example:
{
"type": "subtitles",
"settings": {
"style": "classic",
"font-url": "https://example.com/fonts/my-font.ttf",
"font-family": "My Font"
}
}
Using a Google Font
You can also use any font from Google Fonts but you need to provide the URL to the font file in the font-url
property.
The easiest way is to download the font file from Google Fonts and host the TrueType Font (TTF) file in your server:
- Go to Google Fonts and select the font you want to use.
- Click on the Select this font button.
- Click on the Download button.
- Unzip the file and copy the
TTF
file to your server or Google Drive. - Use the URL of the
TTF
file in thefont-url
property.
Using fonts hosted in Google Drive
If you are hosting your font file in Google Drive you must make the file publicly accessible.
- Go to Google Drive and find the file you want to use.
- Click on the Share button. A dialog will appear.
- In the General access section, change the the option to Anyone with the link.
- Click on the Get link button.
- Use the URL in the
font-url
property.