The logo for my website is an SVG file. I use a simple initials based logo, just X & R for the logo, set in Teko font.
When using fonts in SVG, non-system fonts are forcibly replaced by the standard system fonts. 1
Since SVG supports CSS for styling, it is easier to include the font into the SVG.
To do that,
- Embed the base64-encoded font source into the SVG with a
defs
element.
<defs>
<style>
@font-face {
font-family: 'Teko';
font-style: normal;
font-weight: 400;
src: local('Teko'), local('Teko-Regular'),
url(data:font/woff2;base64,BASE_64_STRING_GOES_HERE) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
</style>
</defs>
- Convert the font to base64 using the Embedded Google Fonts tool and replace the
BASE_64_STRING_GOES_HERE
with the base64 string.
Footnotes
-
I had run into this issue a couple of years back for Radix Day logos. β©