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

Testing SVG fonts

From: Stanislaw Jesmanowicz <stan@decotype.com>
Date: Mon, 13 Jan 2014 16:51:26 +0100
Message-ID: <52D40B7E.8070406@decotype.com>
To: www-svg@w3.org
Dear SVG W3 members,

I am working on high quality Arabic web typography, using our own
'procedural font technology', to overcome limitations
of conventional (like WOFF), static font technology.
For web rendering we chose SVG, which most of modern web browsers
support quite nicely.
You can see a test of that on http://decotype.com/MARA
Since we are dealing with texts, it desirable to implement some kind of
'text selections' and 'text searching'.
I have tested the SVG font technique, specifically the altGlyph tag.
In this way we can define a unique SVG path for every glyph like:
<font id='xyz' ... >
<glyph id='g1' horiz-adv-x='10' d='M ...' />
<glyph id='g2' horiz-adv-x='20' d='M ...' />
<altGlyphDef id='a1'><glyphRef xlink:href='#g1'
<altGlyphDef id='a2'><glyphRef xlink:href='#g2'
<g font-family='xyz'>
<text ... >
<altGlyph xlink:href='#a1'
<altGlyph xlink:href='#a2'
It looks very promising according to the specifications, but I found
some problems with it:
1. First of all, only WebKit based browsers support partially the SVG
font specifications, like Chrome, Safari   
   and home made browsers built with WebKit

2. In Arabic web typography glyphs may overlap each other and sometimes
a next glyph can be positioned behind    
   the previous one (this is the case for vowels and dots, but also
between two main characters within a word

   a letter group gap or even across a space character that separates
   It looks like it that current SVG font implementations use only the
glyph's horiz-adv-x tag to determine the

   of the glyph and the position of next
   I tried to manipulate the horiz-adv-x values in combination with
shifting 'path' values in case of overlapping

   but it returned erroneous visualization of the
   Moreover, since horiz-adv-x cannot be negative it is useless in case
of glyphs that are behind (positioned upstream

   to their) predecessors.
   Another thing is that if the horiz-adv-x value is 0 than the glyph
doesn't render at all.
   An example of my test you can see on http://decotype.com/svgfont.html
   The specific SVG file is on http://decotype.com/decotype_svgfont.svg
   You can see there that I am using a tiny horiz-adv-x value to make it
visible and you can select all text
   with a tiny narrow selection box.
3. Searching in SVG text is not implemented at all.
My question is whether these issues are known and whether is there a
realistic perspective that they will be
addressed both in the specifications and implementations.

Best regards,
Stan Jesmanowicz


Stanislaw Jesmanowicz, mail: stan <at> decotype <dot> com
Amsterdam, The Netherlands,  mobile: +31 653380520 
Received on Monday, 13 January 2014 15:51:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:50 UTC