On Thu, Jun 30, 2011 at 2:16 AM, Erik Dahlstrom <ed@opera.com> wrote:
> On Wed, 29 Jun 2011 12:01:44 +0200, Robert O'Callahan <
> robert@ocallahan.org> wrote:
>
> On Wed, Jun 29, 2011 at 8:03 PM, Erik Dahlstrom <ed@opera.com> wrote:
>>
>> The reason why I like SVG Fonts is because they're different to the other
>>> formats. It's easy to build a new SVG Font using javascript and to use it
>>> directly in the browser. If an SVG Font is stored in an OFF container I
>>> take
>>> it that would mean that it's not possible to change it dynamically?
>>>
>>>
>> Not directly, but it would still be possible to generate new fonts on the
>> fly --- use a JS library that wraps SVG glyphs in an OpenType container,
>> and
>> load the result using Blob URL. JS engines are good at manipulating binary
>> data these days.
>>
>
> Sounds cumbersome compared to just using the svgfont without the OpenType
> container.
>
Once the library exists, it would be a couple of lines of code to import the
library, generate the font blob, and load it. That approach is also far more
flexible since the library can be extended to support complex OpenType
shaping, complex font features (such as John's CSS3 font-variant
extensions), etc.
It's always more cumbersome to use libraries than to build functionality
directly into the browser, but I want to resist the temptation to build
everything into the browser.
> ...
>
> Out of
>>> curiosity I'd be interested in hearing if there are any other use-cases
>>> that
>>> would be helped by having script support in the font itself.
>>>
>>>
>> Having script run in the font itself has all the same issues that having
>> script run in SVG images would have --- and more. Just a taste: what would
>> you do if your font does "document.location = 'http://google.com';"
>> (i.e.,
>> replaces the font document with some HTML document)? Get script turned on
>> in
>> SVG images in Opera, then we can talk again :-).
>>
>
> So (intentionally or not) you just misrepresented what I wrote. I asked
> about possible use-cases. That is all.
I apologize. It was unintentional, I thought you were advocating enabling
script inside fonts.
Rob
--
"If we claim to be without sin, we deceive ourselves and the truth is not in
us. If we confess our sins, he is faithful and just and will forgive us our
sins and purify us from all unrighteousness. If we claim we have not sinned,
we make him out to be a liar and his word is not in us." [1 John 1:8-10]