Answer the question
In order to leave comments, you need to log in
How to embed custom font in canvas?
There is a certain panel, drawn on canvas. The panel displays data, updated by ajax, the data is given by the php script. You need to embed a non-standard font.
For example, if I do this, then the variable on the canvas is displayed:
ctx.fillText( <script language="php">
echo $sensor_data['ts'];
</script> , 40, 45);
$HTML = '
<head>
<link rel="stylesheet" href="font.css">
<style type="text/css">
h1 {
font-family: "DSDIGI";
}
</style>
</head>
<body>
<h1>'.$ts.'</h1>
</body>
';
ctx.fillText( <script language="php">
print $HTML;
</script> , 40, 45);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question