PHP & dynamic SVG TTF issue

Hi there, I don’t know exactly where to post this so I hope it catches someones attention.

I have a file called svg.php which puts some TTF text on a curved path and aligns it center. This file displays the TTF font perfectly when I type in the address localhost/AJAX/svg.php?initials=FOO. As expected I get the letters FOO in my font LHF.ttf perfectly aligned to the curve. Below is the code for svg.

header(‘Content-Type: image/svg+xml’);
<?xml version=“1.0” encoding=“utf-8”?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) –>
<!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1//EN” “”>
<svg version=“1.1” id=“Layer_1” xmlns=“” xmlns:xlink=“” x=“0px” y=“0px”
width=“380px” height=“253px” viewBox=“0 0 380 253” enable-background=“new 0 0 380 253” xml:space=“preserve”>
<style type=“text/css”><![CDATA[
@font-face {
font-family: ‘LHF’;
src: url(‘localhost/Ajax/LHF.ttf’);
text, textPath {

<path id=“path1” fill=“none” d=“M50.333,120.339 c92.778-24.903,185.556-24.903,278.334,0”/>

<text x=“100” y=“500” font-size=“100” style=“fill:black;” text-anchor=“middle”><textPath xlink:href=“#path1” startOffset=“50%”><?php echo $_GET[“initials”]; ?></textPath></text>

However the TTF font is dropped and the default font is used when I call on the image from another page, like index.php for example:

<!DOCTYPE html>
function myFunction()
var x=document.getElementById(“fname”).value;
document.getElementById(“words”).src=“svg.php?initials=” + x;

<input type=“text” id=“fname” onkeyup=“myFunction()”><br />

<img src=“svg.php?initials=okay” id=“words” />


Any ideas why the TTF font disappears when calling the image this way?

Thanks in advance

Solved this problem, you must base64 encode the font.