Re: Alternatives to altGlyph for non-SVG fonts

On Sat, Sep 27, 2014 at 6:08 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> On 28/09/14 01:17, Tab Atkins Jr. wrote:
>>
>> On Thu, Sep 25, 2014 at 10:15 AM, John Hewson <john@jahewson.com> wrote:
>>>
>>> I noticed that altGlyph is to be removed from SVG2 along with SVG Fonts:
>>>
>>> http://lists.w3.org/Archives/Public/www-svg/2014Jun/0086.html
>>>
>>> But this will remove the ability for SVG to access arbitrary glyphs in
>>> fonts,
>>> which is often seen in formats such as PDF and of course, existing SVG
>>> 1.1
>>> documents which make use of SVG Fonts. Currently there’s no way to
>>> port such documents to SVG2.
>>>
>>> Would it be possible to either keep altGlyph and define a format for
>>> glyphRef
>>> to access TTF/OTF glyphs, for example GID 4 could be accessed using:
>>>
>>> <altGlyph glyphRef="gid(4)”>x<altGlyph>
>>>
>>> Better yet, could a minimal replacement for altGlyph be introduced, for
>>> use only with TTF/OTF web fonts?
>
>
> Yes we do want to have a feature that covers the same use cases as
> <altGlyph> for selecting individual glyphs from a font by ID. <altGlyph>
> never had a well defined format for specifying glyph IDs and as a
> consequence was never implemented (except in some UAs as a means of
> referencing individual glyphs in SVG Fonts).
>
>> CSS has sprouted a number of controls for accessing alternate glyphs
>> in fonts: <http://dev.w3.org/csswg/css-fonts/#font-rend-props>
>>
>> Are these sufficient for your needs?  If not, CSS's model probably has
>> to become stronger.
>
>
> I don't know that CSS is the right level to support this.  Still, I could
> see a couple of places where you could make this work:
>
>   tspan.symbols { content: glyph(123) glyph(456); }
>
> Or perhaps a way to augment the cmap that comes from the font, so that you
> can then reference the glyphs by Unicode character.  Something like:
>
>   @font-face {
>     font-family: My Font;
>     src: url(...);
>     glyphs: U+E000-E007 1234, U+E008 2345;
>   }
>
> which would map glyphs 1234-1241 to Unicode characters U+E000 to U+E007 and
> glyph 2345 to character U+E008.
>
> Still, it feels more like something that should be in the content of the
> document.

My concern is that I don't see why you'd want to access a particular
(unmapped to codepoint) glyph in a font in SVG, but not in HTML.  That
suggests we need a solution that's not SVG-specific, going forward,
and CSS is usually the repository for those kinds of things.

~TJ

Received on Monday, 29 September 2014 17:34:16 UTC