W3C home > Mailing lists > Public > www-svg@w3.org > February 2014

Re: SVG fonts discussion

From: Tavmjong Bah <tav.w3c@gmail.com>
Date: Sat, 01 Feb 2014 17:38:35 +0100
Message-ID: <1391272715.24628.12.camel@localhost.localdomain>
To: robert@ocallahan.org
Cc: Erik Dahlstrom <ed@opera.com>, "www-svg@w3.org" <www-svg@w3.org>
On Sun, 2014-02-02 at 01:01 +1300, Robert O'Callahan wrote:
> On Fri, Jan 31, 2014 at 5:13 AM, Erik Dahlstrom <ed@opera.com> wrote:
>            shepazu: I think there could be some value at republishing
>         at
>            W3C
>            ... second question is, since we are killing off SVG fonts,
>         for
>            those browsers who decided to never do SVG fonts, that's
>         good
>            news
>            ... there's a chance we'll see this new SVG glyphs in other
>            browsers since they already do OpenType
>            ... with the shitty internationalization of the old SVG
>         Fonts,
>            it was reasonable for them not to implement it
>            ... what I hated about SVG Fonts was the inverted
>         coordinate
>            system
>            ... is there any possibility for us resurrecting SVG Fonts
>         in a
>            way, by embedding an OpenType font in the document?
>         
>            ChrisL: the XML serialization of OT, UFO, is very verbose
>            ... the binary format is very compact, lots of tables with
>            bytes
>            ... by the way, WOFF is a way to wrap up any sfnt font
>         
>            Tav: would it be possible to have the table information in
>         the
>            font, but feed in the SVG glyphs to it?
>         
>            ChrisL: that would be interesting
>            ... there is a demo of that, but it's kind of hacky
>            ... roc made it. you load in an OpenType font, and gives
>         you a
>            textarea to enter some SVG, wraps it up and sticks it into
>         the
>            table, generates an OpenType font
> 
> 
> You were referring to
> https://github.com/rocallahan/svg-opentype-workshop. Naturally I don't
> think this solution is hacky :-). OpenType is just a binary format;
> it's a little harder for JS to stuff SVG content into than if it were
> XML, but it's not different in kind. That code is not complex. I
> honestly think this is a solved problem and we won't need any browser
> API for manipulating font data.
> 
> 
>            Tav: I tried to do this with inkscape, but I ran into
>         trouble
>            since we use Pango for text layout, which doesn't let you
>            insert a user font
>            ... I was going to intercept the layout information from
>         Pango,
>            and just draw the SVG glyph
>         
>            ChrisL: I should say, Behdad Esfabod has been at these
>         meetings
>            and is aware of this
>            ... and is interested in adding this to Harfbuzz 
> 
> 
> I don't know what needs to be added to Harfbuzz. Harfbuzz is designed
> to handle shaping and leaves glyph rendering to the application, so
> choosing to rendering some glyphs via SVG doesn't require changes to
> Harfbuzz. I suppose Harfbuzz could add an API to read the SVG glyphs
> directory but that's very simple stuff.
> 
> 
>            shepazu: maybe not right now, but this is a useful use case
>         to
>            pursue in the future
>         
>            Tav: yeah. it's a way of getting your cake and eating it
>         too.
>            ... basically saying OpenType handles all the nasty i18n
>         layout
>            stuff, and we provide a glyph
> 
> 
> Yes, that separation between shaping and glyph rendering is assumed by
> Harfbuzz (and by Cairo before it, and elsewhere).

Yes, that is true. We (Inkscape) render the paths ourselves. The problem
is that Inkscape relies on Cairo/Pango for laying out text. At the
moment Pango only makes available to Inkscape fonts that are already
installed on the system. We cannot include a font (SVG or OpenType) in
an SVG file, extract it, and then insert it into the list of fonts Pango
knows about.

There was some discussion a few years ago and some a bit of work to make
this possible but it is far from complete.[1][2] I started down the path
of finishing the work but quickly ran into problems.

Tav


[1] http://lists.cairographics.org/archives/cairo/2008-April/013698.html
[2] https://bugzilla.gnome.org/show_bug.cgi?id=347237
Received on Saturday, 1 February 2014 16:39:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:35 UTC