Forum How do I...?

Roboto Font not coming through on Prince 11

amyd
I have trouble getting Roboto to come through on Prince version: <princexml.version>20160124</princexml.version>
which I believe is Prince 11.

I can get other fonts through but not Roboto, which is what our brand calls for. I run the same code through Prince 12 and it works fine. I've tried many different ways, include loading the roboto.ttf in my directory. How can I get this to work on Prince 11 (version 20160124)?

<html>
<head>
<link href="roboto.ttf">
<style>
html {
font-family: "Roboto", sans-serif;
}
</style>
</head>
<body>
<div>EQUIPMENT REPORTS</div>
</body>
</html>
amyd
I heard from another team that we need to store Roboto font on the server. I'm not sure why this font needs to be stored when others do not. Maybe all non-standard fonts need this treatment?
mikeday
You cannot link directly to a .ttf file like that, it requires a CSS @font-face rule:
@font-face {
    font-family: Roboto;
    src: url("/path/to/roboto.ttf")
}

Or link to it remotely like this:
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<p style="font-family: Roboto">Hello!</p>
amyd
Thanks -- I had tried that and it doesn't work. I was told by another team that they had to install the font on the server so we're going to try that.
mikeday
I'm surprised it doesn't work, do you see any errors or warnings in the Prince output log? Are you running Prince with the --no-network flag?