Embedding fonts in web svg documents.
In most software (e.g., Scribus, TeX) a font can be embedded in the output document, thus preventing font substitution in a viewer. In inkscape one can simply outline the text, but that makes the text not readable by a web crawler.
Is there a way to actually embed a font in an Inkscape svg document intended for web use?
Here is how you can embed fonts in SVG documents: (replace <data> with actuall base64-encoded font data):
<style> @font-face { font-family: "Sample font"; src: url("data:font/woff;charset=utf-8;base64,<data>"); } </style>
This technique is already used in Inkscape for embedding PNG images, it should be very easy to implement a plugin that allows for automatic font embedding as well.
On Sun, Nov 6, 2011 at 4:48 PM, john Culleton <John@...1668...> wrote:
In most software (e.g., Scribus, TeX) a font can be embedded in the output document, thus preventing font substitution in a viewer. In inkscape one can simply outline the text, but that makes the text not readable by a web crawler.
Is there a way to actually embed a font in an Inkscape svg document intended for web use?
-- John Culleton Free list of books for self-publishers: http://wexfordpress.net/shortlist.html
"Create Book Covers with Scribus" http://www.booklocker.com/books/4055.html
RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Tue, 8 Nov 2011 04:27:13 +0100 Jarek Foksa <jarek@...2725...> wrote:
Here is how you can embed fonts in SVG documents: (replace <data> with actuall base64-encoded font data):
<style> @font-face { font-family: "Sample font"; src: url("data:font/woff;charset=utf-8;base64,<data>"); } </style>
This technique is already used in Inkscape for embedding PNG images, it should be very easy to implement a plugin that allows for automatic font embedding as well.
I was not aware of the WOFF font effort! Looks interesting. I am studying this web page and its children: http://people.mozilla.com/~jkew/woff/ I have a 32 bit processor. Can I still use base64 fonts? Or are the two not related?
You can also convert the fonts to paths On Nov 11, 2011 10:42 AM, "john Culleton" <John@...1668...> wrote:
On Tue, 8 Nov 2011 04:27:13 +0100 Jarek Foksa <jarek@...2725...> wrote:
Here is how you can embed fonts in SVG documents: (replace <data> with actuall base64-encoded font data):
<style> @font-face { font-family: "Sample font"; src: url("data:font/woff;charset=utf-8;base64,<data>"); } </style>
This technique is already used in Inkscape for embedding PNG images, it should be very easy to implement a plugin that allows for automatic font embedding as well.
I was not aware of the WOFF font effort! Looks interesting. I am studying this web page and its children: http://people.mozilla.com/~jkew/woff/ I have a 32 bit processor. Can I still use base64 fonts? Or are the two not related? -- John Culleton Free list of books for self-publishers: http://wexfordpress.net/shortlist.html
"Create Book Covers with Scribus" http://www.booklocker.com/books/4055.html
RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Fri, 11 Nov 2011 12:03:25 -0500 Matt Hines <matt.0f.h@...155...> wrote:
You can also convert the fonts to paths
Yes, but then I lose the ability of web browsers to read the text. One of the advantages of the svg web page is that one can do fancy stuff and still have the text readable and indexable.
I was not aware of the WOFF font effort! Looks interesting. I am studying this web page and its children: http://people.mozilla.com/~jkew/woff/ I have a 32 bit processor. Can I still use base64 fonts? Or are the two not related?
Not related. Base64 is just the name of an encoding method which allows binary data to be encoded into an ASCII format - in this case so that it can be embedded directly into an SVG (or HTML) document.
Mark
On Tuesday, November 8, 2011, 4:27:13 AM, Jarek wrote:
JF> Here is how you can embed fonts in SVG documents: (replace <data> with JF> actuall base64-encoded font data):
JF> <style> JF> @font-face { JF> font-family: "Sample font"; JF> src: url("data:font/woff;charset=utf-8;base64,<data>"); JF> } JF> </style>
Note that the media type for woff is application/font-woff http://www.w3.org/TR/WOFF/#appendix-b
There is not currently a font/* top level type. It would be great if there were; and it may yet happen. But that is the current situation.
participants (5)
-
Chris Lilley
-
Jarek Foksa
-
john Culleton
-
Mark Crutch
-
Matt Hines