i gave an svg with some custom fonts (embedded via css's font-face) In the browser it works fine, but if i try to make a base64 encoded image from the SVG, the font wont be recognise.
Gere are my codes:
CSS
svg,text, textPath{
font-family: 'MyFont';
}
@font-face
{
font-family: MyFont;
src: src: url(data:application/x-font-ttf;base64,AAEAAAAQA...);
}
JS im using RaphaelJS
//set the text's font
t.attr({"font-family": "MyFont"})
//make the snapshot
var source = new Image();
$("body").append(source);
$('body').click(function(){
// record start time
var startTime = new Date();
var svg = $('#paper').html();
var mySrc = 'data:image/svg+xml;base64,'+Base64.encode(svg);
//source.src = base64Path + "?" + mySrc.slice(5);
source.src = mySrc;
var endTime = new Date();
console.log(endTime - startTime);
});