I have a logo created from Inkscape,the font which is used in the logo was installed in the local system.
In other system, the font may not exist. I want to embed the font and use that font in svg. I have tried this but no luck,what is that I am doing wrong?
<style type="text/css"><![CDATA[
@font-face {
font-family: "Bahamas";
src: url("../fonts/Bahamas.ttf") format("ttf");
font-weight: normal;
font-style: normal;
}
]]></style>
and I tried using <defs>
tag like so
<defs>
<style type="text/css">
@font-face {
font-family: 'Bahamas';
src: url('../fonts/Bahamas.ttf');
font-weight: normal;
font-style: normal; }
</style>
</defs>
This is a part of svg from the file
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:9.35660839px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.23391519"
x="64.662544"
y="31.874653"
id="text3701"
transform="scale(1.0383014,0.96311149)">
<tspan
sodipodi:role="line"
x="64.662544"
y="31.874653"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.96076584px;font-family:Bahamas;-inkscape-font-specification:'Bahamas, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0.81870329px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;stroke-width:0.23391519"
id="tspan3715">
<tspan
id="tspan84"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.96076584px;font-family:Bahamas;-inkscape-font-specification:'Bahamas, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0.81870329px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;stroke-width:0.23391519"
dy="5.8478818">
<tspan
style="fill:#8ec622;fill-opacity:1;stroke-width:0.23391519"
id="tspan92">Fair</tspan>
<tspan
style="fill:#2d7cad;fill-opacity:1;stroke-width:0.23391519"
id="tspan96"
dx="0 -1.2995973 0.43319905">Tex</tspan>
</tspan>
</tspan>
<tspan
sodipodi:role="line"
x="64.662544"
y="47.458599"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.98038292px;font-family:Bahamas;-inkscape-font-specification:'Bahamas, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:1.13448882px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;stroke-width:0.23391519"
id="tspan86" />
</text>
You don't say, but I'm going to assume that you are using the SVG as a standalone file, and embedding it with <img>
of background-image
etc.
The simplest solution is to convert your text to outlines. Use "Path -> Object to path" in Inkscape.
If, for some reason, you prefer to keep using the font file, then you are going to need to embed the font in the SVG itself. That is because SVGs included using <img>
etc must be self-contained, and not refer to other files. See this question for more into.