On Sun, 18 Jan 2009 14:11:49 +0100, pete.haikonen <[email protected]>
wrote:
> Hello,
>
> I have a text and an SVG font. From what I understood, if I define a
> style with two fonts: my font and also with some other font, say:
>
> .mystyle { font-family: "myfont", "otherfont" }
>
> what will happen is that the text will be set in "myfont" unless the
> needed glyph wont be found in it, then "otherfont" will be used. Right?
In theory yes.
> My question is, is it possible to automatically set all the glyphs
> from "otherfont" in other color, say red?
>
> For instance: "myfont" has "ABC" glyphs and "otherfont" has "abc". So
> the text:
>
> <span style="mystyle">ABCabc</span>
>
> will have the other half set in red "otherfont".
>
> In other words, is it possible to let the user know that the glyph
> substitution occurred, possibly without javascript checking every
> letter in the text whether it has corresponding glyph in first font or
> the other?
In theory yes.
There are two problems:
a) the font-family matching may (and most probably will) switch to another font
other than the 'otherfont' in current viewers
b) to the best of my knowledge no viewer currently supports full svgfonts, only
the subset defined in SVG Tiny 1.2 (which allows you do define the glyphshapes
but not to style the glyphs in the font itself)
If you wanted to use one font and then another, you could do for example:
<text font-family="myfont">ABC<tspan font-family="otherfont">abc</tspan></text>
And if you wanted to have the uppercase abc in red, just add fill="red" to that
element, and set another fill for the tspan.
Why do you need to know which font a particular glyph came from?
Cheers
/Erik
--
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
------------------------------------
-----
To unsubscribe send a message to: [email protected]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/