Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

embedding SVG fonts in HTML?

23 views
Skip to first unread message

Sarreq Teryx

unread,
Jun 15, 2007, 12:22:07 AM6/15/07
to
I've been using minefeild for a few days now, I don't know if either I'm doing
something wrong, or it just doesn't work or what, I've googled all over the
place and found nothing. Can SVG fonts be directly embedded in HTML documents,
if so how, if not, why not? I only ask because it seems like an obvious thing to
be able to do.

Robert Longson

unread,
Jun 16, 2007, 1:57:46 PM6/16/07
to

The current mozilla trunk does not support svg fonts. See
http://www.mozilla.org/projects/svg/status.html and bug 119490. When
it does you would be able to put svg text which used svg fonts in
xhtml documents. xhtml text would not be able to use svg fonts
directly and you will not be able to do this with HTML documents at
all as you can't put svg in them.

To embed you would do something like this:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body>
<svg xmlns="xmlns="http://www.w3.org/2000/svg">
<font id="Font1" horiz-adv-x="1000">
<font-face font-family="Super Sans" font-weight="bold" font-
style="normal"
units-per-em="1000" cap-height="600" x-height="400"
ascent="700" descent="300"
alphabetic="0" mathematical="350" ideographic="400"
hanging="500">
<font-face-src>
<font-face-name name="Super Sans Bold"/>
</font-face-src>
</font-face>
<missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph>
<glyph unicode="!" horiz-adv-x="300"><!-- Outline of exclam. pt.
glyph --></glyph>
<glyph unicode="@"><!-- Outline of @ glyph --></glyph>
<!-- more glyphs -->
</font>
</defs>
<text x="100" y="100"
style="font-family: 'Super Sans', Helvetica, sans-serif;
font-weight: bold; font-style: normal">Text
using embedded font</text>
</svg>
</body>
</html>

dc....@gmail.com

unread,
Nov 25, 2018, 5:16:58 PM11/25/18
to
On Saturday, June 16, 2007 at 1:57:46 PM UTC-4, Robert Longson wrote:
> On Jun 15, 5:22 am, "Sarreq Teryx" <sar...@gmail.com> wrote:
> > I've been using minefeild for a few days now, I don't know if either I'm doing
> > something wrong, or it just doesn't work or what, I've googled all over the
> > place and found nothing. Can SVG fonts be directly embedded in HTML documents,
> > if so how, if not, why not? I only ask because it seems like an obvious thing to
> > be able to do.
>
> The current mozilla trunk does not support svg fonts. See
> http://www.mozilla.org/projects/svg/status.html and bug 119490. When
> it does you would be able to put svg text which used svg fonts in
> xhtml documents. xhtml text would not be able to use svg fonts
> directly and you will not be able to do this with HTML documents at
> all as you can't put svg in them.

I see this is still not implemented. Is there any work-around (aside from changing the text to paths)? Any clever combination of CSS with SVG or some such?

Jeremie Patonnier

unread,
Nov 25, 2018, 6:11:08 PM11/25/18
to dc....@gmail.com, dev-te...@lists.mozilla.org
Hi!

Theres is absolutly no plan to support SVG font in Firefox and there is a
large consensus to deprecate SVG fonts as a whole. All browsers which had
implemented some of it have drop their support and SVG2 removed SVG fonts
completly.

If you want to use fonts in SVG, simply use CSS Fonts like you would in an
HTML document.
> _______________________________________________
> dev-tech-svg mailing list
> dev-te...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-svg
>


--
Jeremie
.............................
Web : http://jeremie.patonnier.net
Twitter : @JeremiePat <http://twitter.com/JeremiePat>
0 new messages